Use the same date-based permalink structure for all post types

You’ll need to add the year, month, and day portions to the post’s permalink in your post_link callback: $link = str_replace( “https://wordpress.stackexchange.com/” . $pto->rewrite[ ‘slug’ ] . “https://wordpress.stackexchange.com/”, “https://wordpress.stackexchange.com/” . get_the_time( ‘Y/m/d’, $post ) . “https://wordpress.stackexchange.com/”, $link ); This will return a permalink such as example.com/2014/07/02/post-name. You’ll have to adjust the logic in your pre_get_posts … Read more

P̶l̶a̶c̶e̶h̶o̶l̶d̶e̶r̶ *Default* content in Custom Post Type TinyMCE editor

There is no way to add “placeholder” for TinyMCE, but you can set default content for newly created posts. All you need is just to hook default_content filter and return your formatted paragraphs: add_filter( ‘default_content’, ‘wpse8170_get_default_instructions’, 10, 2 ); function wpse8170_get_default_instructions( $content, WP_Post $post ) { if ( $post->post_type == ‘post’ ) { $content=”…. your … Read more

Filter Posts from the Main Query

Untested: function custom_home_exclude( $where=”” ) { $exclude = array(); $newsQuery = new WP_Query (array( “post_type” => “news”, “meta_key” => “post_to_blog”, “meta_value” => 1, “meta_compare” => “!=”, “posts_per_page” => “-1″, )); while ($newsQuery->have_posts()) { $newsQuery->the_post(); array_push($exclude, get_the_ID()); } wp_reset_query(); $exclude = join(‘,’, $exclude); $where .= ” AND `ID` NOT IN ($exclude)”; return $where; } function custom_home_loop($query) … Read more