How to filter the terms to a special custom taxonomy?
How to filter the terms to a special custom taxonomy?
How to filter the terms to a special custom taxonomy?
Why do my offline development site and online live site behave differently?
This gets the terms: $terms = get_the_terms( get_the_ID(), ‘nieuwssoort’); Then you check the result: $terms_ids = [];//you can set a default id here if(false !== $terms && !is_wp_error($terms)){ foreach($terms as $term){ $terms_ids[] = $term->term_id; } } We check the result just in case. Now, we have the values, let get them into the arguments: $args … Read more
The final working hooks that I was able to work out are: // adding an extra column to the event_cateogires page // to display the color function events_color_column($defaults) { $defaults[‘event_cat_color’] = ‘Event Category Color’; return $defaults; } function events_color_column_content($column_name, $post_ID) { echo ‘Event Color : #2432’; } add_filter(‘manage_edit-event_categories_columns’, ‘events_color_column’); add_action(‘manage_event_categories_custom_column’, ‘events_color_column_content’, 10, 2); Using the … Read more
There is no native function which to accomplish what you need. The only possible solution that I can think of is to make use of usort to sort the returned array of posts from your custom query You will need to do the following: Set you list with the desired tags Get a list of … Read more
Just guessing, but try this: $args = array( ‘post_type’ => ‘my_content’, ‘orderby’ => ‘meta_value’, ‘meta_key’ => ‘start_month’, ‘meta_query’ => array( array( ‘key’ => ‘start_month’, ), ), ); $thisQuery = new WP_Query( $args );
At first you have to catch visitors location. There are many plugins to catch visitors location such as “WassUp Real Time Analytics” Also you have to create post custom fields for location. Then you have to create a filter system in homepage that will check your post location field. After checking which post will be … Read more
You can use the relations field from ACF. Then you could select your own related posts for each blog item.
What to do with shared terms splitting in WordPress 4.2?
You can use this code for getting number of posts in a taxonomy: $args = array( ‘post_type’ => ‘post’, ‘post_status’ => ‘publish’, ‘posts_per_page’ => -1, ‘tax_query’ => array( array( ‘taxonomy’ => ‘your-taxonomy-name’, ‘field’ => ‘slug’, ‘terms’ => ‘some-slug’, ) ) ); $query = new WP_Query( $args ); echo $query->post_count;