Post Expiration Plugin Genesis Loop

Community Forums Forums General Discussion Post Expiration Plugin Genesis Loop

This topic is: resolved

This topic contains 3 replies, has 2 voices, and was last updated by  braddalton 5 months, 1 week ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #105585

    jamesparkin
    Participant
    Post count: 5

    I have installed the Post Expiration Plugin for WordPress, and have posted several posts with future expiry dates. I want them to be listed in ascending order by expiry date. This is for an event & festival website.

    Plugin

  • http://wordpress.org/plugins/post-expirator/
  • I could use, but this just lists in reverse order that I posted them

    add_action(‘genesis_before_loop’, ‘child_before_loop’);
    function child_before_loop () {
    global $query_string;
    query_posts($query_string . “&order=ASC”);
    }

    Source:

  • http://surefirewebservices.com/wordpress/how-to-reverse-the-post-order-using-the-genesis-framework
  • —————————————————————–

    A known way to solve my issue is to use, but I cant figure out where to place it in the functions.php, or inside a lop via Simple Hooks or the </head>

    <?php
    $args = array( ‘post_type’ => ‘event’, ‘posts_per_page’ => 15, ‘order’ => ‘ASC’, ‘meta_key’ => ‘_expiration-date’, ‘orderby’ => ‘meta_value’ );
    $eventloop = new WP_Query( $args );
    if ( $eventloop->have_posts() ) : while ( $eventloop->have_posts() ) : $eventloop->the_post();

    //All the Loop Content Goes Here

    endwhile;
    endif;
    ?>

    Source:

  • http://www.wpbeginner.com/wp-tutorials/how-to-sort-posts-by-post-expiration-date-in-wordpress/
  • Thank You

#105588

braddalton
Participant
Post count: 10243

Hard to test that code. Please paste all code in a Github Gist and link to it from here. Thanks.


#105589

jamesparkin
Participant
Post count: 5
  • https://gist.github.com/anonymous/242ec351bfa50ad511e2
  • By the way I am trying to get it to work with Lifestyle Pro.

    Thanks

    #105593

    braddalton
    Participant
    Post count: 10243

    Please mark this as resolved and create a new topic as the page is messed up caused by the code thanks.


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

    You must be logged in to reply to this topic.