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
14 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 ...
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
0answers
17 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 -- ...
0
votes
0answers
18 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 ...
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 ...
0
votes
0answers
20 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 ...
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 ...
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 ...
1
vote
1answer
54 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
17 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
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
35 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
28 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 ...
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
0answers
29 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
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
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
25 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 ...
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 ( ...
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
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 ...
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
49 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 ...
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 ...
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 ) { ...
1
vote
1answer
97 views

Single page template for custom post_type

I registered a custom post type with the following code: #Register custom post type for Stars of the Month add_action( 'init', 'sdp_create_star_type' ); function sdp_create_star_type() { ...
0
votes
0answers
22 views

Is there a way to share a template/markup with the JSON API so that it doesn't need to be declared both in PHP and in JS?

Current Setup I'm using WP's JSON API on a custom post type archive to query some posts. I then parse the returned JSON object to output my markup accordingly. I also have a single post type template ...
0
votes
1answer
53 views

Loading custom jQuery and HTML in a WordPress page

I have a simple application I have worked on and would like to load it into my WordPress theme. This app has a /js folder with myscript.js, a /css folder with mystyle.css and an HTML file index.html. ...
0
votes
0answers
37 views

Polylang fallback language does not get activated even with patch

<?php //my patched archive.php to display posts of a category get_header(); ?> <div id="content"> <?php global $wp_query; ...
0
votes
1answer
32 views

php loading different structure than source code

I was trying to code in a conditional statement into a template file and had a bit of an issue. This is the code in the file else { echo('<div ...
0
votes
1answer
26 views

Add Element as a Filter to the_content

Can I and How would I add a filter in the function.php that would add a HTML element around the content when the_content is used? This would be similar to what you can do with the_title. i.e: ...
0
votes
3answers
26 views

How do I insert JS tracking code to a page with the WP editor?

My client needs to add unique blocks of javascript to certain pages in order to track visitors. How do I go about doing this? At first I tried to use a custom field but the field stripped out ...
0
votes
4answers
49 views

Page template not displaying

I dont get why this isnt working. I have a custom page template: page-politics.php (http://pastebin.com/J35dXptv). It should look similar to this page: But its displaying this: Ive double, triple ...
0
votes
0answers
20 views

wordpress multisite create different author template for mainsite and subsites

I am using authors.php to display authors pages. From my landing page of my WPMU installation I am trying to redirect the author page requests to different template. That is the requests to the ...
0
votes
1answer
25 views

Modify just ONE page based on a template

I am new to wordpress. I have been given a site to customise. I want to modify just one of the pages to include a php calendar which links to a mysql database, so I will want to run my own PHP code ...
0
votes
0answers
17 views

How to use the WordPress header as the global header for apps across a site?

I am running Wordpress as the main site, and a few other php CMS apps for other specific purposes (let me call it subsites for the purpose of this question). Now when designing templates for ...
0
votes
1answer
30 views

Display DISQUS on homepage

I have installed disqus and I want it to show up on my homepage. It replaced the old wordpress comments system on pages and posts but I also want it to appear on index.php my index.php file now - > ...
0
votes
0answers
14 views

Displaying a list of categories ordered by popularity?

I would like to add a list of categories to my template showing only the 5 most popular categories(by number of post views within each category). Is this something easy or would it take heavy ...
0
votes
0answers
45 views

How to create page with lots of dynamic content(AJAX?)

I am setting up a Wordpress-homepage which has a lot of toggled content(sort of like this: https://jqueryui.com/tabs/). So for example I have a list of links on the left side, and a content-container ...
0
votes
1answer
19 views

How can I pull information from my loop and divide them seperately?

I've created a Custom Post Type that I'm trying to implement into a CSS slider. To do this I've created a custom template and added counters to get unique ID's for every new post that get's pulled. ...
0
votes
0answers
31 views

Page attributes missing

(I searched if anyone has same problem but found nothing. So if this is a duplicate question please let me know) My plan was to create a custome-page-template. So I found some tutorials and recognize ...
1
vote
0answers
41 views

Plugin templates vs Parent Theme

I've been building a plugin using a WooCommerce like template system, where the plugin houses the default templates, but allows for overriding via a template folder in your active theme. It just ...
0
votes
1answer
15 views

Taxonomy Parent not showing up in address bar

I created a custom taxonomy successfully and assigned the custom post type as well. It is a hierarchical taxonomy and I added terms in the back in a hierarchical way. I added for instance main ...
0
votes
0answers
17 views

How can I limit posts when using template_redirect?

I'm trying to redirect a query (http://example.com/custom-post-type/?action=create) to a template file (page.php) while also replacing the_content. I've more or less gotten it to work. But the end ...
0
votes
0answers
52 views

different single.php for different page templates

I have 4 page templates with same query. Is it possible to write conditional statement? If I go to single post view (single.php) from page template 1 (page-main.php) display something (for example ...