• 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

How to? Genesis Sample Theme with Ajax Load More Plugin

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 › How to? Genesis Sample Theme with Ajax Load More Plugin

This topic is: not resolved

Tagged: ajax load more, genesis sample, infinite scroll

  • This topic has 2 replies, 2 voices, and was last updated 6 years, 4 months ago by patrickr.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • January 24, 2017 at 10:15 pm #199977
    patrickr
    Member

    Anyone have experience using the Ajax Load More plugin with the Genesis framework?

    I'm trying to add infinite scroll to my category pages, but I haven't had success integrating the plugin yet. The goal is to remove the default pagination and have another 10 posts load when the user reaches the bottom of the screen.

    January 25, 2017 at 6:36 am #199990
    Victor Font
    Moderator

    This is one of the beauties of Genesis. You can do anything you want as long as you understand how WordPress actions and filters work. The pagination in Genesis is done by the genesis_posts_nav function. The Ajax Load More plugin appears to work with shortcodes only. In order for you to get this plugin to work, you have to replace genesis_posts_nav with your own custom function that executed the plugin shortcode. This will get you started assuming your theme is using the default actions:

    remove_action( 'genesis_after_endwhile', 'genesis_posts_nav' );
    add_action( 'genesis_after_endwhile', 'execute_ajax_load_more_shortcode' );
    
    function execute_ajax_load_more_shortcode() {
        echo do_shortcode( '[ajax_load_more post_type="post" repeater="default" posts_per_page="10" transition="fade" button_label="Older Posts"]' );
    }

    Regards,

    Victor
    https://victorfont.com/
    Call us toll free: 844-VIC-FONT (842-3668)
    Have you requested your free website audit yet?

    January 25, 2017 at 8:24 am #200001
    patrickr
    Member

    Thanks, Victor!

  • Author
    Posts
Viewing 3 posts - 1 through 3 (of 3 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