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

learn more… | top users | synonyms (1)

1
vote
0answers
11 views

link to non-category page routed to category template

Working on a theme I was surprised when a link to an about page (about is not a category) is routed to the category template. Why is this so? The template file for the about page is default. Then I ...
0
votes
1answer
524 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 ...
1
vote
2answers
2k views

How to prevent WordPress from loading the jQuery library at the top of the page

I am developing a site that must be HTTPS secure and WordPress is loading <script src="http://code.jquery.com/jquery-1.7.1.min.js"></script> at the very top of my page, before <html> ...
0
votes
1answer
17 views

Where to find the code used to render a page that has a shortcode and a template defined?

I'm new to WP and trying to configure the 'My Account' page on a WP site. The site uses the Paid Memberships Pro (PMP) plugin. In the WP admin console > Pages, there is a page called 'My Account'. ...
0
votes
2answers
19 views

Using if statement in index.php instead of creating separate template files

I've to add just a line when the user clicks on a category link or search for something, so I thought to do something like this inside the index.php instead of creating other template file like ...
0
votes
2answers
1k 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(); ...
1
vote
1answer
18 views

WP Post Template - Templates in own folder

I am using the plugin: WP Post Template which allows me to use templates for custom post types. At present the plugin watches the theme root directory for pages with: <?php /** * WP Post ...
0
votes
0answers
15 views

Custom template bypassing to pager to index.php

I have custom layout and its a template page, but for some strange reason, the custom template is loading up index.php. I double checked in my editor, the template is selected correctly, still it ...
0
votes
0answers
15 views

Show product category in order email

requesting help with woocommerce... when customer orders something he receives an e-mail and owner of the shop receives an email too. There is the name of a product customer has bought. I want to add ...
0
votes
1answer
33 views

Show Templates in Custom Post Type Editor

I know I can use templates for my custom post types like this: http://codex.wordpress.org/Post_Types#Template_Files But I would like to have a dropdown menu to choose a template, like that when you ...
0
votes
2answers
499 views

Rewrite rule shows 404 page

I am new to Wordpress so I don't really know how the rewrite rules should look like. My problem is that I have a custom template in my theme called portfolio-inner.php My rule looks something like ...
1
vote
1answer
14 views

Load specific page template based on URI

I have a page template that I want to load, when ever my $_SERVER['REQUEST_URI'] is like this, www.site.com/link/147 where the number 147 will be variable. i.e. I would like a call a page template, ...
0
votes
0answers
13 views

How to Display Subcategories and its Latest Post as sections or modules under the Parent Category

I want to achieve the following: When in the parent category display as follows: Parent Category Title Parent Category Description Child Category #1 Post#1 Post#2 Post#3 Child ...
2
votes
1answer
2k 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
0answers
25 views

2 different templates for 1 query

I have a working query with some custom meta fields (among others ACF Gallery field) which displays news on "News" page. I have also second page named "Gallery" which is quering posts by gallery ...
2
votes
2answers
405 views

Get image URL from media library in input

On wp-admin/post.php?post=447&action=edit for example I have a link and an input. The link appears as follows: <a href="#" class="button insert-media add_media" data-editor="tj_image_url" ...
2
votes
2answers
9k views

Where is get_header('shop') file in Woocommerce templates

I need to modify the get_header('shop') file in Woocommerce but don't know where it's located, if someone knows please help me out - thanks!
0
votes
1answer
18 views

URL rewrite before template_redirect called

Logic I have a page template at /blog that contains a "public" blog. I have a page template at /members that is members area. If a user enters the URL /members/blog I want to catch this in the ...
0
votes
0answers
15 views

Some Linked Pages work only if user refreshes

Since I tried to add soje and some pages won't load unless the user makes a refresh. The website is http://sharepopup.it/wp An example is the login: On the menu "ACCEDI" the user can click on ...
15
votes
4answers
15k views

How do I get the size of an attachment file?

I'm using the following template code to display attachment links: $args = array( 'post_type' => 'attachment', 'numberposts' => -1, 'post_status' => null, 'post_parent' => ...
0
votes
0answers
12 views

How to Use Twig + Timber with Multiple Loops based on Meta Key Value

So, I've got a custom field (meta_key) 'premium' with some posts (meta_value) set to '1'. I would like to display all of the premium posts above the the others. I imagine this would be done using ...
1
vote
1answer
47 views

Display Password Protected external RSS in wordpress template

I am using the below code to show external rss feed in my wordpress blog page template: <?php include_once(ABSPATH . WPINC . '/rss.php'); $rss = ...
12
votes
3answers
10k views

What's the difference between home.php and index.php?

If I create a home.php file, it seems that WP will use that instead of index.php, so index.php is never used? What are the differences between these two template files (located in the theme folder)? ...
0
votes
2answers
683 views

Category link redirect to custom template page instead of index.php?

I want to make template page for my custom taxonomy. I have custom taxonomy categories listed as navigation links. It's the country list (China, Slovenia, Serbia...). Every of this categories has ...
0
votes
1answer
23 views

Handling single.php in Multisite

I'm using sub directories for my WordPress multisite, posts are controlled with single.php. How can instruct single.php to use a different header and footer file for the site in the sub directory? I ...
0
votes
1answer
22 views

Getting term description in single post template

I have custom posts called 'esitykset' and it has custom taxonomy 'tapahtumat'. Now I have been trying to get the description on one of the term in 'tapahtumat' taxonomy and i have no idea why it is ...
0
votes
1answer
18 views

Returning One custom taxonomy term name

I have a custom taxonomy called cities and right now the only city is las vegas. I am trying to use the code in question to echo "Las Vegas" - for the posts that are associated - on the search results ...
5
votes
4answers
780 views

How to control output of custom post type without modifying theme?

I have a custom post type 'properties' that I'd like to control the HTML output for. For simplicity, let's focus on the archive view. As a basic example, here is what a loop looks like in an ...
2
votes
4answers
852 views

Programmatically change post templates?

I need to change the template on several hundred pages on my site. Does anyone know if there is a command to do it programmatically? See the following code snippet; I'd like to replace my comment ...
0
votes
1answer
56 views

Is the “_s” on this `sprintf(__('Page %s', '_s'), max($paged, $page))` just refer to a text domain?

Is the '_s' value in such code which can be found on Customizing with the filter, just refer to a string of a text domain as what's documented or a literal value? /** * Filters wp_title to print a ...
0
votes
0answers
20 views

Wordpress and copying / pasting contents from tables

I have a quick question, got a client who wants to have a Wp site and then from her old site, she wants me to copy/paste her contents in the new one, but just noticed that all her contents is ...
0
votes
0answers
33 views

Template file structure , wordpress hook for altering the template

i need to convert a html structure to theme. So this is my html structure <html> <head> ................. </head> <body> <div class="main"> <div ...
0
votes
0answers
26 views

Dynamically generated breadcrumb functions for category.php

BACKGROUND: I want to create a template page (using template.php) for news articles. News articles fall into about 7 different categories (Local, Special Events, Tech, etc). The template will use ...
0
votes
0answers
8 views

two author templates for same user

Is it possible to have two author´s templates? I have a list of registered users and when visitor clicks on a user name (user 1) it takes them to a public profile of that person using author.php. Is ...
0
votes
0answers
34 views

Use different file includes for single.php

I'm beginning to convet html to Wordpress, I've some problem in single.php to show the post with different headers because mysite use in English and Arabic language. My site containings Arabic and ...
0
votes
1answer
45 views

single.php being ignored, going straight to attachment.php

All of a sudden, for no reason I can tell, my single.php template is being ignored and falling back to using attachment.php If I switch permalinks to use the ?p=123 style, then it works perfectly. As ...
1
vote
1answer
28 views

Load an url with minimal/no DB queries

What would be an ok way to load a theme template with minimal/no db queries? Another question: is it viable to 'dry' load a non-wordpress template using rewrite rules? So instead of index.php?p=1011 ...
2
votes
1answer
3k views

Passing parameters to a custom page template using clean urls

I am now passing parameters to a custom template in the following format www.example.com/?pageid=12&rid=24&title=this-is-the-title I have created two tables . So I need to fetch data and ...
0
votes
2answers
1k 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'; ...
1
vote
1answer
506 views

How can i change email template for new user

When i add a new customer the email goes to new user in this formate: From: WordPress [wordpress@siteurl.com] Subject: [site name] Your user name and password Message: username: user ...
0
votes
1answer
439 views

Why won't the action hook wp_head accept parameters?

I'm working on a plugin that adds scripting to the head using add_action('wp_head',..); I have to pass a variable to the function to get my desired result. To test this I'm simple "echoing" out ...
0
votes
0answers
43 views

Creating a popup

I'm starting in plugin development for wordpress. I have a php script that outputs to pdf in my plugin. I am trying to figure out two things: How do I present the page without the wordpress ...
1
vote
2answers
22 views

how to make a home page for wordpress custom theme

How does we create a custom home page for word press theme like used in themes for theme forest market. Because mostly the home page is used for recent posts to be shown, but I am having no idea how ...
0
votes
0answers
34 views

display different pages content on single page

I am creating parallax website in wordpress, for this I am using html5blank-stable template. For my different sections, like about us, and contact etc I have created pages with respect to them. But as ...
0
votes
1answer
399 views

Custom templates folder

I created a custom folder ("/templates") and I put all of my template files in the folder. instead of root ("/wp-content/themes/my-theme/"). It works fine. Do I have to add some function for ...
0
votes
3answers
4k 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
1answer
37 views

How to change single custom post template by custom taxonomy?

Working on a publication (wordpress based) website, having a custom post type "article" with custom taxonomy : language (with only two options: French, English). I made a custom post type template ...
0
votes
2answers
836 views

create single.php for specific category by category id

I'm trying to create template for specific category with id 1 for example. The template should be applied to all of the pages belongs to this category. So, it should be something like single-1.php. I ...
1
vote
2answers
3k 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
9 views

template structure for CPT not clear

I am a little confused with CPT and custom taxonomies. I created CPT named 'Profiles' and did not create any custom taxonomies for it. So categories is the default taxonomy for it, I tried template, ...