Support » Plugin: WP Rotator » order by custom post meta?

  • Resolved David Radovanovic


    I’m using for an events custom post type. The events posts are being displayed via WP Rotator on the front page of Currently its order is based on when the post/event was created, though I need them to display based on the event start date (which is a meta field). Any way to achieve more control over WP-Rotator display i.e. display order based on a custom post type’s custom meta field?


Viewing 4 replies - 1 through 4 (of 4 total)
  • In other words, if I could achieve the following via Post Query Vars: post_type=event&orderby=event_start_date&order=DESC




    take a look at this page :

    under ” ‘orderby’ with ‘meta_value’ and custom post type ” you’ve got an exemple of a meta query thar you could add to your query vars,

    in your case it should be a thing like this instead i think :

    $args = array(
    ‘post_type’ => ‘event’,
    ‘meta_key’ => ‘event_start_date’,
    ‘orderby’ => ‘meta_value’,
    ‘order’ => ‘DESC’,
    ‘meta_query’ => array(
    ‘key’ => ‘event_start_date’,
    ‘compare’ => ‘LIKE’,
    $query = new WP_Query($args);

    reghyz, thanks for the reply. Will I have to unhook the rotator function via: `remove_filter(‘wp_rotator_featured_cell_markup’,’wp_rotator_featured_cell_m arkup’);
    add_filter(‘wp_rotator_featured_cell_markup’,’be_wp_rotator_featured_cell_m arkup’); `

    This seems to have worked:


Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘order by custom post meta?’ is closed to new replies.