WordPress.org

Ready to get started?Download WordPress

Forums

upPrev
[resolved] Hide upPrev box if nothing relevant found (6 posts)

  1. mayuxi
    Member
    Posted 1 year ago #

    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/

  2. Marcin Pietrzak
    Member
    Plugin Author

    Posted 1 year ago #

    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).

  3. mayuxi
    Member
    Posted 1 year ago #

    Thanks!

  4. mayuxi
    Member
    Posted 6 months ago #

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

  5. Marcin Pietrzak
    Member
    Plugin Author

    Posted 6 months ago #

    Du no. I have no time :(

  6. mayuxi
    Member
    Posted 4 months ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic