How to have my page templates in sub folder Wordpress? - wordpress

I am using a child theme. In the child theme I would like to have a subfolder for all my page templates, e.g. homepage-template, default-template, etc in /templates. How can I do this so that wordpress admin menu can still see them when I choose a template for a page?

Can you upgrade to WordPress 3.4? This is a native function of 3.4.
See: http://nacin.com/2012/03/29/page-templates-in-subdirectories-new-in-wordpress-3-4/

Create a folder with the name page-templates in your theme folder.
If you have already published pages with templates before having them under this sub-folder, you have to reselect the template page for these pages and click update.

Related

Overriding MemberPress Template Files in Oxygen Builder via Plugin?

I want to override the MemberPress plugin's templates by following
https://docs.memberpress.com/article/165-how-to-override-template-files
But the problem is that I'm using Oxygen Builder which disables the WordPress themes so I can't copy the template folder to my child theme.
Is there a filter to change the MemberPress plugin template override path so I can override the templates from within a custom functionality plugin?
I have created a custom WordPress plugin to solve this problem.
This plugin is made for Oxygen Builder users where the theme is completely disabled. Simply add your customized MemberPress template files inside the [mepr_templates] directory in this plugin.
You can find the plugin here
https://github.com/Taimurian/oxygen-memberpress-support

Wordpress Static front page on all themes

I recently noticed some wordpress themes don't support custom static front pages instead of the blog page.
For example: The theme "Twenty Eleven" https://fuc.wordpress.org/themes/twentyeleven/
Is it possible to change that?
Yes it's possible.
Make a page name front-page.php in the theme's folder and then in Wordpress Admin Settings change the frontpage from "Your latest posts" to Static Frontpage.
Documentation Here:
https://codex.wordpress.org/Creating_a_Static_Front_Page

how to change the templates for the generic django cms plugins?

I want to change the output template or extend the template of the Text and Video plugins that are some of the generic Django CMS plugins.
how to do it?
Plugins use the Django template engine, this allows you to override any template at the project level.
So if the text plugin looks for a template in cms/plugins/text.html, you can override this template by adding cms/plugins/text.html in a folder that is on your TEMPLATES directory.

how to find Wordpress theme homepage file source code

my website using wordpress template and I want to edit the homepage but I can't find the source file of the homepage...i go to chrome - view source but can't find the index.php that has the source code of the homepage
how to find the file of the source code of the homepage
its depending on the file used by author. by the way, most of the themes have, home.php
front-page.php
index.php
otherwise, we can create a custom page in wp-admin and assign it as home page or front page to a wordpress, that will be configured on the settings page.
Go through it.
Start here https://codex.wordpress.org/Theme_Development to learn how WordPress themes are designed and coded.

How does Wordpress route index.php when a front-page.php is present in the theme?

I just set up a wp theme featuring a front-page.php.
When I point my browser to http://mydomain.com/ the front-page.php is loaded. That's ok.
But... which URL will now trigger the index.php template?
Thank you in advance for your feedback.
Matteo
index.php is the main file for the theme. It contains the code for the Main Area (below header & above footer) and will specify where the other files will be included.
Your site may be loading front-page.php because you may have set static page in your settings to be shown as home page.
Acording to wordpress official doc:
index.php
The main template. If your Theme provides its own templates, index.php must be present.
front-page.php
The front page template, it is only used if you use a static front page.
home.php
The home page template, which is the front page by default. If you use a static front page this is the template for the page with the latest posts.
See this Link for more details on wordpress template hierarchy: WordPress Codex « Theme Development « Template File List
Having said that, mention your site URL in question and may be I can help you more.

Resources