All Questions
147
questions
0
votes
0
answers
20
views
Show post in elementor based on views and specific category with query id feature in elementor
I have two functions for query filter:
function my_query_filter_most_views( $query ) {
$query->set( 'orderby', 'meta_value_num' );
$query->set( 'meta_key', 'entry_views' );
$...
0
votes
0
answers
36
views
get last part of page url and add it as cat in wp_query
I have a page URL : https://mwallpaper.ir/mobile-wallpapers/birds
and I grabbed last part of URL with this filter :
add_filter( 'example_filter', 'catslug_callback' );
function catslug_callback( $...
0
votes
1
answer
175
views
pretty url for query parametr
I want this link: site.com/c/web/theme/?filter_cms=wp
Convert to: site.com/c/web/theme/wp/
I found this code and edited it a bit:
add_action('init', function () {
add_rewrite_rule('^c/web/theme/([...
0
votes
0
answers
38
views
filter the custom post type using wp ajax request
I want to filter the custom post type (events) using wp ajax request on behalf of the keyword supplied to it.
Explanation:
I have a from which has 4 fields displaying search keyword, event category (...
0
votes
0
answers
23
views
WP_Query filtering in ACF field containing dates
I'm trying to use WP_Query to filter Advanced Custom Fields posts that can contain this value in the "dates" field (text type), for example "20230101-20230102;20230201-20230202;20230301-...
0
votes
1
answer
20
views
Grab IDs of products from WP_Query which is run elsewhere
In one of my template files, I am running the standard WP_Query and loop etc. This is not within the product archive etc, just a regular custom template.
<?php $args = array(
'post_type' => '...
0
votes
1
answer
279
views
WP_Query filter Posts by timestamp event (range start and end) and by month (next 12 month)
I would use together meta_query and date_query but it seems it's not possible .
What I'm looking to do :
(display next 12 month from current month) : for each
April 2023
If date range event (start ...
1
vote
1
answer
61
views
Filters do not work when there are multiple (one works)
I have this functions code:
function my_query($query)
{
if (is_post_type_archive('mycustomposttype')) {
$orderby = sanitize_text_field(get_query_var('orderby'));
$orderby2 = ...
0
votes
0
answers
35
views
List categories using WP_Query
I am on a filter hook where I can manipulate the $query_args of WP_Query. I am aware that WP_Query is meant for returning post data.
The question is:
Is there a way to get a list of the existing ...
0
votes
1
answer
345
views
WP_Query - How to get all posts of specific days of week by custom field date?
I have a filter on frontend with days of weeks, and I need show only posts that are published on especific day (or days).
The date are on custom field day_of_event (the filter is based on this field, ...
0
votes
0
answers
17
views
How can I modify this code to make the search box include tags and meta
How can I modify this code to make the search box include tags and meta
I would like the search in same box
if($_GET['s'] && !empty($_GET['s']))
{
$text = $_GET['s'];
}
if($_GET['type'] &...
0
votes
0
answers
24
views
meta_query weird behaviour, static int will work, but not user data
I am currently trying to build a Ajax filter for a CPT, all the products have a min and max value of a specific range in which the products works best. Therefore i created ACF groups with a min and ...
0
votes
1
answer
119
views
How to make posts unqueryable/unpublish posts where ACF relationship field is an unpublished post? [closed]
I am using ACF Pro to make a relationship between two custom post types.
One CPT is a thing and the other is a Container of Things. I need to solve the issue of things within a container of things ...
0
votes
0
answers
87
views
Display posts ONLY from the current logged in user and current week/year/month Elementor posts
I want to show the posts my users have added in three different sections. That would be "Your Posts from This week" and so on. I am currently using:
add_action( 'elementor/query/currentuser',...
0
votes
1
answer
232
views
My combination of 'post_type' and 'tax_query' not working?
I want to filter search results by custom post type and custom taxonomy terms, the result is here:
add_action('pre_get_posts','search_filter');
function search_filter($query) {
if($query->...