I have a CPT (homepage) and a taxonomy for this CPT that has some fields (about, services ,...) I want to display the posts (and the contents) of each category (of custom taxonomy) in my homepage. but I don't know how do it! Could you please Help me? any helps would be appreciated.
in functions.php:
//////////////////////////////// // CPT - Home Page Content //////////////////////////////// function cpt_homepage(){ $labels = array( 'name' => 'Home Page Contents', 'singular_name' => 'Home Page Content', 'menu_name' => 'Home Page Contents' 'parent_item_colon' => 'Parent Home Page Content', 'all_items' => 'All Home Page Contents', 'view_item' => 'View Home Page Content', 'add_new_item' =>'Add New Home Page Content', 'add_new' => 'Add New', 'edit_item' => 'Edit Home Page Content', 'update_item' => 'Update Home Page Content', 'search_items' => 'Search Home Page Contents', 'not_found' => 'Not found', 'not_found_in_trash' =>'Not found in Trash', ); $args = array( 'label' =>'Home Page Contents', 'description' => 'Different Home Page Content, our team may design and develop', 'labels' => $labels, 'supports' => array( 'title', 'editor', 'thumbnail' ), 'taxonomies' => array( 'post_tag' ), 'hierarchical' => false, 'public' => false, 'show_ui' => true, 'show_in_menu' => true, 'show_in_nav_menus' => true, 'show_in_admin_bar' => true, 'menu_position' => 2, 'menu_icon' => 'dashicons-welcome-view-site', 'can_export' => true, 'has_archive' => true, 'exclude_from_search' => false, 'publicly_queryable' => true, 'capability_type' => 'post', ); register_post_type( 'homepage', $args ); } add_action( 'init', 'cpt_homepage', 0 );
and In home.php (i wanna somthing like query on taxonomy)