Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Favorites infavorites:mine
infavorites:1234
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with Search options answers only user 39152

A taxonomy is a generic "category" used to organize posts and custom post types

1
vote
Couple of things: You're not providing a post to check in in_category(). You're calling wp_remove_object_terms() on $postID, which hasn't been set. This code should work: function my_remove_categ …
answered Jul 5 '17 by Jacob Peattie
0
votes
You have "Save Terms" enabled, which means that the field is controlling which taxonomy terms are attached to the post, not saving the term as a custom field, and because you also have "Load Terms …
answered Aug 16 by Jacob Peattie
2
votes
You can use get_ancestors() to get parents and grandparents etc. of a term, then use that in wp_set_object_terms(): $term_id = 12; // Get array of term parents. $terms = get_ancestors( $term_id, 'top …
answered Sep 20 '17 by Jacob Peattie
0
votes
can then loop through the result of that function to achieve the result you want: $taxonomies = get_object_taxonomies( $post ); foreach ( $taxonomies as $taxonomy ) { the_terms( $post->ID, $taxonomy, '<span>', ", ", '</span>' ); } …
answered Jun 10 by Jacob Peattie
2
votes
The default behaviour of mysite.com/post-type/ and mysite.com/post-type/post-name/ is what you want it to be, so you don't need to do anything special there. To have mysite.com/post-type/taxonomy … / as the URL for the taxonomy archive, all you need to do is use 'post-type/taxonomy' as the rewrite => slug argument when registering the taxonomy. …
answered May 22 '18 by Jacob Peattie
1
vote
taxonomy at that time. Prior to this categories had their own properties (the ones with the aforementioned prefixes). For backwards compatibility, the _make_cat_compat() function is used in some places to …
answered Dec 5 '18 by Jacob Peattie
0
votes
( 'post_type' => 'kosmetyki', 'tax_query' => array( 'relation' => 'AND', array( 'taxonomy' => 'kosmetyki_dystrybutor', 'field' => 'term_id', 'terms' => $terms_ids, ) ), ); $query = new WP_Query($args); …
answered Sep 27 '17 by Jacob Peattie
1
vote
Figured a simple pre_get_posts would do the trick, It will, you just need to query posts that have a parent of 0. Assuming your taxonomy slug/name is literally just region: function …
answered Nov 20 '17 by Jacob Peattie
0
votes
Your query here is fine. It's the only way to split it up into sections like that, but it belongs on a page template, not the archive. Archives should always use the main loop for its contents. Make t …
answered Dec 8 '17 by Jacob Peattie
0
votes
Querying custom taxonomy terms is the same as querying categories, and as you can see from the docs you can change the number returned using the per_page argument: http://...../wp-json/wp/v2/product_categories?per_page=100 …
answered Feb 2 by Jacob Peattie
1
vote
its term_id. But, as you've also noticed, the term_id and term_taxonomy_id should always be the same. The reason they both exists is historical. Prior to WordPress 4.2, it was possible for taxonomy … to a single taxonomy. You can read some of the background on this change in this Make post from 2015. These days you should only be using term_id to refer to terms programatically, and since a term's …
answered Feb 14 by Jacob Peattie
2
votes
function pggggo_list_of_terms() { $terms = get_terms( [ 'taxonomy' => [ 'vehicle_safely_features', 'vehicle_exterior_features … ( 'taxonomy' => array( 'vehicle_safely_features', 'vehicle_exterior_features', 'vehicle_interior_features', 'vehicle_extras', ), ) ); return $terms; } …
answered Apr 29 by Jacob Peattie
1
vote
Just to start, you say "I am using get_terms to retrieve all terms from Tax 1 with posts associated with it", however your actual code gets all terms in that taxonomy regardless of whether or not … use $wpdb to get terms from Taxonomy A that have any posts of a given post type that have a specific term in Taxonomy B: $post_type = 'post'; $taxonomy_a = 'post_tag'; $taxonomy_b = 'category …
answered Jan 30 by Jacob Peattie
2
votes
Look at the docs (please read the docs) for is_taxonomy_hierarchical(). You need to tell it which taxonomy you're checking: if ( is_taxonomy_hierarchical( 'my_taxonomy_name' ) ) { } If you're … template isn't specific to a taxonomy, and you need to know which taxonomy you're viewing, use get_queried_object() to figure it out (you were already told how to do this, by the way): if ( is_tax …
answered Feb 2 by Jacob Peattie
0
votes
simplest method would be to create a page called Issues, then create a custom page template that lists all terms in the Issues taxonomy. You can do this with get_terms(): $issues = get_terms … ( [ 'taxonomy' => 'issues' ] ); if ( ! is_wp_error( $issues ) && $issues ) { foreach( $issues as $issue ) { echo $issue->name; // Name of issue. echo get_term_link( $issue ); // URL to articles in that issue. } } …
answered Jun 12 by Jacob Peattie

15 30 50 per page