• Hello,

    In my templates I want the comment field to be called “Review” when the post is in the “book” category. Unfortunately, I have never worked with php. Would something like this work:

    <?php in_category(2) ? echo “Review” : echo “Comment” ?>

Viewing 2 replies - 1 through 2 (of 2 total)
  • Looks good to me.

    Thread Starter thatposhgirl

    (@thatposhgirl)

    After some trial and error:

    <?php in_category(2) ? comments_popup_link(‘No Reviews’, ‘1 Review »’, ‘% Reviewss »’) : comments_popup_link(‘No Comments »’, ‘1 Comment »’, ‘% Comments »’); ?>

    There might be a better way, though. I don’t know.

    eta. Also my previously posted code would not work. It should have been <?php echo in_category(2) ? “Review” : “Comment”; ?>

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Dynamically switch between “review” or “comment”’ is closed to new replies.