How to display custom post type taxonomy in Contact Form 7 text field
How to display custom post type taxonomy in Contact Form 7 text field
How to display custom post type taxonomy in Contact Form 7 text field
SOLUTION <?php $args = array( ‘post_type’ => ‘product’, ‘post_status’=>’publish’, ‘tax_query’ => array( ‘relation’ => ‘AND’, array( ‘taxonomy’ => ‘sectors’, ‘field’ => ‘slug’, ‘terms’ => ‘garden’, ), array( ‘taxonomy’ => ‘season’, ‘field’ => ‘slug’, ‘terms’ => ‘winter’, ), ), ); $query = new WP_Query( $args ); echo $query->post_count ; ?>
Post template with breadcrumb needs to show page navigated from
Add an empty option in first position: … echo ‘<option value=””>All locations</option>’; $query = new WP_Query( $args ); while ( $query->have_posts() ) : $query->the_post(); echo ‘<option value=”‘ . get_the_ID() . ‘”>’ . get_the_title() . ‘</option>’; endwhile; …
You would not do this using SQL, and you don’t need to. Use PHP instead. For example, this code adds a search parameter to the query, but the value changes depending if the user is logged in: add_action( ‘elementor/query/article_video_together’, function( \WP_Query $query ) { $foo = is_user_logged_in(); if ( true === $foo ) { $query->set( … Read more
WordPress always has similar function to a list, you may try wp_dropdown_categories instead of wp_list_categories. It takes almost the same arguments, which is not related to list items. $tax = get_term_by(‘slug’, ‘cursos’, ‘portfolio_category’); $tax_id = $tax->term_id; $args = array( ‘child_of’ => $tax_id, ‘taxonomy’ => ‘portfolio_category’, ‘orderby’ => ‘name’, ‘show_count’ => 0, ‘hierarchical’ => 0 ); … Read more
here is correct answer if someone need $aprel = get_queried_object(); /////////////////////////////////////////////////// $aprelpost = array( ‘post_type’ => ‘sikayet’, ‘post_status’=>’publish’, ‘tax_query’ => array( ‘relation’ => ‘AND’, array( ‘taxonomy’ => ‘sectors’, ‘field’ => ‘slug’, ‘terms’ => $aprel->slug, ), ), ‘date_query’ => array( ‘year’ => 2021, ‘month’ => 3 ) ); $aprelpost_query = new WP_Query ( $aprelpost ); $ap … Read more
How to display taxonomy terms in a dropdown on a user edit page
Custom post type 404 category page
If you just want the category permalink be in the form of: example.com/products/category/<category slug>, then you don’t need to hook on term_link. Instead, you could just set the taxonomy’s rewrite slug to products/category and you would also register the taxonomy first then followed by the post type. That way, WordPress would see the request (at … Read more