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

learn more… | top users | synonyms (1)

0
votes
1answer
58 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?
8
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
46 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
262 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
177 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
885 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
643 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
420 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
595 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
351 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
495 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
293 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
89 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
898 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.
4
votes
1answer
1k views

Post/Page Preview Template

Is there a way to have a custom template php file that is only used for previews instead of it using the single.php file? This way the user knows they are in preview mode?
0
votes
1answer
75 views

How can I use Page editor for two separate templates?

On some of my pages (not posts) in my Wordpress site, I need to include a sidebar that display s information relevant to the main content of the page the user is on. I can choose, using Edit Page in ...
0
votes
1answer
286 views

One of my pages uses the archive.php template only. Why?

I created a page and experimented with Custom Templates. Suddenly I noticed that this page started using the archive.php template and no matter which Custom Template I assigned to it, it continues ...
1
vote
2answers
2k views

Using a different template per Custom Taxonomies for single term archive pages

I have 2 custom taxonomies, each with a number of terms: tax1 term1_1 term1_2 tax2 term2_1 term2_2 term2_3 I am trying to have each taxonomy usea different template file for each its ...
2
votes
2answers
808 views

posts page - different lengths of excerpt

is it possible to get wordpress on the posts page to do the following example. the first three posts need to have a large image spanning the width of the title box and a longer excerpt. the rest of ...
1
vote
2answers
257 views

On this day PHP code

I'm working with this code snippet for an "on this day" type post. However it is only showing 1 year in the past. I'm looking to automate this so it shows on this day in 2009, 2010, 2011... and as the ...
1
vote
1answer
551 views

Mass update excerpt

I'm using a photoblog theme which upon creating a new post it takes the post attachment and saves a modified "img src" string into the excerpt field. It then uses <?php the_excerpt(); ?> to ...
0
votes
3answers
302 views

Wordpress -> PHPBB look a like

I want to create an online forum. From my server settings I have two option of smf and phpbb. I hate both of them!. Is there any solution to turn the wordpress to a full blown online forum?
0
votes
1answer
453 views

Tag template not returning posts [closed]

I have the following code which SHOULD print out the title of all posts with the associated tag (in this case the tag is 'icon'): <?php $tagname = get_query_var('tag'); ?> <?php ...
0
votes
2answers
2k views

How does WordPress choose archive type template?

I can't find a comprehensive list of criteria for how WordPress determines which archive type template it chooses. From what I understand it uses URL forms for this purpose, like: ...
-1
votes
1answer
4k views

How did you incorporate WooCommerce in your own WordPress theme?

This has most probably been asked before, but I really need to show WooCommerce products in my template, but I don't know what hooks to add where. It's my first time working with WooCommerce. Can ...
0
votes
1answer
932 views

wp_nav_menu doesn't show on index page

I'm using calls to wp_nav_menu() in my header.php file. They're conditional, based on whether a user is logged in. This is in header.php: <?php if ( is_user_logged_in() ) : wp_nav_menu( ...
0
votes
2answers
136 views

Category Template - Show Last Entry as Featured

I am working on my category template. Here is how I want the page to display: Category Name - this is done The latest post for each category be on top (then styled which I can do). The Category ...
0
votes
1answer
248 views

Set generic reservation form for custom post type

I want to create a simple reservation (reservation.php) form for a custom content type (houses), i have created the reservation.php in the theme directory. The question is: How can i link to this ...
0
votes
1answer
1k views

Use template of parent category for single post sub-categories

I have single post templates in a folder in my child theme marked "single". I need the sub categories to use the same template as their parent. I've read a dozen tutorials all of which were more than ...
1
vote
3answers
405 views

Template for custom post with custom taxonomy

The theme that I'm developing is basically a portfolio, where the projects are custom post type and they are divided in categories (custom taxonomies). Here is how I'm defining both: $labels = array( ...
0
votes
1answer
560 views

Default taxonomy template in plugin, override in theme

Building off of this question/answer, I've sucessfully implemented the single view for my custom post types, but I'd also like to offer the same thing for taxonomies. I've looked through the docs and ...
1
vote
2answers
976 views

display comment form for specific post id

I have three pages, and I want them all to display the comments form from a post with id=343. What code would I use within the pages to make that happen? Here is what I've tried: <?php $id=343; ...
7
votes
5answers
4k views

How to rearrange fields in comment_form()

Im using a custom filter to change the fields, but can´t figure out how to change the order of the fields in the comment form. Desired order: comment field (first/top) name email website This is ...
0
votes
1answer
109 views

How to display a certain template element only for posts published within certain time range?

I recently migrated a blog from sub.domain.com to blogs.domain.com/sub/. Because I'm using Facebook comments, all the posts published before April 25 need to reference sub.domain.com/blog-entry-title ...
2
votes
2answers
1k views

Custom Taxonomy in plugin and template

I have a plugin that I am developing that is using custom post types and taxonomies. My question is this. How can I load the content/theme data from my plugin on to the page when the go to the custom ...
1
vote
1answer
960 views

Passing variables to templates (alternatives to globalizing variables)

I want to make my WP code simpler (there's some mess within header.php, page.php etc.). So, for example, I want to set something like this global: $foo = get_option('foo'); So $foo will work ...
0
votes
2answers
26 views

Archive template limiting to 4 entries?

I have a category called "javascript" and it's limiting my list to only 4 entries? <?php get_header(); ?> <div class="container"> <div class="row"> <div ...
0
votes
1answer
275 views

infinite loop on page with comments after changing comments.php and header.php

I am using version 3.3.1 of wordpress but I'm following a tutorial that used version 2.7. After changing my header.php and comments.php code, I'm getting an infinite loop when I view the single post ...
2
votes
3answers
4k views

Change the name of the 'Default Template'

I am working on a client's site and they need to select a Template whenever they are adding a new page; the "Default Template" is not a valid choice. I would like to rename "Default Template" to ...
4
votes
1answer
482 views

Show only 2nd level of navigation depending on active navigation

For example, suppose a menu like so: Parent 1 Child A Child B Parent 1 Child C Child D Child E Parent 2 Child F In a certain part of my template, I want something to show depending on ...
4
votes
1answer
1k views

I put my blog on a subpage, how do I get page title?

I've got my blog setup on a subpage (not the front page) and I'm using the template file home.php, how can I get the contents from the page editor onto this subpage? If I change the title of the page ...