[Plugin: Smarter Navigation] Tell reader that the next/previous links are browsing a specific tag/ca
-
Smarter Navigation allows you to create a back-link to the referring category or tag by using this code:
<?php referrer_link(); ?>
But this only outputs the name of the tag or category. What if you want something like this:
Browsing the tag Awesome Stuff.
Browsing category Photos.Basically, you want to output different text for tags, categories etc. Simple. Query the cookies.
<?php if( strpos($_COOKIE['smarter-navigation']['query'], 'tag') ) { ?> Browsing the tag <?php referrer_link(); ?>. <?php } elseif( strpos($_COOKIE['smarter-navigation']['query'], 'category') ) { ?> Browsing category <?php referrer_link(); ?>. <?php } else { ?> Browsing <?php referrer_link(); ?>. <?php } ?>
You can see a working version of this at The Modern Nomad.
Viewing 8 replies - 1 through 8 (of 8 total)
Viewing 8 replies - 1 through 8 (of 8 total)
- The topic ‘[Plugin: Smarter Navigation] Tell reader that the next/previous links are browsing a specific tag/ca’ is closed to new replies.