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 fix pagination for custom loops?
- Jquery Slider for profile template
- Counting the posts of a custom WordPress loop (WP_Query)?
- if ( is_home() && ! is_front_page() )
- Get excerpt using get_the_excerpt outside a loop
- How to display Yoast SEO meta description in archive template for each post instead of the_excerpt()? [closed]
- Get post content from outside the loop
- Why should I put if(have_posts()), is while(have_posts()) not enough?
- Display featured products through custom loop in woocommerce on template page
- Split Content and Gallery
- How to get Author ID outside the loop
- How can i display the content in plaintext
- Redirect loop when trying to login to /wp-admin/ [duplicate]
- How to split a loop into multiple columns
- Using a custom WP_Query with get_template_part loop
- Is it necessary to reset the query after using get_posts()?
- Is there any difference between the_title() and echo get_the_title()?
- AJAX with loop filtering categories
- Do I need to use The Loop on pages?
- Remove the Homepage Query
- remove tags from the_content
- the_title() shows title of the first post instead of the page title?
- How to force excerpts / teasers in the loop
- Retrieve each widget separately from a sidebar
- Why am I being limited to ten posts on a custom loop?
- Should I use loop in the single.php file?
- A search for ‘0’ returns results
- get_template_part from plugin
- Why do themes rely on “The Loop”?
- How to return loop contents
- Using the Loop to show all levels of subpages under a parent page? Halfway there
- Cleanest Way to Select Every Second Element in a Loop?
- Insert image or ad script after 3 posts using the loop
- Get date of last update outside of loop
- Pagination not working on home page
- Child Pages Loop
- How to place comments_template(); outside the loop?
- Multiple Loops Homepage?
- How to Change Loop to Order Posts by Views (using wp-postviews plugin)
- how to upload image using wp_handle_upload
- Avoiding using a loop to access a single post
- Executing Queries in tag.php
- How to get the first image gallery of a product in woocommerce in a loop
- Get post by page name or slug
- save_post + insert_post = infinite loop
- How to order posts tag by tag?
- Loop.php vs looping inside template file
- Get ID of a page containing secondary loop in content
- Custom Loop and Infinite Scroll
- Loop that displays PARENT PAGE & CHILD PAGE & outputs GRANDCHILD PAGE title and content
- is_home, and is_front_page conditional problem
- Is `query_posts` really slower than secondary query?
- Are there any scenarios where the query_posts may be used?
- the_content and wp_link_pages
- Adding ‘current_post_item’ class to current post in the loop
- How do I get the attributes of a short code from a post?
- Loop through all tags & output posts in alphabetical list
- How can I custom order the results from wp_list_categories?
- ACF Repeater loops and resets – where is the reset_rows() documentation? [closed]
- WooCommerce Product Page Loop – Output All Product Thumbnails
- wp-admin redirecting to https, denying login