WordPress.org

Ready to get started?Download WordPress

Forums

PHP Help, comments_rss_link, link breaks out of html (4 posts)

  1. Rev. Voodoo
    Volunteer Moderator
    Posted 3 years ago #

    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

  2. richarduk
    Member
    Posted 3 years ago #

    comments_rss_link has been deprecated and we're meant to use post_comments_feed_link

    http://codex.wordpress.org/Function_Reference/post_comments_feed_link

  3. Rev. Voodoo
    Volunteer Moderator
    Posted 3 years ago #

    fair enough, thanks.

    Lets see if that fixes the problem

  4. Rev. Voodoo
    Volunteer Moderator
    Posted 3 years ago #

    OK, kind of the result I expected....changing to post_comments_feed_link did nothing to fix my original problem

    The link is still before the div class, even though not coded as such

Topic Closed

This topic has been closed to new replies.

About this Topic