How to create subpages for taxonomy term page in wordpress? - wordpress

I have created a custom taxonomy and what the term page will look like.
domain.com/taxonomy/term
But for each taxonomy term, I have included various custom fields and included content. The content is large and I want to display them in subpages with individual link clicks. I want to display them in subpages.
For eg:
domain.com/taxonomy/term/meta-data-1
domain.com/taxonomy/term/meta-data-2
How can I create this?
I am using Genesis Framework

I'm assuming you have some knowledge in php and Wordpress theming.
You could create/add a custom-subterm then create a specific template for that custom-subterm called taxonomy-custom-subterm.php.
Inside you could display all relevant informations/metadata to the custom-term.
If your custom-taxonomy is set to hierachical (which is the default behaviour I believe), then the url should be /custom-taxonomy/custom-term/custom-subterm/.
Graphical representation
domain.com/
L custom-taxonomy/
L custom-term/ (using taxonomy.php OR taxonomy-custom-term.php as template)
L custom-subterm/ (using taxonomy-custom-subterm.php as template)
This is based around the default Wordpress hierarchy.
Learn more # https://developer.wordpress.org/themes/basics/template-hierarchy/.
And # https://developer.wordpress.org/files/2014/10/Screenshot-2019-01-23-00.20.04.png

Related

Wordpress: How can I use a category template if I remove the "/category/..." from the URL?

I want my URLs to not use "/category/..." to get to the category. So instead of
site.com/category/news
I want
site.com/news
I'm able to achieve this with a setting via the Yoast SEO plugin.
But I also have different presentations for certain categories, so I've created custom templates. The Wordpress template hierarchy will use a custom template for a category if it's named "category-[slug].php"
So, I have a category-news.php template that works as expected, but ONLY if the URL still contains "/category/..."
Is there a way to use my custom category template and still have "/category/..." removed from the URL?

Add taxonomy terms list to homepage Drupal 8

Please help me to add taxonomy terms from custom taxonomy into home page. I have no idea how to do this as I'm coming from WordPress. In WordPress it is easy as calling get_terms(). I have following file as my home page: mytheme/templates/page--front.html.twig
I have more than one taxonomy type and all of them are going to queried in the home page.
How to query the taxonomy terms?
UPDATE:
I have created a new region called home_content in my theme.info.yml and I have created a view(block) for getting the taxonomy terms, added it to region in back-end and display it as {{page.home_content}}. It works but I have few questions.
I have fields for logo and text in the taxonomy. I want to list them too.
I need to customize the html. How can I do that?
Thanks for the support.
You don't really need to code anything
Create view with taxonomy terms required. Structure > Views > Create New View and add block view for taxonomy terms. User filter section to select specific terms or dictionaries. Save the view.
Go to Structure > Block Layout and insert block with your view into desired region. In visibility section, pages tab: type <front> in pages and select Show for the listed pages in order to display it on home page only.
Above steps will display your required terms on home page.
To copy and modify template(s) in your theme, follow the instructions on drupal.org: https://www.drupal.org/node/2358785

Drupal 6 custom page templates fighting each other

I have a page template: page-lcds.tpl.php which works for the www.xxx.com/lcds page.
But, it also gets used for /lcds/2-4in and /lcds/5-10in and etc.
So I could create a page-lcds-2-4in.tpl.php but then I'd have to create all the others for each category.
All of these pages are actual custom Pages content-type.
Is there a better way/place to specify a page template just for "page-lcds" and then use the regular page.tpl.php file for all other lcds/*?
I think, you should treat LCD as category instead of content type.
So, create a vocabulary called "Product type" & add "LCD","LED" terms to it.
Now, you can do category theming under page-taxonomy-term.tpl.php
and node theming under page-node-<custom-content-type>.tpl.php

Naming a template of custom taxonomy

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.

Display a Drupal page without the page template

Hello I am trying to generate a Drupal node which would be similar to a feed page generated by views module. I need to generate an xml feed, so I would not want to show the regular drupal template that is showed up on every node. I am trying to understand how the views for feed works as I want to display my page in a similar fashion, without the drupal template. Any suggestions would be great.
In Drupal you can theme any individual page to be completely different than the default template. So, if you have a node, let's say the url is "node/14", you can create a new template file called "page-node-14.tpl.php" in your theme folder. In this template you can add any html/xml markup you need. Also, for that specific node you should also create a "node-14.tpl.php" to theme that node's content.
If you want to display more nodes on a page, something like "taxonomy/term/3" (here you can find all nodes tagged with the term with the ID 3), you have to create a "page-taxonomy-term-3.tpl.php" template in your theme folder. To theme every node from one particular content type, you should create a "node-news.tpl.php" (this is for news node types) in your theme folder.
Please keep in mind that these template suggestions are for Drupal 6. In Drupal 7, the template name changed from "node-news.tpl.php" to "node--news.tpl.php"

Resources