Template setting is not saving in wordpress - wordpress

I'm using a child theme. I want to override a template of base theme.
I created, articles-page.php which starts with:
<?php
/*
Template Name: Articles
*/
While creating a page in Wordpress I can see my template listed in the Page Attributes widget to my right. The problem is, when I change my template setting to "Articles" and hit update. It still shows default. My change is not being saved, hence my template is not being loaded for that page.

All you have to do is to copy the specific template file you want to alter from the parent theme into the child theme’s directory, then make your changes. The way WordPress works is when it looks for some template file, it looks in the child theme first, then it goes to the parent theme if the file it wants isn’t there.
Copy the file as it is in child theme with same name. Later try editing the template.

Related

Wordpress - Some child theme files are not recognized in the template

I'm new to template designs and I'm trying out altering some things in the parent theme from the child theme.
My problem is that there are some files that are not recognized, for example the style.css from the child theme does work for me, but there are other files that I need to load in the child theme instead of the parent theme that I am not able to get them to work.
I am trying to get the /inc/core/shortcodes.php file recognized in the child theme, as there is an html <h4> tag that I want to replace with an <h3>.
The file structure is as follows:
Any help would be appreciated, best regards.
Child theme implementation isn't a universal thing in WordPress - each theme implements it in its own way (some very poorly), and not everything is necessarily overwritable through a child theme. Usually, only actual template files are overwritable. The specific file you're referencing (shortcodes.php) likely contains shortcodes added by the theme, not template data, so wouldn't generally be overwritable in that way.
The better way to handle what I suspect you're trying to accomplish (modifying how a specific shortcode works) would either be to use hooks in the shortcode (assuming the developer added them) to manipulate the shortcode output, or copy the shortcode(s) you want to modify into a file in your child theme, change the name (and function name) of the shortcode, and load it from the functions.php file. This also gets more complicated if you're using a theme with a page builder (Gutenberg, Visual Composer, Elementor, Cornerstone, Avia, Avada, Beaver Builder, etc). Most page builders use some form of shortcode under the hood to actually generate the displayed data. If your theme uses a page builder like this, and the shortcode in question has a corresponding element in the page builder, you'll also have to add a button for your modified version (or insert is using the "HTML" or "Code" element) to actually use it - the existing button wouldn't incorporate your changed code. All of the page builders mentioned above can be (and have been) extended in this way.

override woocommerce.php with custom content for only store homepage

I currently use FoundationPress (Foundation6) as framework and starter theme. It uses woocommerce.php template files to hook into woocommerce functionality but for the life of me I can't figure something out.
I need to add custom content to the stores homepage only, non of the other store pages. Whatever I add to woocommerce.php will appear on all store pages, but I can't figure out what template controls the stores homepage.
The first set of templates I can see are used are the ones that are inthe loop folder and content-product.php. Normally I would just edit archive-product.php but woocommerce.php takes over from this template: see bottom of https://docs.woocommerce.com/document/template-structure/.
The shop is archive-product. However I did not try FundationPress but it seems that WooCommerce needs in the last version to declare WooCommerce support in themes. https://github.com/woocommerce/woocommerce/wiki/Declaring-WooCommerce-support-in-themes
So first try https://en-gb.wordpress.org/plugins/query-monitor/ and check which template is loading. And if its loading page.php instead of Woocommerce template implement the line in functions.php.

How to change default blog tempate in wordpress genesis framework?

So I have a child theme which extends genesis framework.My child theme is basically using the Genesis blog article theme. I looked into the page_blog.php of the Genesis theme but it has only genesis loop running and says that code being used is in the file lib/structure/loop.php. I want to change the default blog article page, I want to show the author name, blog category, a published date which requires the change in the HTML. How can I do so?
if I got it right, you need to override files in the parent theme by recreating them (at least copy them) into the child theme directory>> so you need to copy the blog article page and change it,also you may need to create functions.php in the child for new functionalities
for more details https://developer.wordpress.org/themes/advanced-topics/child-themes/
You have 2 options :
You can create your own page_blog.php file in your child themes root directory and add code directly to the file and modify the default functionality.
Or you can select the blog page template and use custom fields to control the query variables

Insite: Trying to create a custom theme, css isn't working

I'm new to Insite, and I'm trying to create a custom theme using their demo site as a base. The default theme that the site uses is InsiteManufacturing (which inherits the Responsive theme). When I load up the site, it looks like this (I added a custom homepage to the InsiteManufacturing theme to override the one in Response).
To make a custom theme, I made an exact copy of the InsiteManufacturing directory and put in the Themes folder, and renamed it "CustomSite". Then in the Insite Console, in Website Settings > Theme I changed the Theme Value to "CustomSite". When I refreshed the site, it has the content but no styles.
Why aren't the styles being applied? The directory is exactly the same as the InsiteManufacturing directory, other than the name (and the HTML on the home page).
I know that Insite is finding the CustomSite theme, because 1) the HTML on the homepage is correct ("Hello! (Custom Theme)") and 2) when I put a non-existent theme name in the Console, I get an error loading the page. So CustomSite is being found, but the styles aren't working.
You have to set up the theme.config file in your custom theme telling it what the parent theme is. Take a look at the theme.example.config in the Themes folder.

Wordpress Templates aren't showing up on my Page Options

I'm working on my first WordPress project. It won't be a blog but a CMS to quickly edit content and pages on the site.
I've got the header and footer exactly how I want it by editing them in the Appearance -> Editor menu. Under this menu I see quite a few templates that I could use (screen shot http://i.stack.imgur.com/P7IyY.png), some of which I don't even think I'll need or know where they came from. However when I edit my pages and go to the Page Attributes section there is only an option for 1 template (screenshot http://i.stack.imgur.com/UblzD.png). If I select Default Template as my template for the page, only the header and footer seem to load.
I am pretty new to WordPress. Am I suppose to 'activate' these templates somewhere? I only plan to use a handful of them (index pages, contact pages with a sidebar). What am I missing?
Thank you!
You should take a look at the information posted in the WordPress Codex on template files and the like. This image is particularly helpful in getting an understanding for when certain files are used by the WordPress engine to render pages WordPress Template Files Diagram.
You'll find the rest of the information relating to that diagram on this page.
I experienced this issue when using a child theme. I added a new template file to the child theme but the "templates" dropdown did not show on the page options section of any of my pages. I checked and double-checked the formatting of the template file and that was not the issue.
It turns out that my styles.css document in the child theme was not formatted properly and was missing the "template" attribute that designates the parent theme being extended with the child theme. I update the child theme css document to reference the parent template and voila! The template dropdown showed as expected.

Resources