Well I think I seem to be doing what I was intending too. Thanks @Milo for pointing me in the right direction! As You can see below I used the get_page_template_slug(); and str_replace() to filter through the templates used per page.
Can someone Verify that this is a viable option?
$args = array (
'post_type' => 'page',
'post_parent' => '29',
'orderby' => 'menu_order',
'order' => 'ASC',
);
$query = new WP_Query( $args );
if ( $query->have_posts() ) {
while ( $query->have_posts() ) {
$query->the_post();
$tn = get_page_template_slug( $post_id );
$word = array("page-", ".php",' ');
$template = str_replace($word,'',$tn);
get_template_part('page', $template);
}
} else {
}
Related Posts:
- Finding Page Template and Displaying Content
- Some doubts about how to show posts in a custom theme?
- get_template_part vs action hooks in themes
- Grab the first paragraph of each post
- First post of each category
- Echo all category names, apart from one
- how to get the post attachement image in full size?
- Change image size depending on page
- How can I use the WordPress Loop and Pagination in multiple instances but different scenarios throughout my site?
- first excerpt fine, subsequent post excerpts shift to the right instead of displaying vertically [closed]
- List categories of a post hierarchically?
- Local variable name in setup_postdata()
- How get the 10 most viewed pages (not post)
- How to close open divs in post loop
- Why am I getting posts back when I shouldnt
- Meaning of “if ( is_home() && ! is_front_page() )” snippet?
- Should we use get_template_part() in functions files instead of include_once?
- Add a dropdown to theme customizer
- Editing the custom background CSS
- What is the problem if I use CDN in my WordPress parent theme(built using bootstrap)?
- Is it possible to use line break in theme description?
- What are WooCommerce starter themes? [closed]
- How to disable the gradient and font size internal CSS added by WordPress when using theme.json
- Is there an error in get_the_tag_list()?
- Example of a theme organization without all the default wp files in root
- Disable the Custom Internal CSS added by theme.json for Certain Pages
- Unwanted blank lines before tag
- How do I display the “Archives” widget layout (sidebar) in WordPress by ‘year’ then by ‘months’?
- How do you protect a premium theme from being copied?
- Setting hero/splash section as a blog post
- posts_nav_link(); not showing up on static pages
- Custom Nav Walker Displaying Values in Sub Menu
- How to configure wordpress to work with Vuejs with SSR and without hashbang
- How can one update a theme on a live site without interruption?
- Sub folder CSS that’s read by Admin panel
- Dequeue a style file which is making website load slow!
- Can’t delete theme
- How to add a second stylesheet to the editor
- Stylesheet not linking
- How to control layout of posts on page?
- paged > max_num_pages won’t throw 404
- Single Page theme [closed]
- Can I have two different theme for two different language?
- Limit Loop to 5 Posts?
- WP_Comment_Query – Get comments and answers separately
- excerpt() shows different result between remote and localhost(development environment)
- Prefix best practice, should we use framework name or theme name?
- Theme Javascript.php Overwritten Nightly [closed]
- How to add Space between sidebar and footer widget in WordPress theme [closed]
- Call to undefined function add_menu_page() on theme activation
- Can I Set Up Session in WordPress Custom Page
- Is it acceptable for a WordPress theme to not accept widgets?
- Should all references to a text domain be to my current theme?
- How can I hard code my sidebar?
- Simple child theme modification but links are broken
- Making a WordPress theme based on twentyten
- theme style is applied on the dhasboard rather than the website
- Alignment Problem [closed]
- What $handle does WordPress use for a theme’s implicit style.css?
- A post with a clear:both in its css destroy the theme design, and the sidebar is moved to the bottom
- Unwanted empty line at the beginning of document
- Why is my container argument not working for wp_nav_menu() [closed]
- best practices for updating wordpress theme
- help needed for suit designing tool
- How can I sort my loop based on meta data, using a form?
- How to modify theme content in Thematic?
- Exclude parent categories from the_category() within the loop
- How to update mark-up of a gallery block in a custom theme?
- Host Private Custom Theme
- My wordpress theme name isn’t updating straight away
- How do I make my terms for each product display via foreach loop? (woocommerce)
- WordPress Insert ads after every 5th post
- Customizer API Multi Sections in single Panel
- WordPress theme options checkbox default checked state
- Copying a modified theme from one wordpress site to another wordpress site [closed]
- How can I change this SVG shape that’s generated?
- Adding a second logo next to the main one in header
- How can I not disable my theme when I want to upload a new version of it?
- (Parent) theme Is Not Showing In Theme Selection Panel and Therefore Breaks Child Theme
- How to show some of category in wordpress
- using themename_the_custom_logo() in template-tags?
- Creating a theme just to deploy a single page
- control posts order by select option
- Custom page template not showing on page creation
- Why content is not adding for each blog post
- how can I re-utilize and class on a child theme
- Weird ‘theme update’ error [duplicate]
- How to figure out which wordpress theme a site was using?
- Incorrect search results in search.php – issue triggered by using `define(‘BodyID’, ‘search’); the_post();` in search.php
- Flexslider not working for my custom theme WordPress
- WordPress two sidebar layout or theme
- Standard Way To Do Custom Work Within A Page?
- Add Dynamic Sidebar to Exisiting WordPress Theme [closed]
- Why does the first loop take arguments from the second loop?
- How can I install my custom-made theme on a wordpress.com blog? [closed]
- Turning WordPress Into full-featured website?
- WordPress Loop with Custom Post Type for Bootstrap Accordion [closed]
- Is there any reason that other theme elements (such as nav menus) shouldn’t be within the loop?
- .submenu class missing in output from wp_nav_menu
- What is the point of using the front-page.php template? [closed]