0
votes
1answer
32 views

query post based on comparison

Each post in my site can be rated as 'good' , 'ok' , 'bad'. The values are stored in custom fields. I now need to show top 10 posts with maximum 'good' and it should not display posts with greater ...
0
votes
1answer
62 views

get_posts and wp_autop (remove filter)

I just transformed my query_posts function in a get_posts function. Here is my old function: <?php // The Query query_posts( 'cat=170&showposts=4' ); remove_filter('the_excerpt', 'wpautop'); ...
0
votes
0answers
48 views

Show post when both categories are present but not one of them

I'm having issue filtering posts by category. There is the A category for posts (which is the default and also applies when no category has been set explicitly) and B category with subcategories for ...
0
votes
0answers
284 views

Filter posts by multiple checkbox categories

I would like to set up a widget to filter my post by categories. Let's say, I do have two different categories, "Countries" and "length of stay" with sub categories. Here is an example of what I have: ...
2
votes
1answer
233 views

How to implement time filter to show random post 1 month for one category and 3 months for other categories

I started to work on one website after another developer and there is problem with his "popular widget" which is basically showing 3 random posts from category. There is some Switch statement which is ...
0
votes
1answer
384 views

filter posts by meta key with pagination

Trying to filter out specific posts that have certain meta_key from the main query... problem is it doesnt work with pagination which is my issue here. Anyone knows how to solve this? $paged = (end( ...
0
votes
1answer
203 views

Search a title word through query_posts (not the exact match)

We're working on a database with personal data from different sportsmen such as name, height, weight, etc. We've managed to build a detailed filter through query_posts. Every filter field is working ...
1
vote
1answer
189 views

Get Posts updated or published within the last x hours

Okay, I'm trying to get posts that have been published within the last x amount of time, options being 8, 24 or 72 hours. I have the variables being passed to my featureHandler.php via ajax, then ...
0
votes
2answers
722 views

Using dynamic conditions in 'posts_where' filter

I have the following code which gives be posts that are published in the last 100 days function smbd_cats_by_days ($where = '') { $where .= " AND post_date < '" . date('y-m-d', ...
1
vote
0answers
202 views

Querying posts with meta value that begins with a certain pattern

I am trying to create a search filter using meta_query. The only problem I'm having now is that I can't compare with wildcards. I think that's how you word it? $keyword = 'sos'; $tlds = ...
1
vote
0answers
218 views

define orderby URL with meta_key=post_views_count

I want to make an url with meta_key=post_views_count. E.g: http://www.mysampleweb.com/?meta_key=post_views_count&orderby=meta_value&order=DESC So the posts should be ordered by Views. ...
2
votes
1answer
834 views

Custom search filter causes menu and query_posts problems

I'm using a custom search filter (using my custom query var type), like so: function fteh_pre_get_posts( $query ){ if( isset( $query->query_vars['type'] ) ) $types = explode( ',', ...
0
votes
2answers
151 views

Currently using a query_posts() in my theme - want to use a request filter in stead

I am currently using this code in my theme right before showing the content of the custom post type my_post_type: $title = $post->post_title; query_posts( array ( 'post_type' => 'page', ...
1
vote
1answer
313 views

How to remove a plugin filter's priority on specific loops (custom queries)?

So I have a review plugin that is automatically sorting all my site based on the score rating. It seems here are the filters the plugin is applying globally: //Post sorting $sort = ...
0
votes
1answer
211 views

Custom Queries - Child Categories not showing up

What I'm Doing I have a cities category and normal categories. Right now I have them filtering by category, then when the user clicks a city it will filter by category AND city query_posts(array( ...
0
votes
1answer
2k views

Filter Posts By Tag

I'm trying to filter my posts by category, then further by city. The only way I can think of filter by city is if the admin adds the city to the listed tags and then filtering from there via switch ...
1
vote
1answer
672 views

Wordpress Search Filter Only for Page with Child of Child of Child of Child of Child

after browsing question from this site I found the workaround for this: function SearchFilter($query) { if ($query->is_search) { global $post; $query->set( 'post_parent', 21 ...
1
vote
1answer
697 views

How to limit search to first letter of title?

I was wondering if there was a way to make the search only look for the first letter in the posts title, basically let's say my search query is www.mysite.com/?s=q I'd like to get all posts that start ...
0
votes
1answer
96 views

Pre-existing arguments when using queries

I am struggling to understand how queries work with get_posts(), query_posts() and WP_Query(). In particular I do not understand what pre-existing selection may exist when using these on a given page ...
1
vote
1answer
112 views

Filter custom posts with / without comments

I need to display (for pages that use a particular page template) a list of custom post type objects filtered into 2 sets - those with comments, and those without comments. Each of these sets should ...