Quantcast
Channel: WordPress › Support » Forum: Hacks - Recent Topics
Viewing all articles
Browse latest Browse all 8245

Julie @Niackery on "Correct Way to Get Taxonomy Feed Link?"

$
0
0

I've got this on category archive pages and everything works well:

<?php
$category = get_category( get_query_var('cat') );
$current_category = single_cat_title("", false);

if ( ! empty( $category ) )

echo '<div class="tax-feed"><p style="text-align: right; padding-right: 2px;">Subscribe to the <strong>' . $current_category . '</strong> category: <a href="http://www.feedly.com/home#subscription/feed/' . get_category_feed_link( $category->cat_ID ) . '" title="Subscribe to the ' . $current_category . ' category via Feedly" rel="nofollow">Via Feedly</a> | <a href="' . get_category_feed_link( $category->cat_ID ) . '" title="Subscribe to the RSS feed for the ' . $current_category . ' category" rel="nofollow">Via RSS</a></p></div>';
?>

Next I've got this on tag archive pages, but the Feedly link doesn't work:

<?php
$category = get_category( get_query_var('cat') );
$current_category = single_cat_title("", false);

if ( ! empty( $category ) )

echo '<div class="tax-feed"><p style="text-align: right; padding-right: 2px;">Subscribe to the <strong>' . $current_category . '</strong> topic: <a href="http://www.feedly.com/home#subscription/feed/' . get_tag_feed_link( $category->tag_ID ) . 'feed/" title="Subscribe to the ' . $current_category . ' topic via Feedly" rel="nofollow">Via Feedly</a> | <a href="' . get_tag_feed_link( $category->tag_ID ) . 'feed/" title="Subscribe to the RSS feed for the ' . $current_category . ' topic" rel="nofollow">Via RSS</a></p></div>';
?>

The Feedly link doesn't output this part of the URL (though the rest of the link is fine):

' . get_tag_feed_link( $category->tag_ID ) . '

I find it really strange that this code works for the tag RSS feed link but not the tag Feedly link. Any ideas why, and how I could fix it?

I'd also like to display the links on custom taxonomy archives and am wondering whether I'll need different code for those, too.

Thanks in advance for any help offered!


Viewing all articles
Browse latest Browse all 8245

Trending Articles