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
265 views

How to add a “ waiting” icon for an ajax in WP frontend?

This is my search js code for processing search : jQuery(document).ready(function($){ $('#searchsubmit').click(function(e){ e.preventDefault(); var searchval = $('#s').val(); ...
0
votes
1answer
54 views

lost css when overriding themes templates

i have copied and modified the template file : header.php in my theme child and i kept the same path. here is the full file <?php /** * Your Inspiration Themes * * @package WordPress * ...
0
votes
1answer
45 views

Show uploaded images in full size

I have a very simple template where I am showing images. The code looks like this: <?php /* * Template Name: Portfolio */ ?> <?php get_header(); ?> <div class="row"> ...
0
votes
2answers
83 views

Forcing oembeds to top of post

What's the best way to force oembed (or shortcodes too) to the top of a post? I'd like to feature youtube embeds before the actual article content, regardless of where the link was inserted. Any ...
0
votes
3answers
73 views

Post Templates and Post ID's

I am trying to make use of the Single template for single posts ( I have a custom one). But for some reason my posts get overridden instead of displaying new data. This is the setup I have right now ...
0
votes
0answers
35 views

Custom page templates readmore tag is not working

Custom page templates readmore tag is not working. When I insert readmore before some word (in WP Editor) that's not working when I visit the page. I don't need post_excerpt();
0
votes
1answer
38 views

Load custom script on a single template

So I placed two scripts in the plugin folder, but I can´t figure out why they wont load. I created a custom template where I have placed the following code: <?php function my_enqueue_scripts() { ...
0
votes
1answer
127 views

have_posts is empty on category.php

All the applicable code is in this gist. I have a really simple category.php template. I have 3 posts, each belonging to the same parent category, and 2 belonging to one child category and the third ...
-1
votes
1answer
36 views

Wordpress show different custom post type

In wordpress I want two different types of custom post. In one section I want to post all the latest news and in other I want to use as blog. In latest news post type when I will make a news it should ...
1
vote
1answer
83 views

Theme development question regarding layouts

I am developing a WordPress template (or rather trying to) and need a bit of help/advice. I have a template that consists of a header (inc nav), footer, main content area. The main content area has ...
0
votes
2answers
47 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
86 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
494 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
511 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
4k views

Show Woocommerce minicart widget in checkout page sidebar? And, how to make this update secure by overriding widget?

Before asking question here I want to tell that I have already asked the question in stackoverflow and wordpress forum but have not got any answer. So finally I came here. I have installed the ...
1
vote
1answer
34 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
163 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
65 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
148 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 ...
1
vote
3answers
6k views

How to insert a logo in the header?

I am pretty new in WordPress world (I came from Joomla) I am finding some difficulties to insert a logo into this WordPress test site: http://onofri.org/example/ I want put my logo in the header of ...
0
votes
3answers
4k 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
48 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
2answers
56 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
51 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
80 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
55 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
87 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
34 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
94 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
64 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 ...
1
vote
2answers
421 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
120 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 ...
0
votes
2answers
56 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
204 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 ...
2
votes
2answers
96 views

Unable to set right time in admin and frontend template

When I run a simple php file called test.php (placed in the root of the wp installation) that contains something like that: <?php echo date('H:i:s'); ?> The result is right: 15:30:00 and the ...
0
votes
1answer
182 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
70 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 ...
0
votes
1answer
227 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
35 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
2answers
85 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
919 views

How can I force URL of a custom post type archive to use a page template?

I have the following custom post type: if ( $args->has_archive ) { $archive_slug = $args->has_archive === true ? $args->rewrite['slug'] : $args->has_archive; if ( ...
0
votes
1answer
54 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
1answer
1k views

Custom Post Type .current-menu-item not applying on Custom Post Type Archive Page

I am working with custom post types and I had trouble with the nav menu not getting the .current-menu-item on my custom post archive page menu item. In fact, when I was on that page or any of the ...
0
votes
2answers
155 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
280 views

How to retrieve depth of menu into template

In wp_nav_menu i use for the menu, with custom walker, i can get the $depth parameter in the start_el function function start_el(&$output, $item, $depth, $args) but, outside this ...
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
159 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
1answer
30 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
837 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
163 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 ...