Within the context of WordPress Theme-ing, the term 'template' refers to PHP files used to display content.

learn more… | top users | synonyms (1)

6
votes
1answer
1k views

How to get IDs for objects in menu branch?

Is it possible to print content of all menu items, when displaying menu (or branch of menu as in question about displaying menu branches) ? Once I click on About Us I wish for new page to display ...
0
votes
2answers
274 views

what is template-name.php

A while back I found that there was a reason to name a template like so template-name.php For the life of me, I can't remember what it was for. I thought it was so that WordPress would automatically ...
0
votes
1answer
418 views

What filter or action hook to use in order to load some code before the template begins printing in BuddyPress? [closed]

I would like to load some code before the template begins printing in BuddyPress. What filter or action hook should I use? I tried a number of them (such as bp_head, bp_include, bp_init), but none of ...
0
votes
1answer
389 views

Create template for taxonomy results limited by Custom Post Type

I've got a Custom Post Type with a Custom Taxonomy set up. So how do I create an archive template to display posts from that CPT, limited by taxonomy? Here's the deal: The CPT is called Shows. Each ...
0
votes
2answers
584 views

Multiple sub directories for theme template pages

I apologize if this questions has already been answered, I have a feeling I'm just not using the right terminology for my search. I'm in the process of building a base theme for my employer. One of ...
0
votes
1answer
565 views

Replace single_template filter with what for default posts?

I was going through a tutorial on Justin Tadlock's blog but it uses the single_template filter, which was removed in 3.4. The codex says to use {$type}_template but if I use "post_template" with the ...
0
votes
2answers
766 views

Blog template PHP [closed]

Here's the WP wordpress website: http://www.joaoalexandre.com/wordpressteste/ And here's the Blog section: http://www.joaoalexandre.com/wordpressteste/artigos/ How can I show a regular simple blog ...
0
votes
1answer
102 views

Display an image of selected template in admin to aid user when using complex templates

Edit: It seems that I have not explained myself very well... I am simply trying to add an image to the page attributes area of the admin area depending on what template is selected, here is a simple ...
-2
votes
1answer
202 views

How to load/include category templates based on conditionals?

I have this lines to get different template, I can get the desired template but also i'm getting the default template at the end of theme. I tried to skip the code with goto but this fuction is ...
1
vote
4answers
4k 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
1k views

Calling a div and content in php?

Is there a code that i can place in the header that will call a certain div and the content i place inside it for every custom post type i have, Somthething like this. <?php if ...
0
votes
4answers
520 views

How to access .html file that's located in the theme folder from the browser?

By default you cannot access a file inside the theme folder directly from the browser, what changes should I make to make an exception?
0
votes
1answer
511 views

Custom post types with categories in template

I´d like to do something like this: Pages: 1. Sport 2. Business 3. Normal Custom Category "Car-Types": 1. Audi 2. BMW 3. VW My custom post type will called "Cars" I´d like to show the cars ...
0
votes
2answers
138 views

Correct process for a new Page Template?

I'm creating a new Page Template. I want to change margins, fonts, font sizes, and things like that. I don't know if I've done things right. Is the following process that I've followed sound?: I ...
0
votes
1answer
2k views

New Template — copy existing template and change code? [duplicate]

Possible Duplicate: Correct process for a new Page Template? I created a page template following these instructions: http://codex.wordpress.org/Pages#Creating_Your_Own_Page_Templates I'm ...
1
vote
1answer
128 views

Archive.php filtered by pre-determined category

My archive.php template is formatted perfectly to list out posts from a certain month and year. However, I only want this template to show from a specific category. I can query for the specific ...
1
vote
0answers
460 views

Wordpress custom taxonomy template not working

I installed theCartPress plugin and it created tcp_product_category taxonomy for tcp_product post type. I created a page with custom template to list all the product categories. I can use ...
2
votes
2answers
521 views

Pagination Issue: Custom Post Type In Index

I'm using a template, which uses Custom Post Type 'movies'. When I try to change the page I got 404 Not Found :( This is my index.php <div id="content"> <?php $temp = $wp_query; $page = ...
0
votes
1answer
184 views

Output Buffer Issue with Single Post View

I created the following function that I am using to load single post views: // Post function basey_single_post() { global $post; ob_start(); echo apply_filters('basey_page_title_news', ...
2
votes
2answers
687 views

How to move style from template file to <head> section?

Imagine the following situation: //header.php contains: <header id="header">logo and navigation</header> //my-template.php contains: <?php get_header(); ?> <style ...
0
votes
1answer
44 views

how to style an individual page in a category [duplicate]

Possible Duplicate: How to show a post single post in page template im trying to understand how to target a template for an individual post. if i use the following hierarchy for my site, ...
1
vote
2answers
338 views

How do I pass data from page content to the underlying PHP template

Pretty much all of the content on the site is going to be dynamically generated (php + db backend) What is the preferred "wordpress way" of passing data to a php template (set up as a template in a ...
0
votes
1answer
588 views

Category Template: Need to display different content on first page of archives

So my issue is that I need to create two versions of a category.php template. Now, I know very well that if I want to display posts from just one category, I duplicate category.php and call it ...
0
votes
1answer
73 views

Problem with permalink structure for Wordpress custom post_type archive template

I have looked at other similar answers to this question but not finding my way. I am using Custom Post Types plugin for a custom post_type called 'product' and has_archive is set to 'true' in the ...
0
votes
2answers
84 views

Putting two themes together to create a complete site

I know my way around WP as probably an intermediate user. In the near future, I will have to integrate the design of a template from a completely different theme into a theme I'm currently using. The ...
-1
votes
2answers
5k views

Custom page template not working

I followed this tutorial for the page specific template -- http://codex.wordpress.org/Pages#Creating_Your_Own_Page_Templates Created a page through wordpress admin panel - Blog Page URL like -- ...
1
vote
1answer
878 views

How do I create a separate page for each author?

I am working on a website where I have authors listed on a custom-made author's page using code adapted from this site: http://bavotasan.com/2011/an-even-better-author-list-in-wordpress/. When you ...
0
votes
1answer
61 views

Where is the /blog/ url set from?

I'm having a weird issue while setting up a site. It almost seems as though the /blog/ url is reserved or already in use, only it isn't as far as I can tell. I setup a new page called 'Blog' and set ...
8
votes
2answers
1k views

What's the purpose of the paged.php file?

In context of the template hierarchy chart? From what i gather, the paged.php file is something to do with an archive?
9
votes
2answers
2k views

Looking for WordPress System Diagrams

I am looking for WordPress chart/diagram system design. I found only the template hierarchy diagram, but it's only part of the system. source: ...
0
votes
1answer
48 views

Strange Behavior of Page Template Dropdown

My wordpress is updated to latest version 3.4.1 and I noticed a strange function of it - in the Page attributes block page template dropdown has the value: ...
0
votes
1answer
266 views

templates with page teasers Or Featured Items

I've been given a design for a WordPress site which will be mostly made up of pages rather than posts. However, at the top of each page there needs to be three featured items in a row. Each featured ...
1
vote
2answers
178 views

Templates have disappeared from drop down lists

I think this happened when I upgraded to 3.4, or it might have happened more recently. The template drop down list is now missing most of my templates. Pages that were using the templates are still ...
3
votes
2answers
931 views

How to Rename a Template File?

If i have pages that point to somefilename.php and want to change the filename to betterfilename.php, can I leave the template comments unchanged without manually changing all the pages? /* Template ...
0
votes
1answer
88 views

WordPress Template works until page becomes a child

Ok so this is really strange. I do not consider myself a WordPress expert, but I am also not a beginner either. I created a template that works just the way I need it. Basically it checks for the ...
2
votes
1answer
645 views

How to set a fall back template for a custom post type in a plugin?

My custom plugin creates a custom post type, and I want to theme my own "single-my_custom_cpt.php" file. However, I want to store it in my plugin folder, and allow that it be over-written in the ...
8
votes
1answer
7k views

How does printf( __( ) ); work?

Today I work through a theme to get a better understanding of WordPress and templating. I discovered this: <?php printf( __('Designed by %s', 'Anyword'), '<a ...
0
votes
1answer
128 views

If Child or Grandchild of Page

I'm serving a different header in Wordpress depending what section you are within the site, 'residential' , 'business' or other by using the following code. Although i need to extend it to work with ...
0
votes
2answers
429 views

Include different loop templates in search query

I have differnet Custom Post Types in my blog. I also have custom templates for each of them like loop-{$cpt-name}.php I would like to include different cpt templates dynamically in search results ...
3
votes
1answer
3k views

Template issues getting ajax search results

I'm trying to put search results into a div with ajax. The issue is I'm getting errors saying undefined function have_posts() when the the search template is accessed. It also took issue with ...
0
votes
3answers
599 views

Custom Post Type Archive Template

I have similar problem to this one: Custom Post Type Template - Archive I have a WordPress custom post type called coupon. I try to assign the template to it by using archive-coupon.php, but it goes ...
1
vote
1answer
75 views

Custom Page Template for “Older Posts” Pages

My home page feed has a variety of items including a featured post and other features that I'd only like present on the home feed. When a user clicks on pagination to load older posts, I'd like to ...
2
votes
2answers
355 views

Load different template file when condition met?

If I visit a page on my WordPress site, WP goes and determines what template file it should use based on the template hierarchy. If I'm doing some logic checking in the hook init and say my ...
3
votes
1answer
2k views

Is it possible to define a template for a custom post type within a plugin independent of the active theme?

I'm writing a plugin to manage data about open-source projects. I developed an object model and have successfully created all custom post types and taxonomies, as well as implemented the correct ...
0
votes
2answers
58 views

Naming custom page templates

I'm putting together a site that will be comprised, mostly, of static pages with some dynamic content as well as a blog page. In terms of naming files, what would be the best way to achieve this? My ...
0
votes
2answers
1k views

add_rewrite_rule and template redirect not working

I have the following pairs: add_rewrite_rule('^questions/ask/?','index.php?pagename=ask','top'); if(is_page('ask')){ $tname = 'add-question.php'; ...
0
votes
1answer
504 views

Template redirect is_tax() not working

I'm trying to do a template redirect in my wordpress but with partial success function ahaali_qa_theme_redirect(){ global $wp; $plugindir = dirname(__FILE__); if(is_archive()){ ...
0
votes
1answer
294 views

Show page title just from the first child-page in template

how can I do this: Pages: Home - sub-1 -- sub-sub-1 --- sub-sub-sub-1 On home-page should only show the page-title of the first child-page like: sub-1 I found this: <?php $child_pages = ...
2
votes
1answer
90 views

Strange Behaviour with is_home()

I'm having an odd issue, although I can understand why it works like this I do need to find a way around it. I have used the the request filter to modify the query for the home/index page to select ...
-1
votes
3answers
926 views

Different header for each category

I'm working on a project where each category should have a custom header page. Any suggestions? I'm just looking for some direction on how to accomplish this.