Support » Fixing WordPress » display the content when category = 'categoryA' else blank

  • Hello –

    I am trying to use a webhook that will run a script and display the content of a post only if the post is in a specific category, if it is not, it shouldnt display any content. is there a way to do this? The script can be in PHP… I am very new to scriplets and just need to find a running start 🙂

    Thanks!

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

    (@dpace32)

    I tried this and it doesnt seem to work:

    <?php if (in_category(’55’)) {
    echo (the_content)
    } else { echo ”
    } ?>

    Parse error: syntax error, unexpected ‘}’, expecting ‘,’ or ‘;’ in wphook.php on line 3

    🙁

    Thread Starter dpace32

    (@dpace32)

    bump…

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘display the content when category = 'categoryA' else blank’ is closed to new replies.