• Resolved edelcambre

    (@edelcambre)


    Hello,

    I installed the plugin, set a custom order with the override option set to true. It is working on my taxonomy term archive page : https://www.epicentrefilms.com/films/vod/ (Bonheur Académie moved to 2nd position) but not on my homepage (V.O.D. section, just before twitter feed). This section uses a the get_posts() function with those args.

    But the found films are ordered by post date just like before. Have I done it wrong ?

    Thanks
    Etienne

    $args = array(
      'post_type' => 'film',
      'numberposts' => 4,
      'suppress_filters' => 0,
      'tax_query' => array(
    	'relation' => 'AND',
    	array(
    		'taxonomy' => 'categorie-film',
    		'field'    => 'slug',
    		'terms'    => array('vod'),
    	),
      )
    ); 
    $films = get_posts($args) ;

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Aurovrata Venet

    (@aurovrata)

    please read FAQ #10

    Thread Starter edelcambre

    (@edelcambre)

    Hello,
    Ok thanks, the following snippet made the trick :

    add_filter('rpwc2_allow_custom_sort_orderby_override', 'override_orderby_sorting', 10,5);
    function override_orderby_sorting($override, $wp_query, $taxonomy, $term_id, $type){
    return true ;
    }

    I did not pay attention to it since I had the box checked in the admin, but apparently it was not sufficient.
    Thanks,
    Etienne

    • This reply was modified 8 months, 3 weeks ago by edelcambre.
    Plugin Author Aurovrata Venet

    (@aurovrata)

    I did not pay attention to it since I had the box checked in the admin, but apparently it was not sufficient.

    Something else changed, because checking the box and the filter are the same. The filter simply allows more flexibility.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Issue with get_posts’ is closed to new replies.