"Template hierarchy" describes process by which WordPress determines which theme files to use when displaying a query. Index.php is the fallback for all queries, and, theoretically, the only theme file required other than style.css.

learn more… | top users | synonyms

0
votes
0answers
16 views

How to display Parent categories and Child Categories?

I struggleing to find the best way to develop the below. Basically my website will have a landing page on the site (Sports Landing Page) and when the user clicks on a category on that page eg ...
0
votes
0answers
23 views

Wordpress Page doesn't load the template selected

I've created a new page called Work and I've added it on the navigation bar; after that I've created a file called work.php in which I want to style the page mentioned above. The problem is that the ...
0
votes
1answer
15 views

localizing variable on front-page.php template fails but succeeds on single page and taxonomy archive

I have the following code in a php include file: function pass_the_var() { $video_embed_code = jkaw_oembed_code(); return array( 'embedCode' => $video_embed_code ); } ...
0
votes
0answers
35 views

Most efficient way to have 1 template for parent, 1 template for child categories?

This is the setup I want: For category-15.php: Child Category A (list of all posts inside) Post A from Child Category A Post B from Child Category A Post C from Child Category A ...
0
votes
1answer
26 views

Loading custom page template on a one page website

For a one page website, I have modified the homepage to index all pages instead of posts. For some of the pages I want to create a custom template (like page-slug.php). But, these template only get ...
0
votes
0answers
49 views

How to display custom taxonomy

I have created city taxonomy in back end and i have added mumbai,pune,nashik city in city taxonomy like bellow snipe. My problem is that when i click the city for example mumbai i want display the ...
0
votes
0answers
38 views

Passing query variables to a custom page template

On my website I have a custom post type called 'theme'. I wanted the homepage to display an archive of themes. For this the only approach that I could think of was to create a page template with a ...
0
votes
0answers
19 views

WP Template Hierarchy - Need help choosing the correct templates

Please see this image to get a better understanding of what I would like to achieve. Please pay attention to point #3 and #4 (notice the permalink structure). The "Homepage" is static ...
0
votes
2answers
57 views

How to make child categories recognize parent's template displays

I'm using the Default Post Type post for various purposes. To sort them I'm using different categories. And I'm designing different category layout using the slug preference, like: category-book.php, ...
0
votes
2answers
95 views

Use meta boxes inside an archive page template for Woocommerce

I'm creating my own Wordpress theme, and I'm trying to make it compatible with Woocommerce. I understand pretty much everything about theming woocommerce, including copying the template files and ...
10
votes
2answers
449 views

How to create custom 401, 403 and 500 error pages?

When a 404 error is encountered, a 404.php template file can be used to render a custom error message. This is documented in the Template Hierarchy article. My aim is to create custom error pages ...
0
votes
3answers
338 views

How can I conditionally show different home page templates based on whether or not the user is logged in?

How can I conditionally load HTML for the home page based on whether or not the user is logged in? Currently my theme has an index.php file. In that file I tried to create: <?php ...
0
votes
0answers
32 views

Template for Custom Post Type and its Category

I have created a custom post-type ( Testimonials ) and i have custom taxonomies for this post-type to separate the testimonials. Custom Testimonial Taxonomies are 1) Commercial 2) Residential Now, i ...
0
votes
1answer
71 views

page_template toggle between 2 templates + 2 permalinks for same post

I'm trying to use this page_template template from the WP forums, with the same aim as the original author: I am trying to use two separate permalinks/templates for a single post - each ...
1
vote
1answer
116 views

Single page template for custom post_type

I registered a custom post type with the following code: #Register custom post type for Stars of the Month add_action( 'init', 'sdp_create_star_type' ); function sdp_create_star_type() { ...
0
votes
1answer
86 views

URL Rewrite Adjustment for Custom Post Type causes template to revert to index.php

I have a custom post type with a URL permalink rewrite that seems to work if it uses /mynews/stories/YYYY/mm/story-name but if I change "mm" to the first 3 letters of the month (eg Jan, Feb, Mar, ...
0
votes
0answers
62 views

wp uses index.php instead taxonomy.php

I have created taxonomy AUTO with terms and rewrite rules - add_rewrite_rule("^auto/?$", "index.php?taxonomy=auto", "top") add_rewrite_rule("auto/([^/]+/?)$", ...
0
votes
0answers
404 views

Redirect all page templates to index.php and turning Wordpress into a Single Page Application CMS

I’m trying to push the boundaries of Wordpress by turning it into a SPA CMS. Everything works fine until now except for a redirection issue. github angularpresstheme How it works: When I create a ...
0
votes
0answers
175 views

Custom post type category page not working

I have a custom post type called 'emp_case-studies'. Archive and Hierarchical are set to true. My archive-emp_case-studies.php and single-emp_case-studies.php are performing as expected. However, ...
0
votes
2answers
298 views

Load parent theme files before child theme functions.php

I am creating a theme framework to use in future wordpress themes that I develop. I would like to include dependant files such as classes inside the parent theme before the child theme functions.php ...
0
votes
2answers
179 views

Template Hierarchy for get_header()

I'm considering having different headers depending on the area of the site. So thought it might be possible to tap into the template hierarchy (or at the very least, re-use some of the code) and ...
0
votes
2answers
88 views

Taxonomy landing pages

I like to create a landing page for my custom taxonomies. Right now ive created three custom taxonomies /country/[terms] /person/[terms] /interrests/[terms] i like to create a listing page for ...
0
votes
1answer
25 views

Custom Taxonomy Template Variables Available?

I have a custom Taxonomy sports and want to edit the front-end display. I have got taxonomy-sports.php and used this code to get the data on the taxonomy, but I feel like it should already be ...
0
votes
1answer
44 views

Archive-custome_post.php template not working

I have a site on WordPress 3.6.1 and I created a custom post type for recipes with the code: add_action( 'init', 'register_cpt_my_recipes' ); function register_cpt_my_recipes() { $args = ...
0
votes
1answer
202 views

how to access the $query variable inside taxonomy-xxx.php template file?

In my custom template files, I create query in the following way: <?php $query = new WP_Query(array('post_type' => 'aya-bi-aya','author' => $current_user->ID,'paged' => $paged, ...
0
votes
1answer
125 views

Help splitting a custom post type archive into “past” and “upcoming”

I'm working on a wordpress site that keeps track of a series of event posts (custom post type), and I'd like to split up my archive-event.php page into two sections – "upcoming events" and "past ...
0
votes
3answers
116 views

List a custom taxonomy's terms, with links, on the taxonomy page

I have registered a custom post type in my functions.php file for "Wines", with this code: function customposttype_wines() { $labels = array( 'name' => 'Wines', ...
1
vote
1answer
103 views

How to make use of WP templates within a nested site structure?

I am working on a site that highlights neighborhoods. Within each neighborhood there are places (that will be added by the client on the back end). Each neighborhood will have its own unique set of ...
0
votes
1answer
489 views

Custom Taxonomy term archive template

Is it possible to have separate archive templates for custom taxonomies? Like this: Tax(categories) -Players(category) -Managers(category)
0
votes
3answers
1k views

WordPress Ignoring My Custom Post Type Templates?

WordPress is 404ing all of my Custom Post Type posts. Have I missed a step here? I’m using the following to set up my CPT: function custom_post_types() { register_post_type( 'creativework', ...
0
votes
2answers
398 views

index.php template is used instead of blog page

I am trying to set WordPress so that home page is static, and the blog page is a separate page. So, I created two page templates in my theme., lets call them home_template and blog_template. Then, I ...
0
votes
2answers
147 views

Use different template than author.php for get_author_posts_url()

I have a client that wants two pages for each author profile: First Page - has user info, bunch of social media links, etc. Using author.php for this. Second Page - list of author posts I've built ...
1
vote
3answers
2k views

Template Hierarchy: confused with index.php, front-page.php, home.php

I'm really confused with index.php, home.php and front-page.php. In many cases even though I had an index.php, I overwrite it with front-page.php. But recently, I became aware about home.php. What's ...
1
vote
1answer
136 views

is_archive() content being shown instead of is_category()

My Issue: If I browse to http://mysite/category/mycategory, the if (is_category()) content isn't displayed, the if(is_archive()) is shown instead. My code: archive.php: <?php ...
-1
votes
1answer
96 views

Custom taxonomy meta fields

I'm trying to make an anime site like myanimelist.net but in spanish with links of the episodes at the bottom. I created a post type called anime, and some custom taxonomies associated with it: ...
0
votes
1answer
46 views

WordPress doesn't respect the template hierarchy?

My theme has a custom taxonomy template ("taxonomy-authors.php") but WordPress only serves this template file when a term associated with this taxonomy is called. e.g. example.com/cpt/authors/john-doe ...
0
votes
1answer
20 views

How to link to the page displayed by home.php?

I am working on a theme that is using front-page.php as a front-page.php and home.php to show blog posts. What I can't figure out is how to link to the blog page that is displayed with home.php. ...
0
votes
1answer
2k views

the_excerpt() in content.php and get_template_part() in single.php

everybody. So I'm creating a blog theme and have put the_excerpt() in content.php My index.php displays different post excerpts for the different kind of posts-formats. I have content-gallery.php, ...
0
votes
2answers
155 views

Override Taxonomy Template

I'm trying to list all the products tied to a specific taxonomy. For some reason the template won't work when trying to access "http://www.myexample.com/product_categories/funiture/", I tried ...
0
votes
1answer
62 views

How to define the template priority between built-in categories and custom taxonomies?

Let's say I want to create a custom template for my taxonomy customtax. This is pretty simple, I just create a taxonomy-customtax.php in my theme directory. Now, I'ld like to query a built-in ...
5
votes
1answer
360 views

CPT Template Not Showing - Getting 404

I'm developing a Custom Post Type plugin, which works fine in dev. Now that I've moved it to production, I'm getting a 404 when I try to display the template for the CPT. So, two questions: 1- Is ...
3
votes
2answers
1k views

Custom Post Type Plugin: Where Do I Put The Template?

I'm writing a custom post type plugin. Part of it I'm outputting to the template via shortcodes. But other parts need a custom post template, and I figured out how to use the template hierarchy for ...
0
votes
1answer
400 views

loading custom registration template

I read this tutorial, here the author names the template custom-register.php and puts it in the theme dir and doesn't explain about how it's loaded by WP, I did the same way but the file didn't loaded ...
0
votes
0answers
248 views

Posts 2 Posts: Pagination for connected posts on single post template

I'm using Posts 2 Posts with The Events Calendar plugin. I've made a connection for events and posts. This way the site can display the Event details and blog posts about the upcoming event under it. ...
0
votes
1answer
72 views

Using index.php as page template

When you put a name at the top of your index.php like: <?php /* Template Name: Blog Template */ ?> it will work for front-page and it will also create a new page template. I'm wondering if ...
0
votes
1answer
140 views

Archive for custom fields?

Recently I've done a nice taxonomy system on my WordPress website. Created also the taxonomy archive template files, so wherever I'm listing the taxonomies I can click on them and will bring me on a ...
1
vote
1answer
75 views

What should I put on my index.php?

I had covered basically all the pages listed in the Template Hierarchy: 404_template archive_template author_template category_template tag_template taxonomy_template home_template ...
0
votes
1answer
134 views

Overwriting TwentyTwelve template file with child theme template, but lower in the hierarchy

I've (I think) an interesting problem here. What I want to do is create a global archive page, with everything on it. Dates, authors, categories etc all on one page. I have a child theme, with ...
1
vote
1answer
133 views

is_home() returns TRUE on page template

I'm wondering why my link: http://localhost/?page_id=3433 returns TRUE on is_home() usage: if(is_home()){ var_dump(is_home()); die('test'); ...
0
votes
2answers
123 views

Organize template parts and page templates in folders in regards of template hierarchy

Hello and happy new year Suppose one has a large theme composed of several post types, page templates and a bunch of custom loops and template parts which is best keeping in separate php files. ...