Genesis Loop – Display Posts by Modified Date

Community Forums Forums General Discussion Genesis Loop – Display Posts by Modified Date

This topic is: not resolved

This topic contains 2 replies, has 2 voices, and was last updated by  pinman 1 year, 7 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #13599

    pinman
    Participant
    Post count: 1

    Hello – I’m looking for a way to amend the Genesis (WordPress) loop in order to display pages by post modified date not post creation date.

    Is this possible via the ‘Simple Hooks’ plugin?

    I’m using the Lifestyle 2.0.2 theme with Genesis 1.9.1

    Any help or pointer in the right direction would be most appreciated :)

    Many thanks.

    #13709

    Peter
    Participant
    Post count: 76

    Hi there.

    Here’s some code you can add to your functions.php file and experiment with;

    [php]remove_action( ‘genesis_loop’, ‘genesis_do_loop’ );
    add_action( ‘genesis_loop’, ‘custom_do_loop’ );
    function custom_do_loop() {
    genesis_custom_loop( array(
    ‘orderby’ => ‘modified’
    ) );
    }[/php]

    More info on the parameters you can use for your loop here;

    http://codex.wordpress.org/Class_Reference/WP_Query


    Website: petercoughlin.com
    Twitter: petercoughlin

    #13849

    pinman
    Participant
    Post count: 1

    Hi Peter,

    Many thanks for taking the time to reply.

    Your code worked fine but unfortunately I wasn’t very clear with my original post…. and forgot to say that where I wanted to amend the loop!

    What I should have asked was how could I amend the loop so that posts displayed using the Genesis Featured Posts widget can be ordered by modified date…. which sadly isn’t an option in the widget settings.

    Any ideas?

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.