Display custom tax in “while” loop
Display custom tax in “while” loop
Display custom tax in “while” loop
CPT Loop, include taxonomies and disclude others?
Ok, i found bug in theme, and that is searching just posts in all theme. if (!is_admin()) { function wpb_search_filter($query) { if ($query->is_search) { $query->set(‘post_type’, ‘post’); } return $query; } add_filter(‘pre_get_posts’,’wpb_search_filter’); }
How to pass modified post to RSS feed?
Assign for all post of a post type a specific single-post template
Updated code: $newargs = array( ‘post_type’ => ‘apartments’, ‘tax_query’ => array( array( ‘taxonomy’ => ‘projects’, ‘field’ => ‘slug’, ) ) ); $the_query = new WP_Query( $newargs ); <?php if ( $the_query->have_posts() ) : ?> //The query returns 0, if I use a taxonomy, for post types it works, and I can bring all ACF fields … Read more
Get name CPT with slug taxonomy
WordPress tags only display default posts on their page. In order to display custom post type in tags page, you will have to add your post type in default query of the tag. Add below code in your functions.php and add custom post types in $post_types array which you want to display on tags page. … Read more
Solution: 1. Please add this code in your theme’s or child theme’s functions.php file: function get_user_id() { $author = get_user_by( ‘slug’, get_query_var( ‘author_name’ ) ); return $author->ID; } add_shortcode( ‘get_user_id’, ‘get_user_id’ ); Register the ‘get_user_id’ shortcode first in Toolset >> Settings >> Front-end Content >> Third-party shortcode arguments. Then use shortcode like this in the … Read more
CPT – Custom Text fields point to new url permalinks