'Art Portfolio Posts', # 'labels' => array( # 'name' => 'Art Portfolio Experience', # ), # 'public' => true, # 'support' => array( # 'title', # 'author', # 'thumbnail', # 'custom-fields' # ) # # ) # ); # } # # # add_action('init', 'art_portfolio_posts_type'); # # # add_action('customize_register', 'front_page_portfolio'); # function front_page_portfolio($wp_customize) { # $wp_customize->add_setting('front_page_post_type', array( # 'type' => 'option', # 'capability' => 'manage_options', # 'default' => 'post' # )); # $wp_customize->add_control( # 'front_page_post_type', # array( # 'label' => '' # ) # # } # add_filter('pre_get_posts', 'front_page_portfolio'); function front_page_portfolio($query) { $cat = isset($_GET['cat']) ? $_GET['cat'] : null; $post_id = isset($_GET['post_id']) ? $_GET['post_id'] : null; if ($query->is_main_query() ) { $query->set('post_type', 'art-experience'); if (!empty($post_id)) { $query->set('p', $post_id); } else if (!empty($cat)) { $query->set('cat', $cat); } } }