get term slug from current posts’s custom taxonomy

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

Display Custom Column in CPT Taxonomy

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

Organize content by month? SQL statement?

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 );

How to show amount of post in a taxonomy with advanced custom fields?

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;

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)