Tagged Questions
0
votes
1answer
81 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
79 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
91 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
1answer
184 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
136 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
129 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.
...
1
vote
1answer
468 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
123 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
228 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
159 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
1k 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
492 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
519 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
87 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
108 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 ...