How to show link to next posts in single.php

I can’t get get_next_posts_link to work. shouldn’t his code work? <?php echo get_next_posts_link(); ?> Well, I am trying to get next 5 posts, any idea how? EDIT: Accroding to: <?php next_post_link(‘<strong>%link</strong>’, ‘%title’, TRUE); ?> Should show me a link to next post in the same category, when I do this nothing is shown. And I … Read more

How to display different single post template based on author?

My current singlepost.php makes use of the following if conditions and renders the appropriate template. <?php $post = $wp_query->post; if ( in_category(‘4′) || in_category(’59’) ) { include(TEMPLATEPATH . ‘/review-post.php’); } elseif (in_category(‘5’)) { include(TEMPLATEPATH . ‘/promo-post.php’); } else { include(TEMPLATEPATH . ‘/regular-post.php’); } ?> I want to modify this such that /123-author.php single post template … Read more

Create sub single pages

I would like to have the possibility to create “sub single pages” to display detailed content in a custom post type. Is there a way to generate pages, with a specific template with a URL of this type: domain.com/custom-post-type-slug/single-slug/sub-single-slug/ Note : I need multiple sub-single pages for each section of my post (content added via … Read more

custom single.php not working

Trying to solve this issue for the past hour and I can’t figure out what’s going on. Trying to create single-blog.php (I have a few posts which are under the category ‘blog’) but WordPress automatically redirects these posts to single.php! I’ve flushed the permalinks by settings > permalink > save changes but still nothing happens. … Read more

Custom template for post type not working

I have a post type shopping and in my single.php I am trying to get a certain template for this post type. So I did: \\ in the single.php get_template_part( ‘template-parts/content’, get_post_format() ); and in template-parts directory, I created a file named content-shopping.php. But no matter what, the single template used is the default content.php. … Read more

get_terms parent for current product only

I wish someone can give me a clue. I am actually displaying all product category (product_cat taxonomy) on single page products, displaying also childs regarding the product itself. For instance: Product-A has Cat1-parent > Cat1-child1, Cat1-child2 => The code display them properly but also will display any other Parent Category that belongs to an another … Read more