WordPress.org

Ready to get started?Download WordPress

Forums

WP-PageNavi
[resolved] [closed] WP-Navi plugin, navigating by category? (5 posts)

  1. Peck
    Member
    Posted 4 months ago #

    How do I make it so, if I'm on a a post that is owned by a category, only posts in that category, come up?

    Like if I'm on a post from Category A, only Category A posts come up in the > Next & < Previous buttons?

    Thank you.

    https://wordpress.org/plugins/wp-pagenavi/

    I'm a noob, so can you please point me to what file to edit from what directory. Thank you <3

  2. Lester Chan
    Member
    Plugin Author

    Posted 4 months ago #

    https://codex.wordpress.org/Category_Templates ? If you are using a theme, I suggest contact your theme author instead.

  3. adam1920
    Member
    Posted 4 months ago #

    Use this:

    // Don't print empty markup if there's nowhere to navigate.
            $previous = ( is_attachment() ) ? get_post( $post->post_parent ) : get_adjacent_post( false, '', true );
            $next     = get_adjacent_post( false, '', false );
    
            if ( ! $next && ! $previous )
                    return;
            ?>
            <nav class="navigation post-navigation" role="navigation">
                    <h1 class="screen-reader-text"><?php _e( 'Post navigation', 'twentythirteen' ); ?></h1>
                    <div class="nav-links">
    
                            <?php previous_post_link( '%link', _x( '<span class="meta-nav">&larr;</span> %title', 'Previous post link', 'twentythirteen' ), true ); ?>
                            <?php next_post_link( '%link', _x( '%title <span class="meta-nav">&rarr;</span>', 'Next post link', 'twentythirteen' ), true ); ?>
    
                    </div><!-- .nav-links -->
            </nav><!-- .navigation -->
            <?php
  4. Zariah
    Member
    Posted 3 months ago #

    I updated my WP theme to the latest
    I also updated my WP-PageNavi Version 2.85

    This is what shows on my WP page:
    Page 1 of 31hPAGE_NUMBER%page largerhPAGE_NUMBER%page largerh!--nextpage-->nextpostslink

    very help soon.

  5. lilymariec
    Member
    Posted 2 months ago #

    Can someone please help me?

    I'm also trying to use this plugin ONLY for one specific category.

    But I don't know how to change the code or where to put that code that Adam posted above.

    Please speak in layman's terms. I'm not really a developer, although I'm usually pretty good at figuring things out.

    Thank you!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.