I’m trying to get a specific link to show in a php partial if it’s on a single-things.php page.

I have the code in a top-part.php which I’m including on the single-things.php page:

<?php if (is_singular( 'things' ))  : ?>

  //Show content if it's on single-things.php post type

  <?php else : ?>

  //Display other content

 <?php endif; ?>

Main thing is that I have the top-part.php included on other pages as a partial so I only want to show that specific content if it’s on the URL of the single item in the custom post type.

That should be working, right? Unless I’m missing something.

Read more here: Display specific content on singular custom post type


Solution:

If you know the solution of this issue, please leave us a reply in Comment section, to update the question.


Wordpress related questions and answers: