WordPress.org

Support

Support » How-To and Troubleshooting » PHP Help, comments_rss_link, link breaks out of html

PHP Help, comments_rss_link, link breaks out of html

  • Alright, redoing my comment form to use comment_form instead of laying it all out

    Went well at first, trying to get my comment rss subscribe link back in there
    My code:

    // ADD COMMENT RSS SUBSCRIBE BUTTON
    add_action('comment_form', 'comment_rss_subscribe_thing');
    
    function comment_rss_subscribe_thing() {
    	echo '<div class="comment-rss">' . comments_rss_link(__('Subscribe to Comments', 'voodoo_lion')) . '</div>';
    }

    My source output:

    <a href='http://www.rvoodoo.com/2010/09/local-selection-dj-odawa-3/feed/'>Subscribe to Comments</a><div class="comment-rss"></div>

    Why is my link busting out? Notice the link comes first, then the div class

    when I had amy comment form all spelled out, I used:

    <div class="comment-rss"><?php comments_rss_link('Subscribe to Comments'); ?></div>

    ANd that worked fine…. I need the link in the div, as I use that class to apply an icon

    I’m sure I just don’t quite understand the php I’m working with, I’m only now figuring how to piece bits and pieces together

Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘PHP Help, comments_rss_link, link breaks out of html’ is closed to new replies.
Skip to toolbar