"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
3answers
43 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
24 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
46 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
98 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
43 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
25 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
252 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
51 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
73 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
77 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
43 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
22 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
38 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
142 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
98 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
96 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
75 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
241 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
814 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
194 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
116 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
1k 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
101 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
87 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
107 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
56 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
317 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
930 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
372 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
230 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
69 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
89 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
63 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
128 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
122 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
111 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. ...
2
votes
2answers
92 views

Categories Template Assistance

I have found a tutorial online for creating a custom categories template for my archived posts within a particular category. This however is targetting a specific category ID (see below), is there ...
0
votes
1answer
669 views

How to modify/ customise NextGen Gallery's templates?

I would like to customise the "Image browser" template in particular. I'm trying to make clicking on an image redirects to the next image in a gallery, just like how Facebook image browser works. ...
4
votes
1answer
523 views

How to use a specific category archive index as the site front page?

I investigated Wordpress hierarchy and have created a php file called category-image-gallery.php the link to this is http://www.phoneographer.org/category/image-gallery/ having uploaded it and added ...
0
votes
1answer
100 views

How can I sort posts ascending by post title for a specific post type, but on a category archive template?

How can I sort posts ascending by post title for a specific post type, but on a category archive template? My schema involves a "video" custom post type and multiple subcategories of the ...
0
votes
1answer
721 views

Custom post type not using it's own single-postname.php

I have a custom post type (that I'm using on a template page), the custom post type is called 'headerhome'. When I post say a gallery there I'm trying to get it to redirect to 'single-headerhome.php', ...
2
votes
2answers
678 views

Different templates for parent and children categories/taxonomies

I would like to know what is the best way to create a different template for parent and children categories and/or taxonomies. Example: I have a taxonomy called region, which I want to divide in ...
0
votes
1answer
120 views

404 on child page template

I have a page called portfolio and I have created several child pages for it like Video page, audio page etc … I also created custom page template for portfolio and named its file ...
0
votes
1answer
348 views

Help Understanding Template Hierarchy

I must be thick, but I could use some help grasping the way template files are chosen to be used. I noticed loop.php is no longer around, and looking at the file structure for twentytwelve there is ...
0
votes
1answer
120 views

Wordpress Page Hierarchy

I have the following page on a site in development: http://telamon.com.s137737.gridserver.com/media/press/ I want to do some stuff outside the loop, so I created page-press.php based on my ...
1
vote
4answers
2k views

Wordpress not respecting template hierarchy (fetches index.php instead of single.php or page.php)

I've encountered a strange error while developing a custom theme. After finishing editing the template for a custom post type single view, I passed onto working at the template files for pages and I ...
0
votes
1answer
268 views

Custom post types templates

I have registered a custom post type called "Services" but when I am giving the single post the template "single-services.php" its not accepting this but choosing the "homepage.php" template can u ...