WordPress.org

Ready to get started?Download WordPress

Forums

Smarter Navigation
[resolved] get_referrer_category() (4 posts)

  1. Claude
    Member
    Posted 3 years ago #

    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!

  2. Claude
    Member
    Posted 3 years ago #

    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.

  3. Sabeth Landsberg
    Member
    Posted 3 years ago #

    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.

  4. scribu
    Member
    Plugin Author

    Posted 3 years ago #

    Sabeth: +1 for a great answer.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic