The WordPress template hierarchy is your friend.
https://developer.wordpress.org/themes/basics/template-hierarchy/
This provides a very detailed flow for how WP determines which template to load.
If you are ever uncertain about which template is loading, this little function is handy. Paste in your theme’s functions.php and it will display the template used at the bottom of the page.
add_action('wp_footer', 'wpse_show_template');
function wpse_show_template() {
global $template;
print_r($template);
}
Related Posts:
- Jquery Slider for profile template
- Get excerpt using get_the_excerpt outside a loop
- Retrieve each widget separately from a sidebar
- Should I use loop in the single.php file?
- wp_list_categories: get latest featured_image of category
- WordPress Alphabetical Glossary close div in loop
- Where should I use post_class()?
- get_the_foo() in the loop – does it perform another query?
- Exclude filter on front page
- category__not_in — anyway to use category name instead of id?
- Filtering posts by multiple taxonomies
- Check if date of post is yesterday
- Exclude first 2 posts with meta_key from loop
- Fix inefficient loop breaks post.php on form submit
- Make a custom loop inside single.php with pagination
- Why do I get `Call to a member function have_posts() on a non-object `? [closed]
- Help with Changing loop.php?
- Filtering The Loop For Single Page and Blog Page
- the_content() seems to block my ACF-code
- Pulling current post/page data into header.php
- Loop and Page template : my WP_query don’t take args
- How to split a loop into two columns
- Category Ajax call
- Transient loop issue
- popular post weekly and monthly
- How can i use the same template file with a widget and category loop?
- WordPress Loop inside Loop?
- Get single post from tags array
- Apply an Incremental Counter in an Array Function
- Get all posts including sticky ones with get_posts(),setup_postdata(), and foreach loop?
- angularjs not displaying all posts
- Latest Post Styled Different Than other Posts
- ACF custom field in [closed]
- Split wordpress loop to multiple layouts
- Woocommerce: How to display product price [closed]
- Update status of all posts in a category
- is_active-sidebar loop
- Unable to change the “Read more” text inside the_excerpt
- Loop counter style
- Can I add generic numbering HTML classes to items as a loop runs?
- Add “showing posts x to x of y” in custom post type paginated loop
- Change post order by meta key, per post basis
- Custom Post Type on Homepage – Studiopress Genesis Framework
- New loop vs widget
- Display a single category in blog section
- Query Nopaging action not having effect
- Yoast taking over my WordPress title tag [closed]
- Pagination broken after using 2 loops to show content
- Getting page slug
- How to get pagination to work with 2 wordpress loops
- How do i find and restore a sidebar that i accidentally deleted? [closed]
- Exclude page from loop results
- How is WordPress changing the content markup?
- Inserting CPT and static content at every X post, is this possible?
- CPT while loop not working
- Problem with Front-Page.php loading recent posts
- Comments_template doesn’t work
- Get markup for post without loading into the template
- Where to add offset?
- How to synchronize The Loop with the max post per page?
- How to add a byline to all the pages?
- How do i create a list-posts-page?
- Exclude posts based on an array
- Displaying member join date on page
- Ascending order has strange effects on wordpress loop
- Is file_exists() compatible with timthumb.php? [closed]
- List ALL posts by author on author archive
- get post images to link to external sources
- Using is_page_template inside loop
- How to show the last article in a different way in my blog?
- Can’t limit posts_per_page in loop
- Slug is changing when I use WP_Query in a metabox of a post
- How to fix pagination for custom loops?
- Check to see if a field is within an array in twig
- Custom loop not working in singular.php, working in other pages
- Loop Posts Outside of WordPress Installation
- Strange problem with wp_get_attachment_image_src database (db) query count
- How to include posts from one category, into a separate category of posts?
- how do i make this loop work
- Archive sorted by month – separate
- Making a specific page wordpress compatable that is not index
- Humanmade | Custom meta box class: How to display a repeatable meta box group?
- Can’t print out returned value
- change the_content images for different sizes (Desktop, tablet, mobile)?
- Get query result before posts are displayed?
- WordPress Group By Problem
- display only parent replies count in index.php
- Home page loop with pagination problem
- WooCommerce custom loop pagination on front page
- Eliminate duplicates in a foreach loop [closed]
- Tag custom loop show posts
- While loop inside another while loop
- Problem with ms-thumb-frame-selected class in Master Slider
- I want the first post on my home page to be lengthier than the rest (example included)
- Loop with Custom Post Type Taxonomies and Interstitial Code
- Question about custom plugin
- loop mix my child-category and parent-category
- Fix html inside a for loop [closed]
- How can you make it so the comment box shows on some pages or posts but not all?
- Insert multiple custom components after x-number of posts