WordPress.org

Support

Support » WP-Advanced » Sort post navigation on meta value

Sort post navigation on meta value

  • Hi,

    Sorry if my English is not very best 😉

    On my WordPress website I work with events, the events has a start date and a end date. When you’re on a single post (a event) there is a navigation (previous and next link) on the bottom of the post.
    I want that they are sorted on the start date (meta value).

    Is that possible?

    To make it more clear, here is example that I use to show the first events:
    query_posts('cat=4,3&posts_per_page=3&meta_key=datum_start&orderby=meta_value&order=ASC');
    As you can see in the example (above), the events are sorted as the meta value in the meta key “datum_start”.

    If anyone can help me… thanks!

    Derk

Viewing 1 replies (of 1 total)
  • Have you seen this or this ?

    Update: do you have a loop? Can you post the PHP code of that template?

    Could you try something like this?

    wp_reset_query();
    		// Pepare WP :)
    		$query_array = array (
    			'post_type' => 'post', 'orderby' => 'date',
    			'paged' => intval(get_query_var('paged')));
    		query_posts($query_array);

Viewing 1 replies (of 1 total)
  • The topic ‘Sort post navigation on meta value’ is closed to new replies.