Custom post type is using the index.php template

public is false by default, your post type will not be visible on the front end without explicitly setting it to true. $post_args = array( ‘public’ => true, ‘label’ => _(‘Blog Post’), ‘description’ => _(‘Site\’s blog posts’), ‘show_ui’ => true, ‘show_in_nav_menus’ => true, ‘taxonomies’ => array(‘blog_posts’), ‘supports’ => array(‘title’, ‘editor’, ‘comments’, ‘trackbacks’, ‘thumbnail’), ‘capability_type’ => … Read more

How to get the current category with custom posts

The good basic technique to go from specifics to more general context is to look at the calls you already have. You already call single_cat_title(), which somehow knows current category, right? If you look inside you will see it passes call to single_term_title(). And how does that one in turn knows? $term = get_queried_object(); So … Read more

Cannot get custom posts by category

You can try using cat or category__in (for array of categories) instead of category-name and assign an ID to it: $args = array( ‘posts_per_page’ => 6, ‘post_type’ => ‘albums’, ‘cat’ => 4, ); I also would use single quotation ‘ instead of double quotation ” while setting a value. You are also missing quotations around … Read more

custom post type make featured image box full width

I think you are trying to move Featured Image meta box to left column. Add this code to your plugin or functions.php file of your active theme. add_action( ‘do_meta_boxes’, ‘wpse_269370_move_featured_image_meta_box’ ); function wpse_269370_move_featured_image_meta_box() { remove_meta_box( ‘postimagediv’, ‘portfolio_post_type’, ‘side’ ); // remove meta box of featured image from current location – ‘side’ add_meta_box( ‘postimagediv’, __(‘Featured Image’), … Read more

Get post content from another section in custom single page

Multiple loops in the same page <?php // this is for customer posts $args = array( ‘post_type’ => ‘customer’ ); $the_query = new WP_Query( $args ); ?> <?php if ($the_query->have_posts()) : ?> <?php while ($the_query->have_posts()) : $the_query->the_post(); ?> <?php // loop here the_title(); the_content(); ?> <?php endwhile; wp_reset_postdata(); else : ?> <p><?php _e( ‘Sorry, no … Read more