Adding a checkbox field to a (custom) taxonomy
Fortunately this guy has written a great taxonomy class to solve all of this 🙂 https://en.bainternet.info/wordpress-taxonomies-extra-fields-the-easy-way/
Fortunately this guy has written a great taxonomy class to solve all of this 🙂 https://en.bainternet.info/wordpress-taxonomies-extra-fields-the-easy-way/
Custom post edit page permalink links to edit page rather than the post
Literally seconds after updating this post I found the solution….again, Must have looked at this previously and not entered the details correctly as I tried this one before. 🙂 add_action(‘pre_get_posts’, ‘add_special_sort’, 11, 1); function add_special_sort($query){ // Bail if not the main “hidden” query, as opposed to a ‘new WP_Query()’ call if(!$query->is_main_query()) return; $query->set(‘meta_query’, array( ‘relation’ … Read more
Pre_get_post custom taxonomy combined with custom fields?
Templates for CPT not working
Ok, I managed to do it with get_the_taxonomies()Codex and unset() PHP Manual So, here is how the final code looks like: //define the arguments so the output will have the format I want $args = array( ‘template’ => __( ‘%s: %l.’ ), ‘term_template’ => ‘<a href=”https://wordpress.stackexchange.com/questions/284512/%1$s”>%2$s</a>’, ); //get the array and store it $taxList = … Read more
Use 2 separate post types. It will save confusion now, and provide flexibility later if you decide to do more with each of the posts. There will be a bit more work, but the payout will be worth it. When you’re setting up the CPTs, they will automatically have archive pages and the individual posts … Read more
I did solve it by myself – I had to register the taxonomy BEFORE the post type…
create specific taxonomies template for Genres & Year & Author like this : taxonomy-genres.php taxonomy-year.php taxonomy-author.php
$args = array( ‘posts_per_page’ => get_option(‘posts_per_page’), ‘post_type’ => ‘listing’, ‘tax_query’ => array( array( ‘taxonomy’ => ‘listing_category’, ‘field’ => ‘slug’, //can be set to ID ‘terms’ => array(81) ) ) ); $query = new WP_Query( $args );