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

learn more… | top users | synonyms (1)

2
votes
4answers
2k views

Change page template programmatically ?

I have two page templates and Qtranslate installed. I want to choose one or another depending the language selected. Can I do something like this ? if($q_config['lang'] == 'en'){ // load ...
1
vote
1answer
842 views

Problem getting single_template filter to work - I want to serve a different single.php file for posts in a certain category

I am trying to customize the behavior of my blog to serve a specific single post template based on the category the post is assigned to. I came across this filter in my parent theme which is what ...
0
votes
1answer
450 views

Function to allow single post template based on custom taxonomy?

I'm trying to use Justin Tadlocks function for category specific custom post templates, but have become stuck when trying with a custom taxonomy, as his examples only have normal categories. Can this ...
1
vote
1answer
654 views

Query post for 'selected category' in archive.php

I'm trying to figure out how to display a 'featured post' on a selected category archive. My website uses the category-based navigation for different types of posts (text only post-blog, and image ...
4
votes
1answer
2k views

wp_get_attachment_image returns different image size

It is a bug? wp_get_attachment_image( $attachment_id, 'post-thumb-size-small'); Same code, called in template, and in AJAX call returns same image SRC, but different image width and height. dumb ...
0
votes
1answer
35 views

Need help with my template [closed]

I have this site here http://spillersmart.dk where it currently shows 3 videos in a row. I want it to show 5 videos instead, but can't figure out where in the code to change that. I've looked into the ...
0
votes
1answer
638 views

How to sort a loop after most viewed

I have a site and i'm almost done with it. It have teached me a lot about wordpress, although i'm still a noob who doesn't know anything about php or programming (besides html). I have managed to ...
0
votes
2answers
207 views

Showing latest post without 301 redirect

My WordPress website is now redirected to latest post by adding below function to function.php add_action( 'template_redirect', 'redirect' ); function redirect() { $args = array( ...
13
votes
5answers
6k views

single-{$post_type}-{slug}.php for custom post types

My favorite part of the Wordpress template hierarchy is the ability to quickly create template files for pages by slug, without having to edit the page in Wordpress to select a template. We can ...
0
votes
1answer
354 views

Specifying Default Template for Hierarchal Custom Post Type [duplicate]

Possible Duplicate: single-{$post_type}-{slug}.php for custom post types I have registered a Custom Post Type named conference with the attribute: 'hierarchical' => true In the ...
0
votes
1answer
48 views

wordpress template page Usage [duplicate]

Possible Duplicate: Loading template files from a subfolder in my theme? How to create template page which is in a separate folder within theme directory, for pages and also to open it in ...
1
vote
1answer
27 views

Is there a way I can put my post templates in a separate folder?

I have some custom post/page template files I would like to keep better organized by placing them into a folder inside my themes directory. Is this possible, or would I need a line of code in my ...
0
votes
1answer
1k views

Translate custom template with WPML

I have custom template that is used by ClassiPress and it is working fine on default language, but when I enter the page language selector won't work since it's not translated. How can I translate ...
1
vote
2answers
1k views

I need template for my custom taxonomy term

I created a custom taxonomy slug is 'event_type' and created terms like social, educational and religious. I want to have template page where I can show posts related to these terms. you can say I ...
0
votes
1answer
262 views

Getting pages filtered by template assigned

I want to retrieve pages with determinate template assigned. Function get_pages() hasn´t any parameter to select by template. For exmaple if I created three pages: Home, Page 1 and Portfolio. After I ...
0
votes
2answers
44 views

Custom /Page/2/ Template Only

Is there a method of doing this? Can I use PHP to say if(URL=page/2/) { } or something like that within my template? Essentially, I want an ad to appear in my sidebar when a user clicks 'Older ...
2
votes
1answer
328 views

Sharing templates with the JSON API?

Is there any way to share 'templates' between JS and Wordpress? For instance, this sort of modest seat-of-the-pants templating feels ok: var AJAXSuccessFunc = function(data){ // calling this on ...
0
votes
5answers
1k views

Possible to have one template call different sidebars for different pages?

I just learned (with help from Rob Vermeer!) how to use one template and be able to call different top graphics depending on the page and now I want to know if the following is possible: I'm using ...
0
votes
2answers
347 views

How to remove the tripadvisor logo from the wordpress theme?

Tripadvisor offers a free wordpress theme at here If you go on this page, you'll see the free wordpress theme, and on the navigation bar, there is the trip advisor logo on the right, How can I remove ...
0
votes
2answers
33 views

Way to use one template but be able to call different top graphics?

On a site I'm designing (business site versus blog - static homepage, etc.) for a client I have 7 different top -level product/service pages which have the same layout except for a graphic that ...
0
votes
1answer
575 views

Creating new templates in child themes breaks layout

I am learning how to create new templates in WP. I am using a child theme of Twenty Eleven. My problem is that whenever I create a new template the layout breaks. For debugging I stopped using any ...
1
vote
2answers
1k views

Wordpress ignoring specified template for front page. Why?

I'm using the Roots theme which with custom css. I'm using the page "Home" as the front page the page "Blog" as the blog page (in WP reading settings) I'm trying to set the front page "Home" to use ...
0
votes
1answer
100 views

How does wordpress link page templates to individual pages

According to the Codex docs, wordpress uses the query string and the template hierarchy to determine which template to use for a certain page. First, WordPress matches every Query String to query ...
0
votes
1answer
354 views

How to stack name list in non-alphabetical order?

an update on this: I managed to change from 'orderby'=>'title' to 'orderby'=>'date'as suggested. This almost made the order perfect except one clarinet that falls out of the order and is placed in ...
1
vote
1answer
356 views

Is it possible to list post attachments in a sub URL endpoint with a dedicated template?

Wordpress provides templates for displaying media attached to a post or page (attachment.php and more). They're also displayed with nice permalinks, such as: ...
1
vote
2answers
654 views

Are Category or Tag Archive Pages Possible?

Currently /category and /tag 404 if you hit them directly. Is it possible to create a theme template to handle what would display on it? Mark Jaquith - ...
0
votes
2answers
1k views

Single post as homepage?

I'm wanting to set a single post as my homepage. I have a photographer's site. There are a few galleries (weddings, portraits etc). Each gallery is a wordpress post with attached images. The post ...
-1
votes
1answer
2k views

Make a Custom template for a specific category in wordpress

I am having issue with a custom category template. I want to create a new template for my specific category "VIDEOS" so that all posts under this category show in new style. Basically, i want to show ...
0
votes
1answer
292 views

Author template help. How to check if field exists in the profile?

I'm coding my author template. I want something like this <?php if(Author filled about me)) { ?> <div class="title">About me</div> ...
15
votes
8answers
19k views

How do you find out which template page is serving the current page?

When you activate a wordpress theme, it's always a hassle to find out which file to go to change things. Any idea how to simplify things? But on the other hand, considering the get_template_part ...
0
votes
2answers
389 views

wordpress showing all posts instead of date range

When going to http://craigmdennis.com/articles/ Wordpress uses the index.php template. When you go to http://craigmdennis.com/2010/05/ Wordpress uses the same template (markup below) but shows the ...
0
votes
2answers
1k views

Why is taxonmy-[taxonomyname].php not working?

I've registered a couple of custom taxonomies to go with a couple of custom post types but I'm having some trouble getting a template file to work. I've tried taxonomy.php, taxonomy-[termname].php, ...
0
votes
2answers
530 views

More than one search results page template

On my current project, I have to create 2, distinct templates to receive 2 distinct search results of the same site. Both researches are coming from different forms on different templates/pages. ...
0
votes
2answers
1k views

Sub category templates

I've inherited a Wordpress site that my company built before I started working here. I would go and ask this question of the guy who built it, but he has now left the company. My query relates to ...
0
votes
2answers
2k views

Custom post type archive category page results in 404

I've created a custom post type: register_post_type('campaign', array( 'labels' => array( 'name' => __("Campaigns"), 'singular_name' => __("Campaign"), ), ...
0
votes
2answers
397 views

Shortcode in pages or tempate files for custom post type

I am using WordPress to develop a coupon site. Merchant pages are somewhat similar to this. I am using shortcodes in these pages for Facebook Like, Google +1, Customer Review, Codes from similar ...
0
votes
1answer
375 views

One Custom Post Type two different Templates

I have a custom post type with some metaboxes, for this CPT have his own single-CPT.php where I show his content and metaboxes and url domain.com/CPT. But what I need to know is if posible to create a ...
0
votes
1answer
178 views

Index template and Home page

Sorry if this seems silly but I am new to WP. I realise that Index template is the most important file. Is it ok to have Index as your "home" page, and can you just assign the Index template to the ...
1
vote
1answer
2k views

Default Gallery Edit/Template Editable?

I quite like the default WordPress Gallery, but i dont like how it plonks the images as thumbnails, with a link to the larger image. Is there anyway to make it display the images not in a thumbnail ...
1
vote
1answer
785 views

Change post_date to post_modified date on post template?

I'm looking to change the post created date to a modified date on my post template (single.php). Moreso, I'm looking to control when I update that date based on whether I make significant changes to ...
0
votes
2answers
2k views

Multiple Post Thumbnails Plugin - Need help with code

I am having problems getting this plugin to run but have had little success getting it to work, even after reading past entries. I would be grateful if you could see if the code is right. Code in ...
0
votes
2answers
1k views

Pagination on custom taxonomy

I'm having a tough time getting this to work. It's not the first time I run into problems with pagination, or I would say with WPs URL system. Basically I have this URL: ...
1
vote
4answers
66 views

Do i need to keep all the default WP templates files in a theme?

I have a general question about the themes development. When I develop a theme for distribution (free or commercial) is it a better practice to keep all the default templates file in my theme even ...
0
votes
1answer
177 views

How can I allow users to edit text that will be displayed on a custom post type archive page?

I like the custom post types Wordpress offers. Most of the time I like the way that the archive of custom posts is displayed. For example if you have a custom post type of top_hats you can visit ...
0
votes
1answer
112 views

Specifying a template for custom post type pages

My main projects page is bringing in some data that I have entered in for custom post types. There are basically a few categories like "photo", "video", etc. When you click on one of these it will go ...
0
votes
1answer
1k views

Page is defaulting to archive page and not designated template

I created a page called "Projects" through the wordpress admin I created a template called "Projects" Set the "Projects" page to use the Projects template. How come when I navigate to the Projects ...
0
votes
3answers
113 views

Best way to handle lack of titles in microblogging

I'm experimenting with doing "microblogging" with WordPress and I'm doubtful about how to handle "titles" when one uses different post "formats" (the "formats" may or may not be related with the core ...
4
votes
1answer
78 views

add/apend templates 'transparently' via plugin to currently active theme or child theme?

Cross posting my trac question here in the slim hopes that someone here has run into the same issue and has already come up with some proof of concept code I can try: In building a custom 'theme ...
2
votes
2answers
1k views

Custom Post Type Templates?

Is it possible to set up templates for custom post types? For example you have a portfolio page with 4 different variations of layout and you want the user to be able to pick which layout they want ...
0
votes
1answer
96 views

Taxonomy template for all taxonomies attached to certain post type

For instance, I have a product post type and I would like all the taxonomies associated w/ this type, such as size, color, material etc to display using the same template without having to 1. create a ...