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
2answers
50 views

Search results in custom template

I have a custom page resources-search.php template which handles search results for the search form. And in my function.php I have the following array: $YearList = ...
1
vote
1answer
101 views

custom post template file not shown, instead all the time 404.php

i'm completely confused, want to use my own template file for a custom post type and of course i read all about this here or in the Codex ...
1
vote
1answer
747 views

How can I pass the ID of a post to a page template by clicking a url?

I have a post gallery and I'm displaying the thumbnails in example.com/gallery. Now this thumbnails are created via posts and when you click on on eof the thumbnails, it will direct you to single.php ...
0
votes
1answer
702 views

comments_template not working correcly in custom template files

In a template file that I am using as page, I want to allow only 2 users to post comments and allow to all other users to only see these comments( not allow them add comments). my template file is: ...
1
vote
1answer
35 views

Valid HTML in Template Part

in a custom plugin I have a WPQuery, which looks like the following: $sticky = get_option( 'sticky_posts' ); $args = array( 'post_type' => 'mission', 'ignore_sticky_posts' ...
1
vote
3answers
183 views

Single page theme

I am trying to create single page theme. What i have trouble with is understanding this whole wordpress query logic. There is query object and supposedly i get all published posts like this: ...
0
votes
1answer
73 views

creating a second image attachment template?

Hi i am trying to create a second image attachment template. I have one, but I have created another. In the second one I want the attachments that are under a certain category of a post to have a ...
0
votes
2answers
194 views

How can I make front page to display custom taxonomy page?

If I have this URL for my custom taxonomy term http://example.com/work_type/vehicle-transporting/ how can I show it as the main page http://example.com/ like it is available to do for the static pages ...
0
votes
3answers
5k views

Set templates for custom post types

I am using Weaver II Pro theme 1.3.8 with WordPress 3.5.2 The theme is very flexible and provides many templates. On individual pages, I can even choose which template to use, which is cool and ...
-1
votes
1answer
57 views

Same posts within a paginated page

I have a specific template that displays only posts from a category (350). When I paginate my posts, the posts stay the same. Below is some code that makes up this template. Any ideas how to correct ...
0
votes
1answer
410 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
2k views

Change the output for [gallery] shortcode

I'm sorry if this question was answered here, but I couldn't find it. Is possible to change the HTML output of [gallery] shortcode (without plugins)? I would like to show the thumbnails as another ...
0
votes
2answers
60 views

How can I change the look of a post as is displayed

When an article is posted it comes out like this: Where the title is on top, then the picture, then the image. But what I would like to do is how technobuffalo.com has it: How is this done? is a ...
0
votes
1answer
55 views

Custom Post Type Template based on Taxonomy

I have a custom post type, Vehicles. Vehicles have a custom taxonomy, new or used. Naturally the vehicle pages use single-vehicles.php but I would like to differentiate between new and used vehicles ...
1
vote
1answer
88 views

Programatically create a page

Is it possible to programatically create a page? I want to make it so that I can create a template file in a theme and be able to point links to that page without having to rely on the user to go and ...
1
vote
1answer
64 views

How to change header image size in custom themes

I'm using WP 3.5 for a CMS for one of our clients. I need to have a bigger header image than 940 × 250 pixels, so I changed width and height parameters, but when I try to upload a new image, it still ...
0
votes
1answer
95 views

How to check during “pre_get_posts” if WP performing default query for specific custom template?

I want to modify default query for custom RSS template loaded by plugin that i'am writing right now. What is the best way to check - in function hooked to "pre_get_posts" - if default query for my ...
2
votes
1answer
36 views

Returning Variables back into a template

If I put a function that I want to use in a template I can put it into functions.php function myfunction(){ echo 'My String'; } add_action('myfunction','myfunction'); and in a template file put: ...
0
votes
1answer
363 views

Why get_page_template() doesn't show taxonomy template file name?

I made a custom taxonomy called - work-category and a template file for it called - taxonomy-work-category.php. That part work just fine. For a purpose I did put get_page_template() in that ...
0
votes
1answer
138 views

Highlight wp_nav_menu when category is selected

Using the wp_nav_menu() function to display my menu I noticed the highlighting in the menu was working well for the pages I created (like archives.php) but not anymore when a date (date.php), category ...
1
vote
1answer
147 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'); ...
1
vote
2answers
458 views

Custom Post Templates

The Issue: I am looking for custom single post templates, to add or remove individual elements as a function of a normal single post. There are a lot of ways to create custom post templates for ...
0
votes
1answer
112 views

What is content.php file that is needed for Jetpack infinite scroll plugin?

I'm currently learning how to use Jetpack infinite scroll plugin, while going through the documentation I came across 'render' section: http://jetpack.me/support/infinite-scroll/ It uses default ...
0
votes
0answers
69 views

Custom field data is not saving

I only have this code, which is in functions.php. I can see the field in admin page, but the data is not saving. add_action('add_meta_boxes', 'home_page_template_meta_box'); function ...
0
votes
2answers
87 views

Link to blog index from template

I can't believe I did not find the right function for this: I just want to retrieve the blog index url from a template. My homepage is a static page. I am not looking for bloginfo('url') because it ...
0
votes
2answers
260 views

Prevent private post 404

I want private posts (for those not logged in) to use the single.php template just as public posts do, at the moment they get thrown over to the 404.php template. I've had a good look through 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 ...
0
votes
1answer
221 views

Add Previous/Next Buttons to CPT Single Pages Only

I'm working with a site that is displaying a portfolio CPT on the home page in a "Grid Loop." On the single pages, i'd like to add Previous & Next Item buttons. I thus added this code: function ...
0
votes
1answer
82 views

Wordpress multisite haml templates

I'm building a very large Wordpress multisite at the moment and while I sort out the project at a top level I want to know if it's possible to use haml or phamlp for my templates instead of php. I ...
2
votes
4answers
2k views

Grid layout “last” class to every third item

Seems like a trivial problem but I can't get it to work. I need to add class="last" to every third post. Here is my code: <?php $count = 0; $my_query = new ...
0
votes
2answers
91 views

Shortcode / plugin with custom (flexible) output

Following scenario: I'm building a theme framework which I want to reuse in various themes of mine. In this framework there is a collection of many shortcodes. For exemplary illustration of my ...
0
votes
1answer
36 views

why is markup routinely placed in functions in wordpress?

Here is an exampple from a woothemes theme. I'm definetly not having a go at woothemes - they are a great theme provider with great standards and this sort of thing is fairly typical in themes. why? ...
0
votes
1answer
60 views

Add multiple pages to theme customizer

So that theme customizer over at /wp-admin/customize.php is pretty cool, but it looks like it only lets you customize one page. Is there any way to add multiple pages or other theme template pages to ...
0
votes
2answers
204 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
0answers
35 views

Template for page with overridden Theme

I think I've got a somewhat uncommon issue. My wordpress site uses a custom theme, but I wanted to add a blog alongside that, without using multisite because my host charges 3x the amount for such a ...
0
votes
1answer
172 views

Template with Custom Post Type (Custom Tables) does not work

I'm using a Custom Post Type (CPT) my-project stored in a custom table MY_PROJECT. Here is the CPT registering code: $labels = array( 'name' => __( 'Projects ' ), ...
0
votes
2answers
79 views

Remove portion of header code from home page only

I have this code in the template file header.php: <div class="dynamic-header"> <?php if(function_exists('show_media_header')){ show_media_header(); } ?> </div> I want to ...
0
votes
1answer
31 views

Group pages by custom field values

I plan to have each individual product as a page, with custom fields for : Brand, size, feature 1 and feature 2. My question: Will it be possible to build a summary page template say for Brand, ...
3
votes
1answer
1k views

Test if page is child and has children, if so echo child pages also on grandchild pages

I am trying to show a sub-menu of child-pages only on level 2 pages (who have a parent) and if they have children. I am using the code below (made from several snippets I found), it works fine on ...
0
votes
0answers
215 views

Permission denied in template-loader .php

Oh man. I tried to create a custom page template for a page on my site page-cumberland-principles.php When I go to view that page, the page showed up completely blank. I used wp_debug, and found ...
0
votes
1answer
59 views

How to find out which template the HTML content comes from?

At my page, I want to change the text "next" and "previous" at the bottom of the page, but I can't figure out which PHP template it derives from. I tried searching the classes that was connected to ...
0
votes
3answers
48 views

Is there a way to make this kind of loop shorter and nicer?

Here is my loop code, i want to call different page templates for different pages. Please notice that this is a one-page-layout. <?php $args = array( 'post_type' => 'page' );?> <!-- get ...
1
vote
2answers
10k views

Display a specific dynamic sidebar widgets on a specific page

I have had a wordpress site handed off to me halfway through completion. It's been at least a year since I last used wordpress and there are a lot of things I'm finding different. The way I am used to ...
0
votes
1answer
776 views

Site Title appearing twice on live site

My site template's header.php file has the following: <title><?php wp_title ( '|', true,'right' ); ?></title> Why does this produce the site title twice on each page?
4
votes
5answers
707 views

How to show a under construction page for a domain but still be able to work on index.php?

I installed a WordPress for a domain name. When I use this domain name will point to index.php in my template. I want show a under construction page for this domain name, but the other hand I still ...
26
votes
9answers
29k views

get name of the current template file

I've found this to display the current name of the file used in template: function get_template_name () { foreach ( debug_backtrace() as $called_file ) { foreach ( $called_file as $index ...
1
vote
1answer
90 views

get_search_link() redirects to 404 template page

I built a custom theme, and in it, there is a 404.php page and a search.php page. Elsewhere in the template, I wanted to link to the search page directly. So, I used the get_search_template() ...
0
votes
1answer
201 views

Wordpress removing data attributes for scheduled post

Hi I'm using the smarty templating engine in wordpress to generate HTML like the one below: <li> <div class="checkbox_container" data-asin="B0009Y7APU"><input type="checkbox" ...
3
votes
1answer
2k views

Displaying a WooCommerce product via PHP

Having a hard time composing a searchable query, so I apologize in advance if this has been covered. I know you can add WooCommerce products to a page or post via short code, but I have one section ...
1
vote
1answer
61 views

Query with no terms uses index.php template instead of archive.php

I'm using the Query Multiple Taxonomies plugin to get a page of search results (all of which are a custom post type - car). If any search terms are added, so the url looks like this: ...