Moving the blog page

When you are selecting a static page as homepage, you can use an existing page(or a new page) to select as blog page. It won’t need any custom code to display anything. If you want to display a blog on a page which as a slug /blog/ to display the blog layout with your own … Read more

How to add the time of a post to the list of posts on the administration page?

Try this: add_filter(‘manage_posts_columns’, ‘posts_columns’, 5); add_action(‘manage_posts_custom_column’, ‘posts_custom_columns’, 5, 2); function posts_columns($defaults){ $defaults[‘your_date_col’] = __(‘Date’); return $defaults; } function posts_custom_columns($column_name, $id){ if($column_name === ‘your_date_col’){ echo the_date(); } }

Filtering posts on Post Administration Page by Week Number instead of by Month

here you go , its something i quickly cooked up and it seems to work fine: <?php /* Plugin Name: admin-filter-by-week Plugin URI: http://en.bainternet.info Description: answer to Filtering posts on Post Administration Page by Week Number instead of by Month http://wordpress.stackexchange.com/questions/19186/filtering-posts-on-post-administration-page-by-week-number-instead-of-by-month Version: 1.0 Author: Bainternet Author URI: http://en.bainternet.info */ add_filter( ‘parse_query’, ‘week_admin_posts_filter’ ); add_action( ‘restrict_manage_posts’, … Read more

Edit multiple custom post types while saving a new or edited post

here is how i would do that: add_action(‘save_post’,’update_all_meta’); function update_all_meta($post_id){ // verify if this is an auto save routine. // If it is our form has not been submitted, so we dont want to do anything if ( defined( ‘DOING_AUTOSAVE’ ) && DOING_AUTOSAVE ) return; //check for post type if ( $post->post_type != “YOUR_CUSTOM_TYPE” ) … Read more

How to display Changing post link for 24 hours in x category

You could always use get_posts() to return a random post, but it would change every time the page loaded. So, here’s an idea for you. In a plugin file, set up a wp_cron hook. <?php /* Your plugin header goes here */ register_activation_hook( __FILE__, ‘wpse24234_activation’ ); function wpseo24234_activation() { wp_schedule_event( time(), ‘daily’, ‘wpse24234_daily’ ); } … Read more

How to create a “latest news” page showing a list of posts from blog category

Probably the get_posts tag. It’s simple, you just need a loop. <?php $args = array( ‘numberposts’ => 5, ‘cat’ => 5 ); $postslist = get_posts( $args ); foreach ($postslist as $post) : setup_postdata($post); ?> <div> <?php the_date(); ?> <br /> <?php the_title(); ?> <?php the_excerpt(); ?> </div> <?php endforeach; ?> That will show the last … Read more

WordPress Query Posts From Category Post on Static Page

Weird Problem!, try the following: Make sure that the targeted categories are not empty. If you are using custom post type,include it in the query ‘post_type’=>’advertisement’ for example. If the targeted categories are special taxonomies,make sure to include it in the query : ‘term’=>’cars’ along with child ‘cars’=>’toyota’. in this example and just to make … Read more