In my comments.php, I’m trying to list my pingbacks separate. If I remove the if statement (and endif) around the code below, the pages with pingbacks do indeed list the pingbacks. However, I don’t want my h3 title to appear unless there are indeed pingbacks to display, so I built the following if statement around the pingback-generating code.
I can’t figure this out: the code does not get in my if statement. It just ignores that section. Any ideas why?
echo "gets here 1"; if ( ! empty($comments_by_type['pings']) ) : //only placed in if there are indeed pingbacks echo "does not get inside"; echo "<BR><h3 id='comments'>Pingbacks:</h3>"; echo "<div id='pings'>"; wp_list_comments('type=pings&callback=list_pings'); echo "</div>"; endif; echo "gets here 2";
- The topic ‘wordpress if statement trouble’ is closed to new replies.