Yes, it’s fine to do that. WordPress doesn’t care if the loop or any of the other content-related PHP in the theme file is there or runs, but you should leave get_header()
and get_footer()
Related Posts:
- What is the preferred way to add custom javascript files to the site?
- Change admin bar to default:off
- Should I use set_transient or update_option?
- Custom Taxonomy Tree view
- What would happen if the admin installs a plugin when the plugin is included in the theme?
- Add a preview to a WordPress Control Panel
- Change text of twentyseventeen_edit_link()
- How do I get my child-theme to work with my theme’s includes folder?
- wp_insert_post breaks rewrite rules
- Where can I find a good reviewed collection of Twenty Ten child themes?
- How do I remove RSS feeds from themes?
- Template Hierarchy for get_header()
- How to add (css) classes to only one wp_nav_menu()?
- Advantages of using instead of wp_enqueue_style()?
- Style.css redirects to 404 Page not found
- How to add suggest plugin to theme?
- When developing a distributable Theme, does it HAVE to be “inheritable”?
- how do I get a sidebar’s id or number for use with is_active_sidebar()
- Looking for the code in twentyten that allows users to select images for the header/banner
- Relative Time On Posts
- Prevent update check for specific theme
- using wordpress without javascript
- Theme Check: Could not find post_class
- Unhook jQuery from WooCommerce via `functions.php`? [closed]
- Set a static front-page as a landing page programmatically
- WP 3.1 upgrade breaks AutoFocus+ theme
- Comment entry screen shows even though “Allow Comments” is unchecked
- How can I display/hide certain content based on a Theme Option field?
- Custom WordPress Theme – Search not working on posts
- How can I make that when I clic on one of the menu items, that page shows only posts with the same category?
- Hide header texts (Title & Tagline) in custom-header.php
- Why an arugment is missing in wp_get_attachment_image_attributes?
- Archive page doesn’t work
- Where to hook settings api init
- How to add “Template” option in page attributes panel?
- defining a folder location in order to recall it
- How can I detect hierarchal relationships beyond children (grandchild, great-grandchild, etc)?
- How to enable thumbnails in RSS dashboard widget
- How can i attach the attachment-ID to the user profile image?
- JavaScript stops working on selectively refreshed sections one inside the other
- How can I fetch the WordPress cart errors normally displayed in woocommerce-error?
- Remove settings if theme is deleted?
- Custom Blocks as part of a theme
- How to set up diffrent mobile theme for single site in WordPress?
- what is the difference between uri and path?
- Enqueued JavaScript is not working
- Derive child theme from separate theme
- How to change footer or for different kinds of users in wordpress?
- How to Download Minimum Requirement of WordPress (Not Themes )
- Create a child theme from multiple themes
- How can I use the WordPress Loop and Pagination in multiple instances but different scenarios throughout my site?
- How to determine (via php) if site is using a static home page?
- Migrating to WordPress – but how will it do “structured” data?
- How to fix : Uncaught ArgumentCountError: Too few arguments to function? [closed]
- I have WordPress setup on primary domain, how do I set it up on its subdomain using the same database?
- Theme development – Automatically menu creation
- What is the best way to build home pages with a lot of sections for distributable themes [closed]
- How to generate a hierarchical list of all pages and child-pages using a regular query?
- Should is_active_sidebar() always be used around dynamic_sidebar()?
- pre_get_comments or the_content filter
- using part of a theme in another theme
- Pagination not working on custom post page
- What might cause a featured image not to display?
- Add a field to the taxonomy editor?
- the_category() tag not styling HTML or CSS
- How to set default values for edit_post_link() in my theme?
- Remove/Hide a Widget on a Custom Template
- Creating an advanced searchform based on select boxes
- Setting thumbnail featured image size not working properly
- showing all recent posts in theme
- How can I scale down the width of images in bulk that are embedded in posts throughout the site?
- Why WordPress developer still using timthumb and what are advantages using them? [duplicate]
- finding menu hierachy > wp_get_nav_menu_items
- WordPress Shortcodes – Optional Styles
- I don’t think WordPress is loading jquery or bootstrap js
- Show popover with url and option to open in new window
- Child theme’s style.css is loaded twice
- Best way to give user the option to make a menu, mega menu?
- Is it possible to show sort page excerpt in search.php
- create loop for the_content()
- how to change footer content for certain pages only
- use a single nonce in three different nonce field
- Theme is Enqueueing Everything in Footer
- Should I use template files or just use conditional tags in index.php?
- Media & Plugin screens stall
- wp_kses allow checkbox class and checked
- Is wp_mail plugin territory?
- HTML TO WP Theme : Submenu goes down wp_nav_menu
- How do I remove p tag *insertions*? Disabling `wpautop` removes manual tags
- Create a variable with string, array or multiple values
- How can I include the js and css file of my custom theme dynamically in header.php
- WordPress Blog Page displaying nothing
- What hook to use for loading a custom class extension during Theme initialization?
- Set start page depending on screen width [closed]
- How can I change the title of the Home link in the navigation bar?
- Use external fonts in WordPress stylesheet
- Custom link color or stylesheets
- What is the advantage of using home.php over index.php for the front page
- Add option for administrator to submit link
- Meaning of “if ( is_home() && ! is_front_page() )” snippet?