WordPress.org

Ready to get started?Download WordPress

Forums

add text to post title based on comments (1 post)

  1. Kate C
    Member
    Posted 1 year ago #

    Hey :) maybe someone can help me out or steer me in the right direction;

    This code I'm using to change the way post titles are displayed. I use this only on category pages, so where all posts of the same category are listed.

    <h2><?php comments_popup_link('[inactive]', '[active]', '[completed]'); ?> <a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></h2>

    -When there are no comments on the post it will show [inactive] before the post title.
    -When there's 1 comment it will show [active] before the post title.
    -And when there's 2 or more comments it will show [completed] before the post title.

    Now what I'm trying to do is something different.

    I want it to show [active] when there is 1 or more comment.
    And [completed] when 4 or more unique logged in users have commented on the post.

    I realize the comments_popup_link command only has the function to show no comments, 1 comment and 2 or more comments. But its the closest I have found so far to what I want to make.

    Can someone help me please? Is there a way to make it happen what I'm looking for?

Topic Closed

This topic has been closed to new replies.

About this Topic