WordPress.org

Ready to get started?Download WordPress

Ideas

Idea: Idea: Conditional tags for "if pings" or "if trackbacks"

  1. Tom Belknap
    Member

    12345

    I love the extended comments functionality introduced in 2.7, even if it took me till 2.8.4 before I realized they were in there and made use of them....

    But now that we have the option to split comments and trackbacks up when displaying in our comments section, there is a small problem: there's no conditional tag to say "if there's trackbacks" or "if there's pings" so we can keep the trackbacks list silent until there's actually a trackback. The problem is that, with the new formulation, we end up with a non-XHTML-compliant ol or ul with no li in the middle:

    <h2 id="pings">Pingbacks and Trackbacks</h2>
    	<ul id="pinglist">
    		<?php wp_list_comments('type=ping&style=ul'); ?>
    	</ul>
    Posted: 4 years ago #
  2. scribu
    Member

    You can use this code:

    <?php if ( ! empty($comments_by_type['pings']) ) { ?>

    Posted: 4 years ago #
  3. Ryan Hellyer
    Member

    12345

    Your post is famous! ... http://www.wptavern.com/wordpress-idea-roundup/

    Some conditionals would be useful, although not necessary since you can just do what scribu posted above.

    There is no problem with XHTML complicancy in relation to display pings and trackbacks, that’s just a misunderstanding on the part of the person who suggested it. Their problem is also not XHTML specific, it’s an HTML issue.

    Posted: 4 years ago #

RSS feed for this topic

Reply

You must log in to post.

  • Rating

    12345
    8 Votes
  • Status

    This idea has been implemented