WordPress.org

Support

Support » Plugins and Hacks » [Resolved] Hide upPrev box if nothing relevant found

[Resolved] Hide upPrev box if nothing relevant found

  • Hello and thanks for the great plugin.

    I’m using it with YARP and it’s great combination. No problem with it, except, an empty box (with close button) show up on posts without any tags. I can I avoid this or tell upPrev to hide, if there is not relevant posts found?

    Thanks!

    http://wordpress.org/extend/plugins/upprev/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Marcin Pietrzak
    Participant

    @iworks

    I’m using it with YARP and it’s great combination. No problem with it, except, an empty box (with close button) show up on posts without any tags. I can I avoid this or tell upPrev to hide, if there is not relevant posts found?

    This issue is resolved in developer version (upPrev 4.0 will be soon).

    Thanks!

    Hey Marcin, when are you planning to update upPrev? It’s a great plugin !

    Plugin Author Marcin Pietrzak
    Participant

    @iworks

    Du no. I have no time 🙁

    BTW, I couldn’t wait for new version, so I fixed issue by myself.

    All you need to do is add this code to upprev.php, somewhere after line 68-69 (inside iworks_upprev_check() function):

    if ( function_exists('related_posts_exist') && ! related_posts_exist() ) {
    	    return true;
        }

    So my iworks_upprev_check() looks like this:

    function iworks_upprev_check()
    {
        if ( !is_singular() && 'page' != get_option( 'show_on_front' ) ) {
            return true;
        }
    
        if ( function_exists('related_posts_exist') && ! related_posts_exist() ) {
    	    return true;
        }

    This code checks if YARP internal function ‘related_posts_exist’ exists and then check if there is any related posts found.

    Additional:
    Maybe you want to switch this function to ‘related_entries_exist’, since ‘related_posts_exist’ only checks if relate *posts* exist, not pages or other post_type.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘[Resolved] Hide upPrev box if nothing relevant found’ is closed to new replies.