Change filter id into slug
Change filter id into slug
Change filter id into slug
Having trouble querying multiple custom taxonomies
So I asked ChatGPT and it comes with a working solution for me: <?php $prev_post = get_previous_post(true, ”, ‘listing_category’); if (!empty($prev_post)) : ?> <a href=”<?php echo get_permalink($prev_post->ID); ?>”> <?php echo get_the_post_thumbnail($prev_post->ID, ‘thumbnail’); ?> << <?php echo esc_html($prev_post->post_title); ?> </a> <?php endif; ?> </div> <div class=”next-post-link”> <?php $next_post = get_next_post(true, ”, ‘listing_category’); if (!empty($next_post)) : ?> … Read more
You can use get_ancestors() to get an array of IDs of the ancestors of a term in any taxonomies, and in your case, you would use the last 2 items like the example below, where I used: get_queried_object_id() to get the ID of the term on the term archive page that you are currently viewing … Read more
The exact name of that filter depends on the name of the taxonomy. The general outline is “manage_{$this->screen->taxonomy}_custom_column”. You may have to include an extra test for the post type inside the filter function to prevent it from being applied to other post types that use the same taxonomy.
I was able to make this work by using a power set function and then using that array to create individual rewrite rules. add_action(‘init’, ‘ebd_custom_rewrite_rules’); function ebd_custom_rewrite_rules() { $taxonomies = array( ‘engine-work’, ‘engine-specialty’, ‘application-specialty’, ‘machining-capability’, ‘dyno-facility’, ‘shop-region’); $combinations = ebd_get_array_power_set($taxonomies); $element_size_min = 2; foreach ($combinations as $combination) { if ($element_size_min <= count($combination)) { // skip … Read more
Your code doesn’t show where $term_id is coming from. If it is not defined anywhere, then that could be causing the problem. Instead of using get_term() and get_term_meta() directly on your template file, you could define couple of helper functions to handle the data retrieval. This makes the template file a little cleaner and the … Read more
You can avoid infinite loop by removing the action before calling update post function. function maybe_disable_comment($post_id) { // do you check if the post has specific custom tax term. if ( ! has_term( ‘bar’, ‘YOUR_CUSTOM_TAX’, $post_id ) ) { return false; } // remove the filter that will create infinite loop. remove_action( ‘wp_insert_post’, ‘maybe_disable_comment’ ); … Read more
WordPress is preventing two identical slugs to 2 different content. How can he know where to send you if the URL may potentially be equal ? I think you need to design your development differently. Having 1 term not hierarchical and then work on URL rewriting. You could have only one “sale” and add it … Read more
Replace post author in header by custom taxonomy