• (Hueman Theme)

    I created my articles page (they are still sorted by default by publication date) but I would like to sort my articles according to the new custom fields I created with the Advanced Custom Fields plugin. (I can see these fields in my admin dashboard (articles) (new fields have been added and populated).

    To create the script, I searched the Net!!! and I was inspired by examples and I created the following script, I inserted it in my page with a shortcode widget but how to activate it??? or should I use another widget? Already, is my script correct? , or are some instructions missing? (because I only started a few months ago…;-)) )

    and if possible i would like to enable it on my page from for example a radio button or something like that, is that possible? Thank you very much for your advice!

    enter code here:
    $query_args = array( ‘post_type’ => ‘post’, ‘category_name’ => ‘course’, ‘order’ => ‘DESC’, ‘orderby’ => ‘meta_value_num’, ‘meta_key’ => ‘number_runners’,
    ‘posts_per_page’ => 5
    ); $query = new WP_Query($query_args);

  • The topic ‘How do I run the following script from my articles page?’ is closed to new replies.