I have a main custom taxonomy page templates which call "product" it will show all the product in a single page.
But I have lot of sub taxonomies under product wanna show each in different page.
I know I can create as much as taxonomies categories page for each sub category but is there any way I can do it with a single template to fulfill all the looping?
You don't need to create pages for each taxonomy term, you could create a file called taxonomy-{taxonomy}.php in your theme's directory (which {taxonomy} is the name of taxonomy you crated) and it will load for each taxonomy term you create. for more information read Taxonomy Templates docs.
Related
I have woocommerce plugin. I created a custom tag taxonomy under products to pick the product ingredients. ( https://pasteboard.co/J2BlgqI.png ). To show them as buttons on the product page ( https://pasteboard.co/J2Bn7FD.jpg ).
Now I want the visitor when they click on the ingredient it shows them an ingredient page information. So, if they click on “Beeswax” it shows them Beeswax information like name, function and etc…
Each time I click on “Beeswax it directs me to a filter page https://pasteboard.co/J31hg2w.png .
How can I make a page for each ingredient?
Is it even doable this way? or is there another way to accomplish this?
please advice…
thanks
Yes you can have custom templates for your taxonomies. The template hierarchy explains everything.
Custom taxonomies use this template file path:
taxonomy-{taxonomy}-{term}.php – If the taxonomy is sometax, and taxonomy’s term is someterm, WordPress will look for
taxonomy-sometax-someterm.php. In the case of post formats, the
taxonomy is ‘post_format’ and the terms are ‘post-format-{format}.
i.e. taxonomy-post_format-post-format-link.php for the link post
format.
taxonomy-{taxonomy}.php – If the taxonomy were sometax, WordPress would look for taxonomy-sometax.php.
taxonomy.php
archive.php
index.php
Since you haven't created a taxonomy-ingredients.php WordPress uses the next available option and falls back to the generic template.
You can even create a different template (page) for each of your Ingredient by using the first option above.
I have created a custom post type named vehicles and there are different categories for that like trucks, cars, vans etc. I have created a taxonomy named vehicles-categories and now I want to show posts from taxonomy like cars on specific page which will show only posts from that certain category/taxonomy.
I have written WordPress custom loop but it does takes me to index.php page while I want different styles for that cars page.
Can anyone figure out what's am I doing wrong?
You have to create a custom template for your taxonomy to show posts from that specific taxonomy.
In your case if you want to show posts from term "car" then your template name will become taxonomy-vehicles-categories-car.php and WordPress will show posts on this page (you can style and get data according to your needs in this template).
Similarly, you can create taxonomy-vehicles-categories.php page to show posts from this taxonomy and can code this page to show posts as you want.
For further and in-depth understanding about how WordPress uses taxonomy template files visit the official codex page.
I have a custom post type in which you can choose different taxonomies. This taxonomies are listed in the page of single custom post type. When clicking on one of this taxonomy, I would the user to be redirect to a specific taxonomy page that show different informations about that taxonomy.
How can I do that with word press?
I'm using bones framework.
There is no category.php in this framework.. So i found this file:
taxonomy-custom_cat.php
in which is written:
"This is the custom post type taxonomy template. If you edit the custom taxonomy name, you've got to change the name of this template to reflect that name change.
i.e. if your custom taxonomy is called
register_taxonomy( 'shoes',
then your single template should be taxonomy-shoes.php"
I did it but it doesn't work
PS: the taxonomy is called "agenti-biodeteriogeni"
Thank you
Make the copy of your category.php file and name it as your 'customposttype-category(taxonomy-name).php' this will display information of taxonomy like category.
I want two category boxes for my articles. One box for topic-select and the other for project-select.
Do you know a PlugIn?
You want to add custom taxonomies I think.
You can do that either by:
a plugin called More Taxonomies
or
by generating a new taxonomy in functions.php or create a plugin with the new taxonomy code
I am building a site in Wordpress were I have created 1 custom taxonomy named cars.
This taxonomy consists of several posts that work as follows:
if user goes in a page of the above taxonomy a list of cars as images is displayed.
by clicking to a car image he is forwarded to a new page with the list of images containing the specific car-model (brand).
My objective is to create 2 page templates as introduced by the template hierarchy:
taxonomy-cars.php
taxonomy-?.php
The first template will be named taxonomy-cars.php.
My problem is that I don't know how to name the second layer page template.
A taxonomy is composed of terms. I suppose in your case you have the cars taxonomy where the "brands" are one of the possible terms.
From the Template Hierarchy documentation:
taxonomy-{taxonomy}-{term}.php - If the taxonomy were sometax, and taxonomy's term were someterm WordPress would look for taxonomy-sometax-someterm.php.
So, try taxonomy-cars-ford.php.