Support

Account

Home Forums General Issues Sort by customfield (price) Reply To: Sort by customfield (price)

  • try to check get_post_meta($post->ID,'preis');
    in your loop

    $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;	
    		
    $args = array(
    	'post_type' => 'post',
    	'posts_per_page' => 8,
    	'paged' => $paged, 
    	'meta_key' => 'price',
    	'orderby'  => 'meta_value_num', 
    	'order'	=> 'ASC'
    );
    		
    $wp_query = new WP_Query($args);
    
    if(have_posts())
    {
    	while ( have_posts() ) : the_post(); 
    var_dump(get_post_meta($post->ID,'preis'));
    	echo get_field('name')
    	endwhile;
    }