"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
20 views

Page Templates Used in Custom Post Type

The same question was asked here with no real response. They claim it's not possible but I have used plugins that accomplish this. In WordPress I am having a problem figuring out how to use the ...
0
votes
1answer
9 views

Show a custom template, no matter the page being viewed, if the user is not logged in

I have been tasked with creating a WordPress site where subscriberes (registered by an admin) are unaware of the back-end. I also have to make it so that upon navigation to any page, if the user is ...
1
vote
1answer
69 views

Is there a way to set different post templates for parent posts and child posts in the same post type?

After taking a look through the questions suggested to possibly have my answer, I still can not seem to find something that I references the post-template php files. I have two custom post types that ...
1
vote
0answers
58 views

WordPress Filtering Custom Post Type by Metadata and Search Heirachy

I have a custom Post Type called cptMovie which has two Custom Field (Metadata) "Language" and "Box office" assigned to it. I also have a Custom Taxonomy called movieTax with 4 tax Terms "Action", ...
0
votes
1answer
45 views

LOST in WP Template Hireachy

I am trying to create a Custom Theme which is supposed to list and dialysis Custom Post Types First Base on Taxonomy and In next page List and Display Them based on Taxonomy Term which linked from the ...
0
votes
1answer
23 views

Needed to change slug to access page

I've created a page, with the slug "news". Something happened because now I can't access /news .. I needed to change the slug to "news_", or something, to access that page. I checked the database to ...
0
votes
1answer
54 views

Displaying a custom post type and an archive page

I have created a custom post type called articles that will display an article each month. This custom post is hierarchical (which means it will also have children posts related to that monthly ...
0
votes
2answers
271 views

Custom Post Type with Nested Taxonomy and Template Files

I have a custom Post Type of "Portfolio" with a rewrite slug of portfolio. So the URL on the frontend is: domain.com/portfolio. I have a custom Taxonomy of "Categories" with a rewrite slug of ...
1
vote
2answers
116 views

Template for specific post of custom post type

I have the CPT "event". I have created single-event.php. I want one particular event to use a different template than single-event. I read elsewhere that this could be done by creating a ...
0
votes
3answers
111 views

Use one template only for custom post type archives?

I'm currently using archive.php as a generic listing for categories, tags, authors, etc. However, my custom post types have a very customized archive page that's completely different from archive.php. ...
0
votes
1answer
135 views

Getting custom taxonomy posts on archive page

Hi I am not sure if the question is understandable or not but what I am trying to achieve I will explain. I have a custom post type called menu item and custom taxonomy called menu item type. CODE ...
1
vote
4answers
96 views

Create static front-page with 3-5 recent posts

I am struggling with front/landing page customization for my custom designed theme. I have designed custom theme and pretty much coded it using the Underscore boilerplate. As I understands, the ...
0
votes
0answers
130 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
73 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
106 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
41 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
72 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
55 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
156 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
24 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
210 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
253 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 ...
11
votes
2answers
2k 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
719 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
36 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
94 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
147 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
103 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
110 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
485 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
479 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, ...
1
vote
2answers
612 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 ...
1
vote
2answers
370 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
144 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
33 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
51 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
288 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
154 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
147 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
145 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
818 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
2k 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
587 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
186 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
4k 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
200 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
102 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
47 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
23 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
3k 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, ...