Support » Plugin: Eazyest Gallery » How do I display the 5 most recent galleries?

Viewing 1 replies (of 1 total)
  • Use WP_Query WordPress API:

    list( $orderby, $order) = explode( '-', eazyest_gallery()->sort_by( 'folders' ) );
    
    global $wp_query;
    $args = array(
        'post_type'      => eazyest_gallery()->post_type,
        'post_parent'    => $post_id,
        'posts_per_page' => -1,
        'order' => $order,
        'orderby' => $orderby,
    );
    $query = new WP_Query( $args );
    
    if ( $query->have_posts() ) {
    
       // see variables in $query
        var_dump($query);
    
    }

Viewing 1 replies (of 1 total)
  • The topic ‘How do I display the 5 most recent galleries?’ is closed to new replies.