Quantcast
Channel: Best way to arrange custom post types by Attributes -> Order metabox value? - WordPress Development Stack Exchange
Viewing all articles
Browse latest Browse all 2

Best way to arrange custom post types by Attributes -> Order metabox value?

$
0
0

I have my front page setup to display a custom post type via:

add_filter( 'pre_get_posts', 'my_get_posts' );function my_get_posts( $query ) {    if ( is_home() && false == $query->query_vars['suppress_filters'] )         $query->set( 'post_type', array( 'jwf_portfolio', 'attachment' ) );                $query->set( 'order', 'menu_order' );    return $query; }

What's the most efficient way to have these ordered by the number value in the Order input in the Attributes metabox for each custom post? Currently I'm trying

<?php query_posts( $query_string . '&orderby=menu_order' ); ?><?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?>

on my index.php and that's not cutting it.


Viewing all articles
Browse latest Browse all 2

Trending Articles





<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>