I added a code in my theme template below the_content tag, meaning I want it displayed only in POST and not in PAGES.

How do I do this??

Example the code shows on domain.com/2012/02/postname/ and domain.com/about-us/

I want it only displayed on domain.com/2012/02/postname/

  • add the code in 'single.php' file only – Lucky Chingi Feb 16 '18 at 14:24
  • there are no single.php in this theme, am confused. can you please explain – unity ekeinde Feb 16 '18 at 14:37
  • which theme are you using? – Lucky Chingi Feb 16 '18 at 14:39
  • try the folder 'template-parts\post' content.php – Lucky Chingi Feb 16 '18 at 14:40
  • using frontier WordPress theme. besides, I added the code to loop-single.php inside the theme folder – unity ekeinde Feb 16 '18 at 14:41

Finally Working.

I used this

if (is_singular('post')) {

    // your code after this line or comment


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.