• 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

Use of genesis_custom_loop_args

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 › Use of genesis_custom_loop_args

This topic is: not resolved

Tagged: genesis_custom_loop_args, loop

  • This topic has 3 replies, 2 voices, and was last updated 10 years, 4 months ago by Joan.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • September 25, 2015 at 7:31 am #166635
    Joan
    Member

    Hi there!

    I'm trying to use the genesis_custom_loop_args filter. Something easy, like:

    // modify loop to display only sticky posts
    add_filter( 'genesis_custom_loop_args', 'jb_home_query_sticky_only' );
    function jb_home_query_sticky_only( $args ) {
            $args['post__in'] = get_option('sticky_posts');
            return $args;
    }

    The thing is that it's not working at all. I tried it in a plugin, I tried it in functions.php, and nothing. I tried with some other arguments, but the loop is always the same.

    Am I missing something?

    September 25, 2015 at 7:58 am #166642
    Brad Dalton
    Participant

    Try this http://wpsmith.net/2011/how-to-write-a-genesis-custom-loop-for-specific-categories-in-a-genesis-page-template/


    Tutorials for StudioPress Themes.

    September 25, 2015 at 8:07 am #166643
    Joan
    Member

    Hi Brad!

    Yeah, that solution works. Thanks so much! But I don't want to remove the loop and create my own.

    I just want to use the filter "genesis_custom_loop_args". It doesn't seem to be working at all, or maybe I'm missing something.

    Any hints, anyone?

    September 25, 2015 at 10:58 pm #166697
    Joan
    Member

    Ok, never mind. I found out that it ONLY works if you are using genesis_custom_loop. It doesn't modify the default loop.

    So first I have to remove the main loop anyway

    remove_action( 'genesis_loop', 'genesis_do_loop' );
    add_action( 'genesis_loop', 'genesis_custom_loop' );

    Then I can use genesis_custom_loop_args 🙂

  • 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

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