• how can i automaticalkly add a disclaimer to post if its in a set post catogary??

    for example if tusers are on one of my tutorials i want to automatically add a disclaimer to the bottom that says…. do so at own risk etc etc etc

    how can i do this??

    if statment in single post?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Something like:

    <?php
    if ( in_category( 'foobar' )) :?>
    [ add disclaimer text here ]
    <?php endif;?>

    in the relevant category template file should work.,

    Thread Starter kitcorsa

    (@kitcorsa)

    thats great, but what if i wanted to display it in all posts that are in a sub category…

    if ( in_category( ‘parent cat’ )) :?>

    as i tried this and it never sowed on idems in child cats / sub cats

    Try:

    if ( in_category( 'parent cat' ) || in_category( 'sub cat' ) ) :?>

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Auto add a disclaimer to set post types’ is closed to new replies.