I think you misunderstand the purpose of get_template_part()
. It is a wrapper for locate_template()
, which itself is just a wrapper for include()
.
By calling get_template_part( 'loop', 'tag' )
, you are telling WordPress to look for/include a file based on the following priority:
- Child Theme
loop-tag.php
- Parent Theme
loop-tag.php
- Child Theme
loop.php
- Parent Theme
loop.php
If you need to modify the markup of the loop itself, then you simply need to modify the appropriate file, according to the above priority list – e.g. loop-tag.php
in your Theme or Child Theme.
You may need to create this file; if so, copy loop.php
, name the copy loop-tag.php
, and edit as necessary.
Related Posts:
- Related Posts loop – offset
- Does get_template_part pull data once in a loop?
- Get titles of all posts with current tags except current post
- Post Format single-loop.php using get_template_part
- taxonomy tags 404 to custom post types
- How to get_template_part using AJAX?
- A loop with all articles with certain text strings in tags
- Problems with loop
- How to show posts with multiple tags on tag.php?
- How to show “teaser” posts on blog / archive pages, otherwise full posts
- Detect if current page is front page within custom query
- Problem getting current post tags to show in a widget
- How do I display an image before the first post of the loop when I’m using get_template_part?
- How do I make a variable available inside partials?
- How to show more random posts if Tag has less than 3 posts
- Tag page only display 10 posts
- Exclude page name from loop
- Display Posts Only with Specific Tag
- For each loop on every word in post
- Tags on page (not post) returns nothing – why? Improved clarified question!
- Include future posts in tags and in search
- get_template_part() Not Working in Loop
- Get_template_part() problem with the_content()
- Problem with Front-Page.php loading recent posts
- How can have a conditional template tag based on the main loop within a secondary loop with new WP_Query(), using get_template_part()
- how to run loop in function.php that sends email based on specific conditions?
- Using has_tag() outside loop
- How to declare a variable in a loop and make it available in the template file
- Adding a second loop breaks everything
- Show posts by tags excluding current post
- WordPress Tags in class
- Secondary loop cuts off at 10 posts?
- get_template_part() to render single page Theme
- strange parse error when including a loop template within another template
- How to show only specific tag in wordpress loop
- Tag custom loop show posts
- get_page() unlike Loop returns the post content without html tags. How can I fix this?
- How to do query_posts on tags pages
- Tags outside the loop
- How to display Yoast SEO meta description in archive template for each post instead of the_excerpt()? [closed]
- How to place comments_template(); outside the loop?
- Endless loop with wp_insert_post and wp_update_post
- Hook into the loop via a plugin, and output something after every X post?
- Two custom loops, pagination, offset
- Access to Media Library
- Getting two wp_link_pages output
- Run The Loop over array of post objects
- Enable infinite scroll on single.php [closed]
- How to loop through ALL pages?
- How to retrieve “sticky” post outside the “loop”?
- Using get_the_excerpt() Before The Loop
- code suddenly appearing from my tempate second loop
- wp_query inside the_loop
- How to go about combining dropdowns / filter queries?
- woocommerce get_price_html not pulling in correct price
- How to fix pagination for custom loops?
- WordPress Rewriting the DOM?
- How to display posts by vote count and if no value continue with latest posts with no votes?
- Sort results by groups of numbers and letters
- Modify the main loop to display current month / year
- Display post list with different styles
- Loop for sticky posts
- Get author_id in wordpress
- Single.php different behaviour from admin to non-admin
- Array ids post to function have_post
- Give each posts in a loop a number in sequence
- custom post on homepage
- How to Loop with the final result formatted differently?
- Category ID returns as ‘0’?
- Show terms in archive page
- Loops for cat links not looping for wordpress site
- Skip 5 latest post while paging?
- WordPress: query pages except remove one page
- get_post_meta printing empty fields, but it shouldn’t be
- Sort posts according to a numeric value entered with ACF
- wp_get_attachment_url not fetching URL?
- get the value for ALT is we check to see if an actual ALT value is set, if not we use the caption and if no caption is set we use the title
- how to add 4 post in one carousel slide
- How to get all multi-select user meta values and add them to an array?
- How to resolve a reload loop issue in the frontend when logged in to WordPress multi-site backend admin area
- Exclude Posts Using Meta Query and User Meta
- Is “the loop” a template tag?
- Can I temporarily disable global $post?
- Shortcode for pulling specific Post Title outside loop when ID is passed in
- Can I Paginate Post after every 25 tag?
- Show a list of user posts in the user admin page
- Infinite Loop after Genesis Theme Upgrade
- Active class for my flexslider in WordPress
- WordPress loop only displays 5 articles max?
- Can’t see custom field after the Loop [closed]
- Showing related posts (custom post type) outside of the loop
- Same Loop on Multiple Pages
- Paged homepage – requirements?
- Least Number of Loops to Create Custom Homepage?
- The Loop for my theme with static front page is not working
- WordPress loop: Display if posts exist
- Showing ads after posts in home page
- Prevent duplicating specific column from database table
- Divide loop into several columns based on post custom field and enable infinite scrolling
- Query Loop Block: possible to restrict just child pages?