Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #2025

    hello,

    It is possible the number of comments to be removed and instead, use this code?

    <?php if (is_category(‘A’)) { ?>Display A<?php } elseif (is_category(‘B’)) { ?>Display B<?php } ?>

    http://img594.imageshack.us/img594/8299/unbenannt2uo.png

    I’ve found this in the index, I used just do not know how the new code there:

    echo “<span class=’comment_link’>”;

    comments_popup_link(__(‘0′,’expose’), __(‘1′,’expose’), __(‘%’,’expose’));

    echo “</span>”;

    #36355

    I’m sorry I don’t understand your question? The code you posted is correct. You can replace the comments:

    comments_popup_link(__('0','expose'), __('1','expose'), __('%','expose'));

    with other code like category specific statements.

    The code would look like:

    echo "<span class='comment_link'>";
    if (is_category('A')) { echo 'Display A'; } elseif (is_category('B')) { echo 'Display B'; }
    echo "</span>";

    #36356

    Hi,

    I used the code.

    echo “<span class=’comment_link’>”;

    if (is_category(‘A’)) { echo ‘Display A'; } elseif (is_category(‘B’)) { echo ‘Display B'; }

    echo “</span>”;

    Unfortunately, now just an empty <span class=”comment_link”></span> tag appears.

    The category A and B are used in the system.

    #36357

    Did you write

    category('A')

    or did you replace “A” with your ids? Or is the category called “A”?

    Have a look at this site: http://codex.wordpress.org/Conditional_Tags

    It tells you more about the is_category() function,

    #36358

    thank you. The error was is_category. it must be in_category.

    #36359

    Glad that you solved the problem.

Viewing 6 posts - 1 through 6 (of 6 total)

The topic ‘Comments replace with category name’ is closed to new replies.