• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

Pagination exclusion and positioning

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › Design Tips and Tricks › Pagination exclusion and positioning

This topic is: resolved

Tagged: genesis_prev_next_post_nav, post navigation, single post

  • This topic has 8 replies, 2 voices, and was last updated 7 years, 4 months ago by tornado.
Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • March 9, 2018 at 5:38 am #217583
    tornado
    Participant

    Hi folks.

    Finding a solution to this seems hard!

    At the moment my pagination is all the way at the bottom of each post, below the 'Below Entry' widget. How do I ensure it is underneath my post content as opposed to all the way down after the widget?

    I also have a category (category 2) showing just two posts at the top of my homepage - I want to keep them separate from my blog posts which are being pulled from another widget on the homepage. How do I EXCLUDE category 2 from all pagination so when a user is looking through my blog posts they don't see a link to any of the posts from Category 2?

    Any help would be just spiffing!

    Thanks in advance.

    🙂

    http://not yet published
    March 10, 2018 at 1:41 am #217697
    Brad Dalton
    Participant

    What code did you use to add the single post navigation?

    You should be able to change the genesis hook to change the position it loads on the single post template.


    Tutorials for StudioPress Themes.

    March 10, 2018 at 6:16 am #217707
    tornado
    Participant

    Hey Brad.

    The Foodie Pro theme has this already in functions.php:

    // Add post navigation.
    add_action( 'genesis_after_entry_content', 'genesis_prev_next_post_nav', 5 );

    I actually just now removed the pagination from the two posts I didn't want pagination on using CSS. All good.

    My only issue now is that the pagination on all other posts is right at the bottom of the posts, AFTER the After Entry widget, so nobody is going to click them because they are under the After Entry content and so hard to see. How would I move them up above the After Entry widget?

    🙂

    March 10, 2018 at 6:37 am #217708
    Brad Dalton
    Participant

    Try changing the genesis hook genesis_after_entry_content


    Tutorials for StudioPress Themes.

    March 10, 2018 at 6:40 am #217709
    tornado
    Participant

    I tried but it didn't work. I tried variations also of the hooks and still nothing.

    March 10, 2018 at 6:56 am #217710
    Brad Dalton
    Participant

    Post your code please.


    Tutorials for StudioPress Themes.

    March 10, 2018 at 7:15 am #217711
    tornado
    Participant

    Thanks for looking into this.

    <?php
    /**
     * Custom amendments for the theme.
     *
     * @package   FoodiePro
     * @copyright Copyright (c) 2017, Feast Design Co.
     * @license   GPL-2.0+
     * @since     1.0.1
     */
    
    defined( 'WPINC' ) || die;
    
    require_once trailingslashit( get_template_directory() ) . 'lib/init.php';
    
    define( 'CHILD_THEME_NAME', 'Foodie Pro Theme' );
    define( 'CHILD_THEME_VERSION', '3.1.0' );
    define( 'CHILD_THEME_URL', 'https://feastdesignco.com/product/foodie-pro-2/' );
    define( 'CHILD_THEME_DEVELOPER', 'Feast Design Co.' );
    define( 'FOODIE_PRO_DIR', trailingslashit( get_stylesheet_directory() ) );
    define( 'FOODIE_PRO_URI', trailingslashit( get_stylesheet_directory_uri() ) );
    
    add_theme_support( 'genesis-responsive-viewport' );
    
    add_theme_support( 'html5' );
    
    add_theme_support(
    	'genesis-accessibility',
    	array(
    		'headings',
    		'search-form',
    		'skip-links',
    	)
    );
    
    add_theme_support( 'custom-header', array(
    	'width'           => 640,
    	'height'          => 340,
    	'header-selector' => '.site-title a',
    	'header-text'     => false,
    ) );
    
    add_theme_support( 'custom-background' );
    add_theme_support( 'genesis-connect-woocommerce' );
    add_theme_support( 'genesis-after-entry-widget-area' );
    add_theme_support( 'genesis-footer-widgets', 4 );
    
    genesis_register_sidebar( array(
    	'id'			=> 'before-header',
    	'name'			=> __( 'Before Header', 'foodiepro' ),
    	'description'	=> __( 'This is the section before the header.', 'foodiepro' ),
    ) );
    genesis_register_sidebar( array(
    	'id'			=> 'home-top',
    	'name'			=> __( 'Home Top', 'foodiepro' ),
    	'description'	=> __( 'This is the home top section.', 'foodiepro' ),
    ) );
    genesis_register_sidebar( array(
    	'id'			=> 'home-middle',
    	'name'			=> __( 'Home Middle', 'foodiepro' ),
    	'description'	=> __( 'This is the home middle section.', 'foodiepro' ),
    ) );
    genesis_register_sidebar( array(
    	'id'			=> 'home-bottom',
    	'name'			=> __( 'Home Bottom', 'foodiepro' ),
    	'description'	=> __( 'This is the home bottom section.', 'foodiepro' ),
    ) );
    genesis_register_sidebar( array(
    	'id'			=> 'recipes-top',
    	'name'			=> __( 'Recipes Top', 'foodiepro' ),
    	'description'	=> __( 'This is the recipes top section.', 'foodiepro' ),
    ) );
    genesis_register_sidebar( array(
    	'id'			=> 'recipes-bottom',
    	'name'			=> __( 'Recipes Bottom', 'foodiepro' ),
    	'description'	=> __( 'This is the recipes bottom section.', 'foodiepro' ),
    ) );
    genesis_register_sidebar( array(
    	'id'          => 'nav-social-menu',
    	'name'        => __( 'Nav Social Menu', 'foodiepro' ),
    	'description' => __( 'This is the nav social menu section.', 'foodiepro' ),
    ) );
    
    require_once FOODIE_PRO_DIR . 'lib/helpers.php';
    require_once FOODIE_PRO_DIR . 'lib/customize/init.php';
    
    if ( is_admin() ) {
    	require_once FOODIE_PRO_DIR . 'lib/admin/functions.php';
    }
    
    add_action( 'after_setup_theme', 'foodie_pro_content_width', 0 );
    /**
     * Set the content width and allow it to be filtered directly.
     *
     * @since  1.0.0
     * @access public
     * @return void
     */
    function foodie_pro_content_width() {
    	$GLOBALS['content_width'] = apply_filters( 'foodie_pro_content_width', 610 );
    }
    
    add_action( 'after_setup_theme', 'foodie_pro_load_textdomain' );
    /**
     * Loads the child theme textdomain.
     *
     * @since  2.1.0
     * @return void
     */
    function foodie_pro_load_textdomain() {
    	load_child_theme_textdomain( 'foodiepro', FOODIE_PRO_DIR . 'languages' );
    }
    
    add_action( 'init', 'foodie_pro_register_image_sizes', 5 );
    /**
     * Register custom image sizes for the theme.
     *
     * @since  1.0.0
     * @access public
     * @return void
     */
    function foodie_pro_register_image_sizes() {
    	add_image_size( 'horizontal-thumbnail', 680, 450, true );
    	add_image_size( 'horizontal-thumbnail-small', 340, 225, true );
    	add_image_size( 'vertical-thumbnail', 680, 900, true );
    	add_image_size( 'vertical-thumbnail-small', 340, 450, true );
    	add_image_size( 'square-thumbnail', 320, 321, true );
    }
    
    add_action( 'widgets_init', 'foodie_pro_register_widgets', 11 );
    /**
     * Unregister the default Genesis Featured Posts widget and register all of
     * our custom Foodie Pro widgets.
     *
     * @since  2.0.0
     */
    function foodie_pro_register_widgets() {
    	require_once FOODIE_PRO_DIR . 'lib/widgets/featured-posts/widget.php';
    
    	unregister_widget( 'Genesis_Featured_Post' );
    	register_widget( 'Foodie_Pro_Featured_Posts' );
    }
    
    add_action( 'wp_enqueue_scripts', 'foodie_pro_enqueue_js' );
    /**
     * Load all required JavaScript for the Foodie theme.
     *
     * @since   1.0.1
     * @return  void
     */
    function foodie_pro_enqueue_js() {
    	wp_enqueue_script(
    		'foodie-pro-general',
    		FOODIE_PRO_URI . 'js/general.js',
    		array( 'jquery' ),
    		CHILD_THEME_VERSION,
    		true
    	);
    }
    
    add_filter( 'body_class', 'foodie_pro_add_body_class' );
    /**
     * Add the theme name class to the body element.
     *
     * @since  1.0.0
     * @param  array $classes Current body classes.
     * @return array $classes Modified body classes.
     */
    function foodie_pro_add_body_class( $classes ) {
    	$classes[] = 'foodie-pro';
    	return $classes;
    }
    
    add_action( 'genesis_before', 'foodie_pro_before_header' );
    /**
     * Load an ad section before .site-inner.
     *
     * @since  1.0.0
     * @return void
     */
    function foodie_pro_before_header() {
    	genesis_widget_area( 'before-header', array(
    		'before' => '<div id="before-header" class="before-header">',
    		'after'  => '</div> <!-- end .before-header -->',
    	) );
    }
    
    add_filter( 'wp_nav_menu_items', 'foodie_pro_primary_nav_menu_social', 10, 2 );
    /**
     * Append a social widget area to the primary menu.
     *
     * @since  3.0.0
     * @param  string $menu The current menu output.
     * @param  array  $args The args used for displaying the current menu.
     * @return string $menu The modified menu output.
     */
    function foodie_pro_primary_nav_menu_social( $menu, $args ) {
    	if ( 'primary' !== $args->theme_location || ! is_active_sidebar( 'nav-social-menu' ) ) {
    		return $menu;
    	}
    
    	ob_start();
    	genesis_widget_area( 'nav-social-menu' );
    	$widget_area = ob_get_clean();
    
    	$menu .= sprintf( '<li id="foodie-social" class="foodie-social menu-item">%s</li>',
    		$widget_area
    	);
    
    	return $menu;
    }
    
    add_filter( 'wp_nav_menu_items', 'foodie_pro_primary_nav_menu_search', 12, 2 );
    /**
     * Append a search box to the primary menu.
     *
     * @since  3.0.0
     * @param  string $menu The current menu output.
     * @param  array  $args The args used for displaying the current menu.
     * @return string $menu The modified menu output.
     */
    function foodie_pro_primary_nav_menu_search( $menu, $args ) {
    	if ( 'primary' !== $args->theme_location || genesis_get_option( 'nav_extras' ) ) {
    		return $menu;
    	}
    
    	$menu .= sprintf( '<li id="foodie-search" class="foodie-search menu-item">%s</li>',
    		genesis_search_form( false )
    	);
    
    	return $menu;
    }
    
    add_filter( 'genesis_search_text', 'foodie_pro_search_text' );
    /**
     * Customize search form input box text.
     *
     * @since  3.0.0
     * @return string Modified Shay Bocks credits.
     */
    function foodie_pro_search_text() {
    	return esc_html__( 'Search', 'foodiepro' );
    }
    
    add_filter( 'excerpt_more', 'foodie_pro_read_more_link' );
    add_filter( 'get_the_content_more_link', 'foodie_pro_read_more_link' );
    add_filter( 'the_content_more_link', 'foodie_pro_read_more_link' );
    /**
     * Modify the Genesis read more link.
     *
     * @since  1.0.0
     * @return string Modified read more text.
     */
    function foodie_pro_read_more_link() {
    	return sprintf( '...</p><p><a class="more-link" href="%s">%s</a></p>',
    		get_permalink(),
    		esc_html__( 'Read More', 'foodiepro' )
    	);
    }
    
    add_filter( 'genesis_comment_form_args', 'foodie_pro_comment_form_args' );
    /**
     * Modify the speak your mind text.
     *
     * @since  1.0.0
     * @param  array $args the default comment reply text.
     * @return array $args the modified comment reply text.
     */
    function foodie_pro_comment_form_args( $args ) {
    	$args['title_reply'] = esc_html__( 'Comments', 'foodiepro' );
    	return $args;
    }
    
    // Add post navigation.
    add_action( 'genesis_after_entry_content', 'genesis_prev_next_post_nav', 5 );
    
    // Modify the author says text in comments.
    add_filter( 'comment_author_says_text', '__return_empty_string' );
    
    add_filter( 'genesis_footer_creds_text', 'foodie_pro_footer_creds_text' );
    /**
     * Customize the footer text
     *
     * @since  1.0.0
     *
     * @param  string $creds Default credits.
     * @return string Modified Shay Bocks credits.
     */
    function foodie_pro_footer_creds_text( $creds ) {
    	return '[footer_copyright before="Copyright "] &middot; <a href="https://feastdesignco.com/">Foodie Pro</a> & <a href="http://www.studiopress.com/">The Genesis Framework</a>';
    }
    
    March 10, 2018 at 7:57 am #217712
    Brad Dalton
    Participant

    Try this tutorial


    Tutorials for StudioPress Themes.

    March 10, 2018 at 9:25 am #217714
    tornado
    Participant

    Brad, you absolute star. Thank you so much.

    Works a charm.

    THANK YOU.

  • Author
    Posts
Viewing 9 posts - 1 through 9 (of 9 total)
  • The topic ‘Pagination exclusion and positioning’ is closed to new replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2025 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble