• Resolved tradingmetro

    (@tradingmetro)


    Hi,

    Just wondering if I am overlooking something for the template tag “wp_list_bookmarks”.

    Is there an attribute to output the “RSS Address” of a link?
    I’m looking for the same functionality as wp_list_categories’s “feed_image” and “feed” attributes.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Is there an attribute to output the “RSS Address” of a link?

    No

    Thread Starter tradingmetro

    (@tradingmetro)

    Contrary to stvwlf, I’ve found a way to output the RSS feed URL.

    https://outthinkgroup.com/2009/01/14/custom-wordpress-arrays-creating-a-favicon-fueled-link-list/

    This post was very useful.

    Instead of “wp_list_bookmarks”, use “get_bookmarks” and use a foreach loop with link_rss.

    Full code:

    <?php
    $bookmarks = array();
    $bookmarks = get_bookmarks('category=52&amp;orderby=notes');
    foreach ($bookmarks as $bookmark) {
    	$rss = $bookmark->link_rss;
    ?>
    		<li><a title="<?php echo $bookmark->link_name; ?>" href="<?php echo clean_url($bookmark->link_url); ?>" target="_blank"><?php echo $bookmark->link_name; ?></a> <?php if ($rss != "") echo '<a href="'.$rss.'"><img src="IMAGE URL" alt="RSS" /></a>; ?></li>
    <?php } ?>

    I keep getting t_string errors with this code and I don’t know why. I think the problem is somewhere after the last echo.

    there’s a missing single-quote after in above code after the final (should be …alt="RSS" /></a>'; ?></li>

    this works (a few changes added: link_description to title, span around and title to feed url:

    <?php
    $bookmarks = array();
    $bookmarks = get_bookmarks('category=10');
    foreach ($bookmarks as $bookmark) {
    	$rss = $bookmark->link_rss;
    	$title = $bookmark->link_description;
    ?>
    	<li><a title="<?php echo $bookmark->link_name.': '.$bookmark->link_description; ?>" href="<?php echo clean_url($bookmark->link_url); ?>"><?php echo $bookmark->link_name; ?></a> <?php if ($rss != "") echo '<span class="link_feed">(<a href="'.$rss.'" title="'.$bookmark->link_name.' RSS">feed</a>)</span>'; ?></li>
    <?php } ?>

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘wp_list_bookmarks and RSS Address output’ is closed to new replies.