Home Forums WoodMart support forum Where is single post page template?

Where is single post page template?

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #186493

    KH
    Participant

    Hello, Could you please tell me where the single post page template is? Is it this one “content.php” in the theme folder? I’ve add a shortcode into this template but it appears in category page as well. How can I customize something only in single post page without affecting achieve page?

    Thanks

    #186512

    Artem Temos
    Keymaster

    Hello,

    These templates are very similar in our theme so we used one file for both. You can display your code on the single post page using the following conditional function https://developer.wordpress.org/reference/functions/is_single/

    Regards

    #186791

    KH
    Participant

    Could you please give me the code? For example, if I want to add only this shortcode <?php echo do_shortcode('[html_block id="8810"]');?> only for the single post page, what the code would be?

    #186794

    Artem Temos
    Keymaster

    You just need to wrap it with if statement like this

    if ( is_single() ) {
      // YOUR CODE GOES HERE
    }
    #187030

    KH
    Participant

    Work fine, thank you!

    <?php if ( is_single() ) { 
        echo do_shortcode('[html_block id="26"]');
    } ?>
    #187037

    Artem Temos
    Keymaster

    You are welcome!

Viewing 6 posts - 1 through 6 (of 6 total)

The topic ‘Where is single post page template?’ is closed to new replies.