{"id":1393731,"date":"2010-02-19T21:49:51","date_gmt":"2010-02-19T21:49:51","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/plugin-smarter-navigation-smarter-navigation-for-dynamic-menu-highlighting\/"},"modified":"2016-08-19T16:02:01","modified_gmt":"2016-08-19T16:02:01","slug":"plugin-smarter-navigation-smarter-navigation-for-dynamic-menu-highlighting","status":"closed","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/plugin-smarter-navigation-smarter-navigation-for-dynamic-menu-highlighting\/","title":{"rendered":"[Plugin: Smarter Navigation] smarter-navigation for dynamic menu highlighting"},"content":{"rendered":"<p>Hi Scribu,<\/p>\n<p>This is a really handy plugin.  The nex\/previous post links work just as I need them to.  My question is this: can I use any functions from this plugin to return a string with the name of the referrer (not a link)?  So, something like the referrer_link() function already written in, but somehow modify it to return just a string?<\/p>\n<p>The idea is this: I would like to use this string within a conditional tag, to test the referrer for a given post.  I&#8217;d like to be able to use this to get the dymanic menu highlighting to work.  Something along the lines of<\/p>\n<pre><code>if(referrer())=&#039;x&#039;\n{echo &quot; class=\\&quot;current_page_item\\&quot;&quot;; }<\/code><\/pre>\n<p>a possible snippet from my menu:<\/p>\n<pre><code>&lt;li\n&lt;?php if(is_category(&#039;Paintings&#039; {\necho &quot; class=\\&quot;current_page_item\\&quot;&quot;; } ?&gt;\n&lt;?php elseif(referrer())=&#039;Paintings&#039; {\necho &quot; class=\\&quot;current_page_item\\&quot;&quot;; } ?&gt;&gt;\n&lt;a href=&quot;\/category\/paintings&quot;&gt;&lt;span&gt;Paintings&lt;\/span&gt;&lt;\/a&gt;\n&lt;\/li&gt;<\/code><\/pre>\n<p>My problem is that I have posts which belong to multiple categories. If the user links to a single post from a specific category page, I would like the menu tab for that category to stay highlighted (even though the single post may also belong to other categories).  So basically, I just need to test the referrer if possible.<\/p>\n<p>Thanks for your help!<\/p>\n","protected":false},"template":"","class_list":["post-1393731","topic","type-topic","status-closed","hentry"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/1393731","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/1393731\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=1393731"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}