chilinut
Forum Replies Created
-
Forgot to click resolved.
Perfect! Thanks a lot.
Forum: Hacks
In reply to: Display post link for 1 hourIt should only affect the ones you want. Notice the last 3 lines:
add_filter( 'posts_where', 'filter_where' ); $query = new WP_Query( $query_string ); remove_filter( 'posts_where', 'filter_where' );the filter is added, applied to the query you want, then immediately removed!
I found this workaround in jQuery
$(document).ready( function() { $(".widget-title").css("height","26px"); })but I don’t like that as a permanent solution.
Forum: Hacks
In reply to: Display post link for 1 hourif your category you are getting posts from is called youtube-feed then your query string might look like this
$query = new WP_Query( 'category_name=youtube-feed' );note that category_name requires a Category SLUG as input
if you want to do it by category name instead of slug, then it would be
$my_cat_ID=get_cat_id('Youtube'); $queryString="cat=".$my_cat_ID;so based on the filter code from my last post, you would simply insert the query string code directly before the filter code. This is code that will work by placing it in the php file of the page you are modifying. You can refer to the codex to learn how to display the posts returned by the query. However, if you are actually making a widget, something that will live in widgets.php, then it is more complicated and you can refer to the codex entry on widgets
http://codex.wordpress.org/Widgets_APIand beyond that, google is your friend, which returned this page here
http://www.makeuseof.com/tag/how-to-create-wordpress-widgets/
Forum: Plugins
In reply to: [Simple Twitter Feed] Mistakes character code for hashtagSetting the option
decode="yes"fixed it 🙂Forum: Hacks
In reply to: Display post link for 1 hourhttp://codex.wordpress.org/Class_Reference/WP_Query#Time_Parameters
Below is a modified version of the codex example for getting posts within a date range that should retrieve posts from the last hour
// Create a new filtering function that will add our where clause to the query function filter_where( $where = '' ) { // posts in the last HOUR $where .= " AND post_date > '" . date('Y-m-d-H-i-s', strtotime('-1 hour')) . "'"; return $where; } add_filter( 'posts_where', 'filter_where' ); $query = new WP_Query( $query_string ); remove_filter( 'posts_where', 'filter_where' );