How can I make a post that belongs to a category or have specific tags, display different from the other single posts?

With CSS: If your theme uses post_class() on a containing element, you can target that element with the class .category-songs to control styling. With a template filter: add a filter to single_template and check the assigned categories for your songs category, and use the template songs-single.php if that category is found: function wpse_check_single_categories( $template=”” ){ … Read more

Custom post type not displaying content from single-{custom post type} page

You need to rename loop-{custom-post-type}.php to single-{custom-post-type}.php. And to be explicit, the actual filename, based on your code above, should be: single-vfic_publications.php. Get rid of any other template redirects or anything else similar that you’re using. As per the Template Hierarchy, if you have a Custom Post Type named vfic_publications, and a template file named … Read more

Only nextpagelink on wp_link_pages

You’ll have to prepare your own custom function instead of wp_link_pages to use in single.php file of your template. Here’s the custom function my_wp_link_pages proposal (contains original wp_link_pages code with commented out lines): function my_wp_link_pages($args=””) { $defaults = array( ‘before’ => ‘<p>’ . __(‘Pages:’), ‘after’ => ‘</p>’, ‘link_before’ => ”, ‘link_after’ => ”, /*’next_or_number’ => … Read more

changing permalink for custom template in posts of a certain category

You can achieve this via the Rewrite API‘s add_rewrite_endpoint: function wpa89344_add_presentation_endpoint(){ add_rewrite_endpoint( ‘presentation’, EP_PERMALINK ); } add_action(‘init’, ‘wpa89344_add_presentation_endpoint’); Then in your template or wherever you differentiate a presentation vs normal view, check the global $wp_query for the presence of the presentation query var: global $wp_query; if( isset( $wp_query->query_vars[‘presentation’] ) ){ include(TEMPLATEPATH . “/single_wide_report.php”); } else … Read more

How to show single post page as home page

It depends on what theme you use as they are not coded the same. Use pre_get_posts or the reading settings and the_content() rather than the_excerpt() in your loop. function wpsites_home_page_limit( $query ) { if ( $query->is_home() && $query->is_main_query() && !is_admin() ) { $query->set( ‘posts_per_page’, ‘1’ ); } } add_action( ‘pre_get_posts’, ‘wpsites_home_page_limit’ ); Or you could … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)