All Questions
157
questions
1
vote
1
answer
25
views
Showing all posts of the current custom taxonomy on archive page
I have created a custom post (houses) and a custom taxonomy (houses_area). On each houses_area archive page, I want to see all the posts displayed by alphabetical order. I get stuck in calling the ...
0
votes
1
answer
23
views
Filter on one post type with taxonimy and get other post type
I would like to fetch my posts of type 'news', 'videos', 'webinars', 'whitepapers', 'testimonials', and 'landing-pages' and apply a "filter" to only get the landing-pages type with the ...
0
votes
1
answer
44
views
Loop a Single Taxonomy and Output all Posts Associated (but also show a message for empty ones)
I have a custom post type for Vacancies, with a Taxonomy of Location set up. What I've achieved is looping through all Locations and then showing underneath associated posts.
Update: Thanks to @...
0
votes
1
answer
22
views
Query top level custom post in taxonomy
This is my first post, I'm a bit stuck.
I have a custom post (dan) and taxonomy (dnas), with hierarchical categories.
I want to make a query resulting in posts at toplevel (hoofdcategorie01, ...
0
votes
0
answers
13
views
How to display posts from home page in blogs in category wise
actually i am converting html to wordpress and i have posts on home i want to display them on blog page in category wise rightnow my blog page in working on index.php, I have made some post dynamic ...
0
votes
0
answers
28
views
Include custom post type that matches taxonomy field in another custom post type
I have two custom post types, one is “maker” and the other “product”. (used ACF plugin)
I have a taxonomy field for Business Name, this field is called “choose_business” in the product custom post ...
0
votes
1
answer
21
views
Using WP Query, I want to include all posts in category 1 as long as they are not also in category 2
$args = array(
'post_type' => 'product',
'meta_key' => 'sorting_weight',
'orderby' => 'meta_value_num',
'posts_per_page' => -1,
'order' => 'DESC',
'tax_query' =&...
3
votes
1
answer
267
views
How can I get taxonomy term name using term slug & post ID using build in WordPress function or class?
I have the following SQL query:
SELECT t.name FROM wp_posts p
INNER JOIN wp_term_relationships tr ON tr.object_id = p.id
INNER JOIN wp_terms t ON tr.term_taxonomy_id = t.term_id
WHERE p.id ...
0
votes
0
answers
116
views
get_the_terms has strange result since version 6.0
Since version 6.0 of WordPress some of my code with get_the_terms() doesn't work as expected in several sites where I use custom query loops.
For example I have this loop where I want to get the ...
0
votes
1
answer
716
views
Can't get term id for category archive
I am trying to get the term_id of the current category archive.
On the category archive, when I var_dump($wp_query)
object(WP_Query)#1189 (55) {
["query"]=>
NULL
["query_vars&...
0
votes
1
answer
531
views
How to add custom meta to 'pre_get_terms'?
I have a custom taxonomy with custom meta. I have added the custom meta values to columns in the admin list page just fine. But if I search for values that are in these columns nothing is found. I'm ...
0
votes
0
answers
81
views
WP query taxonomy optimization
Is there any way to speed this query? Noob here.
SELECT wp_posts.ID
FROM wp_posts
LEFT JOIN wp_term_relationships
ON (wp_posts.ID = wp_term_relationships.object_id)
WHERE 1=1
AND (...
0
votes
1
answer
424
views
Use get_cat_ID to retreive multiple category IDs
I am trying to use the names of categories stored in user meta (ie users' preferences) to control an on-page query’s parameters.
$topicsofinterest = get_user_meta(get_current_user_id(),'...
1
vote
1
answer
400
views
Order by slug in get_terms with multiple taxonomies
I am builing a search engine where I need to search in 2 different taxonomies and sort them by slug. I got this code to do so.
$search = sanitize_text_field( $_POST[ 'search' ] );
$content = '';
$...
1
vote
1
answer
2k
views
Output an array of terms for a 'tax_query' => array()
I'm trying to use custom fields on the backend to set the taxonomies in a WP_Query for a category archive on the front end.
In the page template. this gets my categories from the custom field:
$terms =...