I'm wondering how Wordpress Templates work.
I have WooCommerce installed, and would like to have a page where its loading the product listing, but it seem to be defaulting to using the template file : archive.php. archive.php looks fine, all except the fact that the company logo and navigation bar on the top is missing. I've checked archive.php template file and it seem that the code for the logo is still there. I'm wondering which page the template is defaulting to other than archive.php.
WooCommerce does not use the normal WP archive.php template. In order to customize the WooCommerce archive template you need to:
Make a new folder inside your theme directory called woocommerce.
Add this file to the woocommerce folder: https://raw.githubusercontent.com/woocommerce/woocommerce/master/templates/archive-product.php
You can then customize that new archive-products.php file to meet your needs.
Hope that helps!
Related
I want to modify the template of my blog archive page. I want to modify the template file by following the hierarchy of wordpress files, and not to apply a template manually.
I created a page, then set the blog page in the settings> reading. According to the functioning of the file hierarchy, this should use the file archive.php however it is the file index.php which is loaded. Why ?
My wordpress is blank. I just installed the blank WordPress theme JointsWP.
Thanks in advance.
Vince.
If you check the hierarchy more carefully, blog posts link to the index.php, not the archive.php.
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.
I have my own html to display all products inserted in WooCommerce. But I am unable to show it in my styling. I have searched it but unable to find any good solution.
Please help.
You have to learn about wordpress templates hierarchy that all files how it works?
https://developer.wordpress.org/themes/basics/template-hierarchy/
Suppose You want to create single page of product then create a new file into your theme with name single-product.php then single product url automatically render this file.
As same you want to create shop page (Where all products should shown) then create a file into your theme with name archive-product.php then shop page automatically render this File
For add to Cart functionality there are lots of plugin that can be used.
For additional page in my wordpress website I need a URL XYZ.com/ABC
Where ABC is some page-ABC.php file in themes folder. Or something like that.
I just want to print the independent contents from the theme folder. but within the same theme.
If your create a page in the WP admin with slug (permalink) "abc", you can then create a PHP file in your themes dir called "page-abc.php". Then go to the edit screen for your page, under "Page Attributes" you will find the template field where you can select your new custom template to be used when displaying that page.
Is it possible to create custom checkout page in my theme? I mean to create custom checkout.php document I do not want to edit WooCommerce default theme.
Yes, this is achieved by overriding the WooCommerce checkout.php file in the plugin itself by placing it in your theme's WooCommerce directory. You are right not to want to edit the plugin because any updates will render such changes obsolete. You can see the following files you would want to override here: https://github.com/woothemes/woocommerce/tree/master/templates/checkout
Your directory should look something as follows:
themeroot/
single.php
page.php
etc..
woocommerce/
templates/
checkout/
form-checkout.php
form-billing.php
etc
You can learn more about creating Custom WordPress themes by viewing the document. You will want to duplicate and work of these files to create your custom checkout page.