WordPress.org

Support

Support » Plugins and Hacks » [Resolved] [Plugin: Smarter Navigation] get_referrer_category()

[Resolved] [Plugin: Smarter Navigation] get_referrer_category()

  • Claude

    @claudelostmyths

    I would love to use your plugin. It’s exactly what I need, except I can’t figure out how to use get_referrer_category(), which is essential for me.

    right now, my code looks like this:
    <div class=”nav-previous”><?php previous_post_smart(‘« %link’, ‘%title’, true, true); ?></div>
    <div class=”nav-next”><?php next_post_smart(‘%link »’, ‘%title’, true, true); ?></div>

    What would the code look like once get_referrer_category() is added? Where and how do I insert it exactly. I looked at various forums, and the readme file, and I still can’t figure it out.

    Thank you!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Claude

    @claudelostmyths

    For example, tried copying the full code found at:
    http://plugins.trac.wordpress.org/browser/smarter-navigation/trunk/template-tags.php

    and I got this error message:

    Fatal error: Cannot redeclare previous_post_smart() (previously declared in /home/*******/public_html/******/wp-content/plugins/smarter-navigation/template-tags.php:5) in /home/*******/public_html/******/wp-content/themes/calotropis/includes/template.php

    I did not get this error message when I put the simpler code:
    <div class=”nav-previous”><?php previous_post_smart(‘« %link’, ‘%title’, true, true); ?></div>
    <div class=”nav-next”><?php next_post_smart(‘%link »’, ‘%title’, true, true); ?></div> — but I really need the get_referrer_category() function. That’s why I’m getting this plugin. I really hope I can make it work!

    Thank you.

    Sabeth Landsberg

    @sabeth-landsberg

    Hi Claude,
    I had the same issue, tried lots of code combinations, and finally found out, it is a javascript on my site which prevented this fine plug-in to be working with multiple categories assigned, too.

    I found out by having a look into the content of the cookies set by this plugin. The content of cookie “smarter navigation[url]” always ended with dummy.css.
    I thought: this might be confusing to “smarter navigation”, as I had red on some other forum topic that javascripts may prevent smarter navigation from working properly.

    So I figured out that this “dummy.css” came with a javascript, and did disable this one. From that moment everything worked fine.

    Another thing: You don’t have to call ‘get_referrer_url()’ explicitely or place it somewhere in your theme. This function is defined inside template-tags.php, and template-tags.php is included in main.php.

    Hope this helpes, and please correct me, if I was mistaken.

    Plugin Author scribu

    @scribu

    Sabeth: +1 for a great answer.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Resolved] [Plugin: Smarter Navigation] get_referrer_category()’ is closed to new replies.