I would say to add them as template parts as in content-[name].php. For instance in page.php
you could have something like:
<?php while ( have_posts() ) : the_post(); ?>
<?php if (is_page( 'home' ) ){
get_template_part( 'content', 'benefits' );
} elseif (is_page( 'Contact' ) ){
get_template_part( 'content', 'contact' );
}
}
get_template_part( 'content', 'popup' ); ?>
<?php endwhile; // end of the loop. ?>
It seems to make more sense as it is content after all.
Related Posts:
- Check if has any sidebar active on current page
- Dynamically Register Sidebars For Each Top Level Page
- Change a sidebar name?
- add sidebar area to header of child theme
- Make “sidebar template” the default template for new pages
- Missing argument 2 for a custom function widgets_init
- is_dynamic_sidebar always returns true while using Jetpack visibility
- How to insert custom widget in custom sidebar in theme activation?
- Display post shortcode content in the sidebar?
- Best practices regarding the creation of custom widgets?
- How do you Permanently Delete Sidebars
- Custom Sidebar only on single post
- Is `is_sidebar_active()` deprecated, and showing error?
- register_sidebar_widget is deprecated since version 2.8! Use wp_register_sidebar_widget() instead
- Why is it so hard to add a class to the tag in the sidebar widget?
- Best way to disable sidebars on posts (only)?
- Register_Sidebar overwriting itself and doesn’t exist in global $wp_registered_sidebars;
- New checkbox in custom widget isn’t saving data
- Multiple, Dynamic, Sidebars Problem – First Sidebar not working properly
- How do you insert code into the sidebar?
- Change is_front_page() to is_page() to display ‘hero’ on entire site?
- Trying to Add a LEFT Sidebar?
- How to programmatically GET (to know) which Sidebar (or) which Menu is being used on Different Pages?
- unregister_sidebar in child theme not working
- Additional Sidebar
- Add the title of a widget as an ID – for anchor links
- How to add a data attribute to a WordPress menu item
- Order posts (across the whole site) by metadata date
- Relative URLs and hide /wp-content/themes/
- Disable visual editor on one specific page
- Can the wp-plugins (Must Use Plugins) URL be targeted for use in functions.php?
- Slugs as breadcrumbs for Pages
- Removing Unnecessary Text from Admin Menu without CSS
- Display WordPress Search
- Remove_filter (‘the_content’, ‘wpautop’) is not working
- Setting cookies in WordPress
- How to add iOS & fav icons to the theme?
- Defer all js except certain ones in functions.php file
- Getting RID of thickbox!
- Multisite, either change the name of sample-page or create new page
- What is the “icon” parameter in wp_get_attachment_image_src used for?
- Toggle Sidebar Display
- How to use thumbnails in gallery?
- Hide Author.php template from specific user role
- Customizer field value into functions.php variable
- How to display a default image for post thumbnail using functions.php?
- How can I load a javascript file that is type=”module” the WordPress way?
- How to manage arrays from custom functions stored in functions.php?
- list tags with count in author profile page
- Product Tags in Add New product as checkbox list [closed]
- Running a script before absolutely everything
- Auto delete post if certain custom field data is empty
- using `require` in my functions.php breaks the site
- Is it OK to include files using ABSPATH?
- How to fetch the name of the active menu?
- Limit length of first excerpt in the loop
- How can I show my latest tweet in my wordpress blog?
- How to retrieve the current post’s generated featured image size?
- Function shortcode – Set Parameter
- Is there a way to prevent a function/method from being called outside a specific hook?
- attachment page template? only show attachments for current post?
- get_next_posts_link() returns no result despite available posts
- Randomizing wp_tag_cloud() in child theme
- Nav menus all outputting the same links
- Secondary Menu and Logged In Users
- Modify gform_other_choice_value for specific form and specific field in Gravity Forms
- Adding code before post title with the_title produces weird results
- Remove the month and year from a WordPress Date?
- How to insert class in each list of categories?
- Add Link to Users List (Backend) to open each users front-end profile
- Editing the formatting.php file vs functions.php file?
- remove/hide wp-editor
- Function not saving unchecked checkbox
- Removing parent theme CSS without editing parent theme
- Entirely Different Functions.php per Page?
- Hide Author By-Line if After Certain Date
- wp_title() return random number
- How to offset main query without affecting other queries and backend
- ACF Date Form in Custom Admin Field
- How to add link rel tags on paginated posts?
- How to pass data from a plugin to functions.php
- Function to disable “href” anchor tags that contain “a data-name” on mobile only
- Execute jQuery with custom event listener after successfully add an item to the cart
- WordPress hooks to call a function inside a construct
- WordPress undefined function error on using add_action() in functions.php
- how to display featured image for single post for a specific category
- Load a Child Theme’s style.css just before the closing tag
- Can’t wrap my head around this function – any help would be appreciated
- Figure inlined width trigger distorted layout
- save_post hook – headers already sent?
- Exclude javascript in certain page url and all following url’s after forward slash
- Shortcode Variations?
- How to test for a class (from a plugin) in functions.php
- Child Theme not working – CSS gone
- Custom shortcode not being included in content paragraph [duplicate]
- Display post_meta-by_key on product catalogue
- Which template file to edit to edit homepage in Mystile [closed]
- Get all users from role and add to dropdown (select) – wordpress, javascript
- Add functionality to block comment authors in the Comment edit pag
- WordPress enque the same script causes the setInterval not to work