• Resolved juanzo007

    (@juanzo007)


    Hi Folks,

    I’m not especially familiar with php coding and am asking for assistance on using a conditional argument.

    In short, I’d like code that checks a custom post type for tags, and if it doesn’t have tags, then echo or print some text like “Please add some tags in the comments section”

    Can someone point me in the direction of (or simply tells me) how I can construct such a conditional (i am assuming such code would be dropped into single.php)

    and example page that needs tags is: https://www.recoveryaudio.org/aa-speaker-tapes/kevin-h

    Thanks!!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter juanzo007

    (@juanzo007)

    deleted…

    • This reply was modified 7 years, 11 months ago by juanzo007.
    Thread Starter juanzo007

    (@juanzo007)

    this code works for me when dropped into the single.php file (courtesy of Experts Exchange):

    if  ( !has_tag() ) { echo 'enter whatever text u want' ; }
    
    
    • This reply was modified 7 years, 11 months ago by juanzo007.
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Help with “has tags”, if/else coding’ is closed to new replies.