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
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 ...
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
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 ...
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
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 ...
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 ...
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
46 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 = ...
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
32 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
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
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 ...
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
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
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
25 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
33 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 ...
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 ...
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
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
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 ...
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
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
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, ...
0
votes
0answers
10 views

Template included with plugin doesn't return all posts for custom taxonomy

I'm in the process of developing a plugin with a custom page template (using template_include) with a loop that retrieves all posts with a custom taxonomy. I tested the code using the same templates ...
0
votes
1answer
34 views

How to assign a class to a page with a custom template?

I tried with the bellow code to assign a body class to a page with a custom template, but this didn't work. What is wrong here? function prefix_conditional_body_class($classes) { if ( ...
0
votes
2answers
39 views

Is there a way to change the default page template selection?

Click on "Pages" -> Click on "Add New" In the add new page screen. The default page template selected is "Default Template". Is there a way to change the default option to, let's say "My Other ...
0
votes
0answers
26 views

How to change post template via url?

I have a single post template (single.php) which displays the title, the abstract, tags, content etc. I made another template (abstract.php) to display only the title and the abstract of the post. ...
0
votes
1answer
32 views

Problem creating a custom category page with pagination

I am creating a category-{slug}.php page for a specific category. This page has pagination also. This code successfully worked when calling the first page of the category page, but the problem starts ...
0
votes
1answer
35 views

Change directory where get_header(), get_footer() and get_sidebar() look for templates

I'm creating my own theme framework, and I want to organize my code, separating the partials files from the pages. But I want to do that and still use the native functions get_header(), get_footer() ...
0
votes
0answers
19 views

Override theme template for index page

For one of the websites I manage we baked in a lot of custom functionality into the theme we are using. The problem with this is that it's difficult to switch themes. I wanted to decouple this code ...
0
votes
1answer
48 views

How to pass a variable from a template page to the child theme functions.php

I'm searching for a way to pass a variable from a custom Wordpress page template to my child theme functions.php file. I have the wrong scope and I'm completely lost. I'm trying to generate a google ...
2
votes
0answers
34 views

Loading partial templates with AJAX/PJAX

I am trying to load content using PJAX (basically AJAX with history). So far I have managed to catch PJAX requests and load the correct content. My problem is finding the correct template to use for ...
0
votes
0answers
25 views

ACF Post Object: Wrap every three post objects

How would I go about wrapping every three ACF post objects in a div? <?php if ( get_field( 'featured_posts' ) ): ?> <?php $index = 1; ?> <?php $totalNum = count( ...
0
votes
0answers
26 views

Redirect to different template other than single-custompost.php

I have a custom post portfolio . On test page there are featured images from the custom post When i click on the featured image a popup opens for each post and there is little description and a read ...
0
votes
1answer
54 views

optional parameter in permalink structure

Im currently facing an issue with the relationship between pretty permalink and my themes templates. I have a post type called 'performance', and with pretty permalinks enabled the URLs for the ...
0
votes
4answers
75 views

How can I use archive-{post_type}.php theme template?

I've got a staff_member custom post type, with 'has_archive' => true. I've got an archive-staff_member.php template, with /* Template Name: Staff */ In backoffice, to add it to the nav menu, I ...
0
votes
0answers
18 views

get_header() not defined after using template_include

I'm trying to load a custom template as part of a plugin that creates a custom post type. The template_include filter seems to work, in that it loads the file I'm aiming for, but when the ...
0
votes
0answers
16 views

Page with page template not using template in Preview

I am using a page template created by myself, which is showing and working correctly in page backend. It also works on the front end. The problem: Preview shows the normal "page.php" instead of ...
0
votes
0answers
29 views

Using require_once for parent-directory not working but is working in sub-directories

I'm building a custom theme and I'm attempting to use require_once __DIR__ . '/templates/variables.php' in my footer.php file, to keep from repeating code that contains variable information... I keep ...
0
votes
1answer
21 views

Display Taxonomies in loop with template args

I want to display the taxonomies within the loop but with customized template. Here is my code: if ( have_posts() ) { while ( have_posts() ) { the_post(); $args = array( ...
0
votes
1answer
57 views

HowTo: develop WP template with dynamic background image

Is there a way to develop a WP template which, amongst others, sets the background image of a certain element dynamically by choice from admin backend? Think of an page editor who simply picks an ...
0
votes
0answers
27 views

one category template for diferent <option> values and sub categories

I have the default category.php template and my categories structure is like this: category sub1 sub2 sub3 sub4 sub5 Now what I want is on each subcategory to add ...
0
votes
1answer
59 views

Creating a custom category page with pagination

The past week I've been trying to figure it out on creating a custom category page with pagination. I've tried in so many ways but I cant get the pagination right. If anyone of you can help. What I ...
0
votes
0answers
35 views

Pagination not working for custom category template and custom permalinks

I am using following code in category-20.php, for the pagination through ajax, which is working fine for the defaults permalinks. But when i change the permalinks to custom, then pagination doesn't ...