Custom Post Templates

I think this approach will work. 1.create template for single post like singlepost.php( default single post template),singlepost-99.php,singlepost-101.php. 2.now put just this code in single.php <?php global $post; get_template_part(‘singlepost’,$post->ID); ?> what this code does check for single post template for current post by post id if not found call singlepost.php. Important Link: get_template_part()

How to disable single post view in wp

You can add to the end of theme’s header.php file this: if( is_single() ) { global $wp_query; $wp_query->set_404(); status_header( 404 ); get_template_part( ‘404’ ); exit(); } Note that the get_template_part( ‘404’ ) function needs 404.php file in your theme directory.

Do not show excerpt in post content

Don’t use the more tag to manually define excerpts. There’s a separate input field for that. If it’s not visible, go to “screen options” in the upper right corner of the edit screen to enable it. What exactly is shown on your single and archive pages depends on your theme. There is no general way … Read more

Need post_type_archive_title function but in ‘single’

There doesn’t appear to be one, but the following should work: //Get post type $post_type_obj = get_post_type_object( get_post_type() ); //Get post type’s label $title = apply_filters(‘post_type_archive_title’, $post_type_obj->labels->name ); $archive_title = apply_filters(‘post_type_archive_title’, $post_type_obj->labels->all_items); This can, for instance, be put in one generic header template that is applied to all single-cpt files. With is_single() it can be … Read more

Remove arrows from previous and next link

You should have to look at what the codex says about previous_post_link( $format, $link, $in_same_term = false, $excluded_terms=””, $taxonomy = ‘category’ ) and next_post_link( $format, $link, $in_same_term = false, $excluded_terms=””, $taxonomy = ‘category’ ) Both have the same parameters, the first parameter $format is the important one to have a look at here Format string … Read more