Why wp blog archive page, use index template? - wordpress

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.

Related

How to add custom php file in wordpress theme

I just create a custom theme for WordPress and this is my directory.
theme/
-index.php
-header.php
-footer.php
-terms.php
Now I want to make in index.php file have like
Terms
but this doesn't work.
How can I make this when the user clicks terms to redirect him on terms.php file?
actually you should create a Page in your admin menu for Terms and then link what what you want to that Page you created.
but before that I think you should learn more about wordpress and how it manage files and templates.

archive.php looks different from template

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!

How to locate file of wordpress page

I am a real newbie with wordpress. I need to quickly find out the filename for a particular url.
Let's say my URL is
http://example.co.uk/account/membership-levels/
Where will the .php or .html file most likely be? In themes folder?
w
Thanks for your help.
Wordpress doesn't have a 1:1 relation between content and templates. On some minimalist themes you could have a single php template in your themes folder (wp-content/themes/themename/single.php) to display all your articles.
Depending on your permalink structure, that link you are asking about is probably rendered using the page.php template, and if it isn't, then single.php should be the one. The only reason for editing a template is when you need to change the structure of all your posts. If you only need to edit one particular post or page, then you should just edit the content.
To edit the content, you need to log into your dashboard (wp-admin) and look for that entry among the pages or posts section.
Many themes will show an edit icon next to the posts title if you read it while logged on your dashboard, so you can skip searching for it in the backend.

Proper setup of custom theme for single page website + separate blog page

I am creating my first WordPress theme with a one-page parallax scrolling style.
I have created my entire website (statically) in the index.php file. It works fine if I set the Admin->Reading setting to 'Your Latest Posts'.
But now I am trying to create a separate page for the blog so I did the following:
I created a file, page.php, with the standard blog page code and gave it a template name.
I set the Blog page on wordpress to use the Blog template.
All other pages (i.e. home, about us, etc.) are set to use default
page template (which should be index.php right?)
I set the Reading settings to Front Page: Home and Posts Page: Blog
All I get is the blog page template for all pages (as if it were the default page template).
How to set up a website like this?
index.php should really be your blog template not your static home page. Make a copy of page.php to page-home.php (or whatever you've named your front page), then put the static content in there. You probably won't even need to assign the template to the page - WordPress will do that automatically based on the file name.
By default, page.php is used for all static pages, index.php is used for whatever you've assigned as your blog page in the "Reading" section of the dashboard. index.php is also the template of last resort, which will be used if WordPress can't find any other appropriate template files.

Woocommerce location of checkout template

I'm trying to edit the checkout page, but can't find the template. What's the location inside plugin, of the file that has checkout fields?
There are several php files that make up the checkout page.
wp-content/plugins/woocommerce/templates/checkout/
cart-errors.php
form-billing.php
form-checkout.php
form-coupon.php
form-login.php
form-pay.php
form-shipping.php
review-order.php
thankyou.php
wp-content/plugins/woocommerce/templates/checkout/form-checkout.php is the main file.
[Template Structure from Woo Commerce Docs][1]
http://wcdocs.woothemes.com/codex/template-structure/
https://docs.woothemes.com/document/template-structure/
It's recommended that you copy the template folder It's recommended to copy over the template folder with the files you wish to change from the woocommerce plugin directory. Put it at the root of your theme and rename it to woocommerce (leaving the template folder intact in the plugin directory to allow for upgrading).
Be careful of your cart template which is by default the page.php template from your general theme.
You can change the cart layout by changing the page.php, or go to your WordPress cart page, edit and change the template for an other one.
Hope it helps, I just wasted 2h searching that.
There are a set of several templates that control the checkout page. They can be found in the WooCommerce plugin folder in templates/checkout.
You can put a woocommerce/templates/checkout folder inside your theme's folder and copy the templates you want to alter into it. Those will override the normal templates without altering the plugin itself. That way your changes won't get overwritten when WooCommerce is updated.
Note: I don't suggest to direct edit on plugin file because if by mistake you updated than you will lost all changes. so first copy /woocommerce/templates/ directory to your theme directory inside /theme/woocommerce/ and
Then you should edit files in theme/woocommerce/checkout/
Refer more: https://docs.woocommerce.com/document/template-structure/

Resources