Quantcast
Channel: Toolset » All Posts
Viewing all articles
Browse latest Browse all 20145

Taxonomy Archive View Sorting

$
0
0

Hi…I found a solution from Caridad for sorting my Taxonomy archive views in a previous support ticket as follows:

add_filter('pre_get_posts', 'sort_my_archive');
function sort_my_archive($q) {
if ($q->is_archive) {
$q->set('meta_key', 'wpcf-city');
$q->set('orderby', 'meta_value');
$q->set('order', 'ASC');
}
return $q;
}

This works well. However, I am using Woos Merchant Theme with the Woo Components on the front page. When I place the above in my theme functions.php I find that two of four of the components completely disappear from my front page.

The components appear from the top down in this order:
Intro
Features
Promotions
Content

I am attaching two screen shots to show you what I mean. The first one is without the above code in the functions.php and the second shot is with the code.

The Features and Promotions use posts. The Intros content is added through the theme options and the content area is displaying an assigned page.

So my assumption is that this has to do with how posts are called up?

What to do?

Regards,
Will


Viewing all articles
Browse latest Browse all 20145

Trending Articles