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

Force WordPress to load a specific template

How would I force WordPress by code to load a template file on my home page? I know how to do it via the backend but I would like to create a plugin and have the option to set the front page from ...
2
votes
2answers
400 views

Gravity Forms Custom Templates

Im trying to further customise my Gravity Forms "Address" labels. At the moment they read "Street Address", "City" and "ZIP / Postal Code". I, for example, want to change "ZIP / Postal Code" to "Post ...
0
votes
0answers
25 views

Add an image from a custom field in Sabai Directory [on hold]

I'm trying to use the Sabai Business Directory plugin and need to give each Category a photo. I went in through the UI and added an image field to the Category at ...
0
votes
1answer
32 views

How to extract the variables out from “add_shortcode” function?

In Wordpress, lets say i have a custom Shortcode function, like: function foobar_func( $atts ){ //whatever required processings here... $foo = "the value is foo!"; $bar = "the value is ...
0
votes
1answer
804 views

Woocommerce Custom Template for Specific Product Category

I am building a store using the Woocommerce plugin. I need to set up a template for a specific category, let's call it 'awesome', so that it displays all products in a way that is different from the ...
0
votes
0answers
18 views

Only show top level posts of specific category

I've been trying to create a loop that will only show the top level posts no children/sub category posts. Basically what my categories look like are -- -All --one --- A --- B -- ...
1
vote
0answers
145 views

Override a theme's WooCommerce template files with plugin [on hold]

A plugin I'm working on, has it's own WooCommerce template files which override the default WooCommerce templates. I know I could make a child theme with a woocommerce folder but I'm trying to make ...
0
votes
1answer
222 views

Display custom widget value in header.php

I am using the code below for a custom widget. I have added some fields in the widget like: Title, Name and a checkbox. Now everything is fine but I want to show those values in header.php. Any idea ...
0
votes
2answers
868 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
0answers
19 views

Specify which template to use by link?

Is there a way to specify which template I want to use when clicking a specific link? Specifically, I have my tag template listing all posts that have a certain tag. My page for the category ...
1
vote
2answers
162 views

“Issues” loading MANY featured images on a single page (custom template)

I have a page that loads a lot of featured items in a grid. There are up to 56 images loading, and it does have a bit of a delay. This is the code as it runs now: if( count( $postslist ) > 0 ) { ...
0
votes
0answers
20 views

Comments template override [closed]

I would like to add an extra class to my comments template and I have a call in my functions.php but I don't know how do I pass to comment_class() an extra class? <li <?php comment_class(); ...
-1
votes
1answer
15 views

Best practice to create required pages

Some times, when we work on custom wordpress themes, we need required pages. For example - custom login page. Some times, when user change slug, page template or something else - it a very difficult ...
-1
votes
2answers
422 views

Choose custom post type template by category

I need to style my portfolio posts with different templates. My thought is that it would be done by category. I have tried using in_category and is_category and a lot of other work around's but to no ...
0
votes
0answers
21 views

Theme Option won't show up in my template

I've modified theme option from wp.tuts tutorials, And when I save the settings, it works. But the settings on the second tabs won't show up in my template. here my first theme option and the second ...
6
votes
5answers
2k 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
34 views

Search page for custom post type

I am new to wordpress and a beginner coder, and i was searching around the net, found solutions but still does not work. I have custom post type named dlm_download, and my custom search template not ...
3
votes
1answer
294 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 ...
1
vote
1answer
55 views

How to display a listing template of a certain taxonomy?

I'm trying to figure out how to display a list of specific taxonomy (categorycourses). In functions.php for the theme I have: //Register custom taxonomy for courses-categories $course_cat_args = ...
0
votes
1answer
21 views

Changing permalink name redirects to another template?

I'm creating a template with a few templates with names page-contact.php, page-portfolio.php and page-blog.php. The problem is that when I select a Defaul Template for a page (I expect it to open ...
0
votes
1answer
260 views

How do we create a custom taxonomy template that loops through child categories in term order?

We're building a site that sells Biking Gear : http://www.nimblewearusa.com.php53-16.dfw1-2.websitetestlink.com/ We're using the Genesis Theme Framework, and developing a custom child theme. It has ...
0
votes
1answer
19 views

Current URL path variable

WordPress has a built-in variable $pagename that will give the current page. I am looking for something that will give the full url including the path before the current page. Details below. I am ...
0
votes
1answer
39 views

server-moving causes funny issues in template

while moved from with a beta install of wp from a subfolder of mydomain to mydomain main folder i get funny things a. the template looks a bit buggy and when i want to login - with i ...
0
votes
0answers
31 views

wp_list_bookmarks(); not displaying anything

Bizzarely, I can't get the wp_list_bookmarks(); function (inside a page template) to render anything. Hope somebody can point out something obvious! Cheers. Here's my code: <?php /* Template ...
0
votes
2answers
194 views

index.php template is used instead of blog page

I am trying to set WordPress so that home page is static, and the blog page is a separate page. So, I created two page templates in my theme., lets call them home_template and blog_template. Then, I ...
0
votes
1answer
20 views

Change the template when the user is not logged in using page_template filter (it does not work)

I want to print other template when the user is not logged in. I use this code: function restrict_access_to_unlogged_users($template) { global $post, $pagename; $new_template = ...
1
vote
2answers
36 views

Directly using pure JWPlayer JS (but NOT WP Plugin)

First of all, I'm not using WP JWPlayer Plugin. (And i don't want it. And thats the another story) Well in the Template file: wp_register_script('myJW', get_bloginfo('template_url') . ...
-1
votes
1answer
29 views

How to read a page's “Shortcodes” from the Template File?

Lets say i have a Page, and it contains some shortcodes like: [myshortcode foo="bar" bar="bing"] [anothershortcode foo="bing" bing="bar"] Then how do i read those from my custom Template File, to ...
1
vote
1answer
2k views

tag.php doesn't work with tags on a custom post type post?

here's another stumper. I have a tag.php page. It works fine, unless you click a tag that is in a post associated with a custom post type. Then it doesn't work. Its like that tag, doesn't exist. But ...
0
votes
1answer
281 views

How to 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
2k views

Customizing get_the_excerpt() to specific length and “Read More” output.

I am costuming a template. There is a list grabbing the introduction from the first 1-2 paragraphs (all the articles from a category). If I set the excerpt to 295 words, sometimes the list grabs ...
0
votes
0answers
32 views

Mysterious template change after database import/export

When I switch databases from my local environment to the host, some of the pages inexplicably change templates. E.g. there is a custom template "Home" and when I switch the db's it ends up with the ...
0
votes
1answer
22 views

MailPress plugin: table inline style tag removed when sending the newsletter

I have coded my own MailPress theme for my newsletter using tables and inline styling for good look and feel of my newsletter. I have in the files header.php and footer.php html table code with inline ...
0
votes
0answers
30 views

How to: Get the first image from the next and previous post in single.php? (5 posts)

I know I can call a function below but it works in loop at index.php only. function catch_that_image() { global $post, $posts; $first_img = ''; ob_start(); ob_end_clean(); $output = ...
0
votes
1answer
309 views

wp e-commerce single-product template giving 404

this page was working initially, and then I made some changes which *didn’t* appear, and then it just stopped showing that page altogether. I have tried deleting my wpsc-single_product.php and ...
2
votes
5answers
875 views

How to force TinyMCE in WodPress to replace newlines with <br> tags and not with <p>&nbsp;</p>

TinyMCE editor inserts <p>&nbsp;</p> instead of <br> tags when I press enter in my text for a new line. How to force TinyMCE in WP to replace newlines with <br> and not ...
0
votes
0answers
21 views

Secondary loop cuts off at 10 posts?

I have a loop to get a tag name from the URL slug, and then show all the posts, grouped by category, that matched that tag. It works, but I recently noticed it only shows 10 posts despite my setting ...
0
votes
1answer
26 views

Calling an image within the theme folder from inside a post/page?

I am building a website for a client of mine who would like the ability to make minor layout changes themselves. Because of this I am coding some of the layout directly into pages using the text ...
1
vote
1answer
804 views

Shared Content but “Updatable” Through the Main Site

I have been doing quite a lot of research the past week, and have not been able to find a solid answer that fixes my problem. So, I decided to come here to ask to see if anyone knows of how to help ...
0
votes
1answer
18 views

Add filter multiple times using only one master function

Is it possible to use add_filter with lets say an array of different values? to achieve something like the following: foreach($templates as $name) { add_filter( 'single_template', function ( ...
-1
votes
1answer
79 views

How to have a custom display for both woocommerce archive and product-category pages? [closed]

So far Hi there, I understand my question is very closely related to a common question about 'woocommerce'. I have been using a variety of woo hooks, filters and creating copies of original woo ...
0
votes
0answers
9 views

How can I clean up the code in my template? [migrated]

When I'm coding static websites, I take pride in having code that's well organized, well tabbed, etc. Unfortunately, when I create a WordPress template, my code becomes a complete and utter mess. This ...
-1
votes
2answers
2k 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 -- ...
0
votes
2answers
591 views

How to edit contents of dynamic_sidebar()?

I know PHP well but I'm new to Wordpress. I got an incomplete Wordpress website. It has a static home page with an Aweber newsletter form. I tried digging into installed theme and in home.php I came ...
0
votes
1answer
618 views

How to add a new product type on woocommerce product types? [closed]

I want to add a new custom "product type" to woocommerce plugin: Tried to duplicate one of currently exist product type files (woocommerce template structure) as a new file (file name and inside ...
0
votes
1answer
50 views

Duplicated Template Does Not Load the Same as the Original Template File?

I had someone code a custom theme that I had designed. I need to duplicate one of the templates this person made, give unique class names for the CSS, adjust the CSS as needed, and finally save it as ...
1
vote
0answers
22 views

Does page.php need the loop? [duplicate]

Simple question. Does page.php need the loop? The Loop 'loops' through several pages/posts/content. However the page.php template only has 1 page. There's nothing to loop through. I noticed that ...
0
votes
2answers
32 views

add jquery file if a certain page is included

I was wondering if anyone could help my by explaining if it is possible to enqueue a javascript file only if for example homepage.php is included. what i have tried to do inside homepage.php: class ...
0
votes
1answer
217 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
1answer
46 views

page_template toggle between 2 templates + 2 permalinks for same post

I'm trying to use this page_template template from the WP forums, with the same aim as the original author: I am trying to use two separate permalinks/templates for a single post - each ...