You can replace the homepage template via plugin like this:
// Filter to replace the template of the home page
add_filter( 'template_include', 'replace_home_page' );
function replace_home_page( $template ) {
if ( is_front_page() ) {
return plugin_dir_path( __FILE__ ) . 'new_template.php';
}
return $template;
}
Related Posts:
- Looking for WordPress System Diagrams
- How can I load a page template from a plugin?
- Overwrite theme file from plugin
- How to control output of custom post type without modifying theme?
- When is it appropriate to put functions on page template vs. functions.php?
- Filter to change the content of 404 page
- How to properly use a hook to create template for custom product type in a plugin such as Woocommerce? [closed]
- How to check active theme is parent or child wordpress
- WordPress removing data attributes for scheduled post
- Is there a way to loop through a shortcode datasource to create a table?
- creating custom archive template within plugin for custom post type using archive_template filter
- Where to call wp_enqueue_script in a plugin with custom template?
- Can Page Templates be Applied to Archive and Post Templates?
- ORDER BY wp_post custom column name in wp_query
- Create a free scripts and styles template within a plugin
- How can I turn a custom wordpress page into a product page?
- Plugin templates vs Parent Theme
- How to make “upgrade safe” theme for a plugin?
- What action hook can I use to add a JavaScript to a page post using a theme template that is not including get_header() nor get_footer()?
- How to create templates for a custom module to show on the front end within my theme?
- Why aren’t some plugin styles loading when I load a template?
- Plugin custom post template; without overriding all posts
- Best way to distribute templates and code accross multiple wordpress sites?
- Load php file with jquery in single.php
- Overriding the template files using a plugin for all themes
- How do I use a plugin to swap out the template file for a custom post type?
- Javascript not being loaded only in custom taxonomy template
- Add new header/footer on landing page with plugin
- Use a page as a template for a custom post type
- Page template compatibility with different themes
- Template file structure , wordpress hook for altering the template
- Displaying External Data – Not Posts
- Making plugin output customizable
- Use different archive template for plugin
- How to display custom taxonomy and terms using/creating plugin template
- How to check during “pre_get_posts” if WP performing default query for specific custom template?
- WP Job Manager – Show recent jobs as cards
- Help interpreting @wordpress/create-block-tutorial-template usage error
- How can a plugin create a page/form in the front end?
- How to output message during plugin activation
- How to provide translations for a WordPress TinyMCE plugin?
- How to add custom content template part for a custom post type on main query using a plugin
- Where do I start from
- How do you create a custom edit.php / edit pages page
- Check the Version of an Enqueue’d External Library
- Edit the output of wp_widget_rss_output()
- Change of query var in pre_get_posts not maintained
- Menu Error in Admin Console with Custom Plugin: You do not have sufficient permissions to access this page
- How to Parse an Array of Elements in Gutenberg Block
- Custom rewrite rule serves content, but returns 404 error code
- Will changing the ‘Plugin Name’ header in the next update of a plugin break anything?
- Performance of several get_option() calls
- How to edit mySQL wp_posts table from plugin php?
- Creating a Wordpess Plugin that writes data to a csv file. The data doesn’t show in the csv file?
- Problem with is_active_sidebar?
- Prevent Plugin from loading on ‘wp-admin / wp-login’
- Widget update function not saving values
- override pluggable.php functions
- get_the_excerpt() is not returning an empty string when the_excerpt is blank?
- “Plugin could not be activated because it triggered a fatal error.”
- Does the order of sections in readme.txt matter?
- Add column in WP user but it goes wrong
- modify wordpress default search
- How to remove the current post from the query?
- Is file_get_contents() the only way for plugins reading local files OR does WP_Filesystem_Direct::get_contents() even work?
- how to get up row in wordpress with wpdb
- Hook into Jetpacks Publicize without using a post type
- How to limit number of number of categories displayed by categories widget
- How to remove default style of header in wordpress metabox
- Using WordPress PHP code, how to bulk delete only 100 subscribers at a time from thousands of users?
- Checking a WordPress for OWASP top 10 vulnerabilities [closed]
- hook filter after the_content on a specific page
- The Correct Way to Use Nonce Field without Settings API
- Run command “composer install” when activating wordpress plugin
- Import user data using CSV
- How to submit/upload data to database and in specific folder?
- OOP plugin not working
- Plugin Options not saving options and doesn’t work
- JQuery Slider – Similar to www.internetmarketinginc.com [closed]
- Development plugin to view and manage scheduled wordpress cron jobs?
- Add user managable titles to custom menus?
- WordPress video js error this.mediaElement.play is not a function
- Custom Icon for Plugin
- WP_Query order posts by category
- How to override supports of innerBlocks?
- How can we upload file to root directory of wordpress
- Implications of creating a plugin that adds functionality to other developer’s plugin?
- Adding External Gmap JS to WordPress
- First page download plugin
- why is update_user_meta creating arrays when trying to change the same value?
- how to do Thematic like this website using wordpress?
- How to avoid conflict if a plugin already have included open library?
- WordPress OOP get current user question?
- Override WooCommerce files from plugin
- Add WordPress Meta Box saved form input to WordPress RSS feed [duplicate]
- Unable to link CSS file
- Can I access WordPress API’s from within plugin scripts?
- Is there a way to make is_search() always return false
- Apply Filters Causing a 500 Internal Server Error
- How can i add insertion point between inner blocks in my custom block like core blocks