Programatically inserting terms doesn’t update the Taxonomy admin UI
Try clean_term_cache(); clean_object_term_cache();
Try clean_term_cache(); clean_object_term_cache();
Do you have the “paged” parameter in the URL of the page(s) that you are trying to use get_query_var with? As far as I know get_query_var(“paged”) is explicitly returning the value of the URL param so you need to have a URL like this for it to work: /?paged=7 Alternatively you could read the URL … Read more
This not a complete and ready-made answer, but the below should get you started. First thing to note is, deleting and modifying are different functionalities, so different functions and hooks are relevant to it. Namely we are talking about wp_delete_term() – source and wp_update_term() – source – regarding the functions. So lets take a look … Read more
There are couple of things wrong with your code… when filtering it is not term that gives the ID of the term, but business (in this case), since this is the name you’ve provided for the drop-down menu. Replace all instances of term with business Taxonomy is not set when filtering. Remove this check from … Read more
You use tax_query incorrectly. Take a look at Codex Page tax_query should be an array which can contain: relation – it should be string (AND/OR) taxonomy term – array with defined taxonomy, field, terms, and so on. In your code your setting tax_query to: $taxquery = array( ‘post_type’ => ‘post’, ‘tax_query’ => array( array( ‘taxonomy’ … Read more
You can use PHP’s array_filter to process the results of a taxonomy query function that returns its results, and then display them. Something like: # This returns the whole taxonomy… $whole_tax = get_terms(‘customtax’, array(‘hide_empty’ => 0)); $second_level = array_filter($whole_tax, function ($t) { # This term has a parent, but its parent does not. return $t->parent … Read more
I can’t really explain it any better than the ACF documentation page I posted in the comments: All the API functions can be used with a taxonomy term, however, a second parameter is required to target the term ID. This is similar to passing through a post_id to target a specific post object. The $post_id … Read more
Totally untested and I’m not 100% sure I understand your question, but this should (in theory) get 5 posts that share any of the same venues as the current post. I would probably suggest adding some Transients to this so that you aren’t constantly running queries. If it doesn’t work, I suspect the syntax of … Read more
Here is what I came up with, seems to work: add_filter( ‘pre_post_tags_input’, ‘no_tags_input_create’ ); add_filter( ‘pre_post_tax_input’, ‘no_tax_input_create’ ); function no_tags_input_create($tags_input) { $output = array(); foreach( $tags_input as $tag ) if( term_exists( $tag, ‘post_tag’) ) $output[] = $tag; return $output; } function no_tax_input_create($tax_input) { if( !isset($tax_input[‘post_tag’]) ) return $tax_input; $output = array(); $tags = explode(‘,’, $tax_input[‘post_tag’]); … Read more
should it be.. $paged = (get_query_var(‘page’)) ? get_query_var(‘page’) : 1; WP_Query in codex: Pagination Note: You should set get_query_var( ‘page’ ); if you want your query to work with pagination. Since WordPress 3.0.2, you do get_query_var( ‘page’ ) instead of get_query_var( ‘paged’ ). The pagination parameter ‘paged’ for WP_Query() remains the same.