Site icon Hip-Hop Website Design and Development

Order (by ASC) posts with meta_key so posts with out values are final

I’m making an attempt to determine sorting posts with costs in a single meta question, so the posts with out costs are proven final, when ordered by ASC and never first.

Proper now I’m briefly not exhibiting posts with out costs however it could possibly’t be left like that.

$args = array(
        'post_type' => 'inwestycja',
        'post_status'    => 'publish',
        'meta_key'      => 'value',
        'meta_type' => 'NUMERIC',
        'orderby'      => 'meta_value_num',
        'meta_value' => 1,
        'meta_compare' => '>',
        'order'        => 'ASC',
        'tax_query' => array(
            array (
                'taxonomy' => 'inwestycje',
                'discipline' => 'id',
                'phrases' => $tax->term_id,
            )
        ),
        'posts_per_page' => 24,
        'paged' => $paged,
    );

Any suggestion find out how to strategy such an issue, with out additional work on entrance finish. Additional switches for empty posts with empty costs and so forth. Computerized answer 🙂

Downside is that ASC types posts with no value as most cost-effective, so they’re first 🙂