• 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

Remove pagination in genesis_custom_loop

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 › General Discussion › Remove pagination in genesis_custom_loop

This topic is: not resolved

Tagged: genesis_custom_loop, pagination

  • This topic has 3 replies, 2 voices, and was last updated 2 years, 5 months ago by Brad Dalton.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • October 7, 2020 at 5:58 am #501371
    davidperez
    Participant

    I'm making a sticky post and I've removed the standard loop and make it in two loops: one for the sticky and the other for the rest.

    I've finished the rest with offset=1. But in the featured one when I use genesis_custom_loop i don't want the pagination.

    My function is:
    `
    global $query_string;

    $query_string .= '&offset=0&posts_per_page=1';

    genesis_custom_loop( $query_string );

    How could a put the $query_string in order not to make pagination?

    October 7, 2020 at 6:12 am #501372
    Brad Dalton
    Participant

    Please rephrase your question. As it stands, it doesn't make sense. Also, please publish your entire working code snippet.


    Tutorials for StudioPress Themes.

    October 8, 2020 at 5:27 am #501380
    davidperez
    Participant

    Yes, this is the code
    `/**
    * # Page blog
    * ---------------------------------------------------------------------------------------------------- */
    add_action( 'get_header', 'cmk_load_blog_page' );
    /**
    * Loads functions in custom post type for blog
    *
    * @return void
    */
    function cmk_load_blog_page() {
    if ( is_archive() ) {

    remove_action( 'genesis_before_loop' , 'genesis_do_taxonomy_title_description', 15 );
    add_action( 'genesis_before_content_sidebar_wrap' , 'genesis_do_taxonomy_title_description', 10 );
    add_action( 'genesis_before_content_sidebar_wrap', 'cmk_featured_post', 15 );

    remove_action( 'genesis_loop', 'genesis_do_loop', 10 );
    add_action( 'genesis_loop', 'cmk_genesis_do_loop', 10 );
    }
    }

    /**
    * Muestra el post destacado
    *
    * @return void
    */
    function cmk_featured_post() {
    global $query_string;

    $query_string .= '&offset=0&posts_per_page=1';

    genesis_custom_loop( $query_string );
    }

    function cmk_genesis_do_loop() {
    global $query_string;

    $query_string .= '&offset=1&posts_per_page=8&paged=' . get_query_var( 'paged' );

    genesis_custom_loop( $query_string );

    }

    October 8, 2020 at 5:33 am #501381
    Brad Dalton
    Participant

    Try using -1 as the value for posts_per_page

    Also, you can use the genesis_custom_loop function like this


    Tutorials for StudioPress Themes.

  • Author
    Posts
Viewing 4 posts - 1 through 4 (of 4 total)
  • The forum ‘General Discussion’ is closed to new topics and replies.

CTA

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

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2023 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