Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php //WordPress SimplePie - Add Tags with links to page - http://www.worldoweb.co.uk/2012/display-wordpress-posts-on-another-wp-blog
- /******
- Include the following function before the loop, research the tag structure of your website first. Most WP sites have http://www.mywebsite/tag/
- ******/
- function wow_tags($item){
- $url = 'https://www.mywebsite.co.uk/tag/';//CHANGE THE URL
- $tags='';
- foreach ($item->get_categories() as $category)//loop through each tag
- {
- $tags.= '<a href="'.strtolower($url.$category->get_label()).'" title="'.$category->get_label().'">'.$category->get_label().'</a>';
- }
- return $tags;
- }
- /********
- Add the following inside the original/first foreach loop - remove old tag code first, if you followed my previous paste, as this is now inside the above function. Style .mytags in css
- *********/?>
- <span class="mytags"><?php echo wow_tags($item);?></span>
Add Comment
Please, Sign In to add comment