You would use page templates to accomplish what you’re doing. If you specify a page-{slug}.php
, it’ll use that one instead. It always does upward traversal. So if there’s a specific page, it’ll use it. If not, it’ll be one level more general.
Copy the home.php PHP into your new one, and remove the calls for the header and footer. Voila!
You could also wrap the calls to the header/footer in an is_page()
conditional
if (is_page("slug-name") { get_header() }
<- pseudo code for you to get the idea You’ll have to see what all you need to wrap in conditionals for your use case.
More info on using Page Templates: here
Related Posts:
- A special single page templates for posts under a category and all its child category
- How to delete read more span on single post view?
- Remove post templates from the selection box menu when creating a single post
- global variables in templates
- How can I include ALL post types in the_post_navigation() links, not just current post type?
- Search button click sends to single-custom_post_type instead staying at the same page
- Page Templates Used in Custom Post Type
- Single template will not show sidebar/bottom-nav and footer
- Custom Post Type Trouble
- Adding Page Attributes Metabox and Page Templates to the Posts Edit Page?
- Is there a way to list all used/unused WP templates?
- Print WordPress template filename(s) for debugging
- Change the name of the ‘Default Template’
- Echoing Elementor page content in template, but it doesn’t get styles and some widgets are missing
- How can I modify the default reset (lost) password email text?
- Template files missing after moving site
- Create single.php for specific category by category id
- Grid layout “last” class to every third item
- Where is the /blog/ url set from?
- How do you modify Page Template?
- Using “setup_postdata” with “get_template_part” does not work
- How can I get the content of the home page?
- Why aren’t my posts showing?
- Adding variable to get_template_part
- How to display error on specific template?
- How to move style from template file to section?
- What is content.php file that is needed for Jetpack infinite scroll plugin?
- Auto-Generate Longtail-SEO Pages/URLs
- bloginfo(‘template_directory’) img src
- Should template files be copied to the child theme for editing?
- Calling an image within the theme folder from inside a post/page?
- Best Constant to use to check if WordPress is running
- Display “large” image size and show caption in attachment page
- WordPress automatically created files like .theme-name / .plugin-name.php [closed]
- How to show the archive / post type description on Single templates
- style sheet header on Page Templates
- Why does the Full-width Template in Twenty Twelve pack so many classes into the body class attribute?
- How to support custom templates on a custom post type?
- How to use $wpdb (from the template) to update the DB, without being an admin
- Show all parts in multipage post
- Page attributes missing
- Remove Items from Template Homepage
- Bizarre issue with custom RSS template
- Using shortcode in template file
- Display current category and child
- Return get_header and get_footer string instead of echo it
- Different templates for same content, landing page from different URLs (generic, simple)
- Use one template only for custom post type archives?
- Is there a more efficient way to loop through pages?
- Is it possible to register a new template file?
- What template is used for viewing Media Library Files?
- Remove portion of header code from home page only
- Use a separate template for the home page only
- Create a blank test.php
- How do I remove the word “Blog” from a WordPress Homepage?
- AMP version of front page without plugin
- Load different single.php templates according to post layout selection
- Theme settings Page: Settings Api vs Update_Options
- Give wp link pages it’s own template
- /wp-admin/post.php shows 404 template on submit
- Which template.php for /blog
- List Category Posts plugin – underline links [closed]
- Conditional template tag for buddypress pages
- Need help with my template [closed]
- WordPress Template Reverts to default template after changing
- using add_filter in a template_redirect function?
- How does post loop integrate individual page elements
- Content not showing properly with the first load of the page
- Where do I edit what the user sees on my WordPress site?
- Unable to access wordpress page
- How to configure my blog page
- Accidentally deleted code in header.php
- BuddyPress : how can I call the template WordPress would have chosen (template hierarchy)?
- How can I make custom page templates work on child theme?
- Assign for all post of a post type a specific single-post template
- Archive only for /year/month, not terms
- Why default template does not show?
- Why does the blog page not take the page template selected?
- Custom Taxonomy Theme file not routing correctly
- Why would adding a template file to a child theme cause an error in template-loader.php?
- How can I make is_page_template() workable in child theme?
- How can I add some blocks to template without changing template file?
- Creating a popup
- WordPress not picking up custom templates in sub directory
- Category template not displaying all post formats
- Is it possible to call a template file inside wysiwyg editor? And how?
- Retrieving post ID from current page
- Comment text area in single blog post and show comments if approved
- Mysterious template change after database import/export
- Is there a way to share a template/markup with the JSON API so that it doesn’t need to be declared both in PHP and in JS?
- Styling own template
- WordPress sites translate dynamically generated Homepages
- changes to templates not showing on server
- Why is this page using the homepage template and not the one it should?
- Problem with permalink structure for WordPress custom post_type archive template
- Make default template two columns?
- Read more button not working
- pass dynamic value to page to pull in categorised post cards
- templates page not showing on gutenberg editor
- How to load php templates from html page (block theme)