wp_query with custo field as orderby and a second criteria (1 post)

  1. mrbbp
    Posted 3 years ago #

    Hello, i' newb with Wp coding.

    I'm trying to make a custom theme.
    I use custom post type with custom field.
    It's like a portfolio... and want to "top-story" 10 custom-posts.

    I've added a custom field with an order from 1 to 10 and a default value to 20 and want to orderby with this custom field for the number (order) from 1 to 10.
    After i want use the "natural" order by post date...

    i code a query like this

    $arguments = array(
    		'post_type' => 'projet', // le nom de mon post type
    		'post_status' => 'publish', //l'état du post type : publié
    		'category' => 'logement', // les posts de logement
    		'posts_per_page' => -1,   // nombre de post à afficher
    		'orderby' => 'meta_value_num',
    		'meta_key' => 'myCustomField',
    		'order' => 'ASC',

    the result is wright but...
    After number 10 of my custom field, i would like ordering post by date not my custom field.

    Therefore, how to do this...
    double wp-query (one for customfiled <= 10) and a second (custom field > 10)?

    I'm not sure, some help will be great.


Topic Closed

This topic has been closed to new replies.

About this Topic