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
0answers
20 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
28 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
0answers
15 views

How to include variables or arguments to woocommerce completed order email

I'm trying to access a variable in woocommerce completed order email template. which is located in woocommerce/templates/emails/customer-completed-order.php WooCommerce is including emails template ...
0
votes
1answer
27 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
14 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
43 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
19 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
15 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
22 views

Events Manager's events-list.php uses wrong template [closed]

After switching permalinks from "Default" to "Post name", Events Manager starts somehow using blogs articles list instead of custom events-list.php template.
0
votes
0answers
19 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
44 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
45 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
12 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
12 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
18 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
19 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
36 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
17 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
39 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
21 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 ...
3
votes
1answer
55 views

Limit number of pages that use a specific template?

I have a custom page template, so a .php file in my themes folder with this at the beginning /* * Template Name: MyTemplate */ Now I can, in the WP backend, create new pages and select this ...
0
votes
1answer
26 views

New custom nev not working

I am suffreing from an issue from last few days. I have to create a custon nev calls ribbons, that will have some custom functionlity but at the starting steps I am not able to create the nev pages. ...
0
votes
1answer
17 views

I have index.php and other files, how do I display other pages?

I'm converting an HTML theme into WP. I have index.php, header.php, footer.php, which are from HTML. Then I created pages from within admin area like about-us etc. Created a menu and linked those ...
0
votes
0answers
14 views

remove file plugin include

i use a plugin that include template.php file , i want to replace this with a new one in my template directory or remove it class jqueryTimelinrLoad { public function shortcode($atts, ...
0
votes
1answer
22 views

Register Page Template from Plugin

I'm trying to figure out how to properly register a page template (and all of the associated assets, like CSS and Images) from a plugin. Basically, I've created a landing page that I want to live ...
0
votes
0answers
36 views

Using “setup_postdata” with “get_template_part” does not work

I want to reuse code made in a template in a shortcode. I did this in my shortcode $args = array(...); $posts = get_posts($args); for ( $j=0; $j < count($posts); $j++ ) { ...
0
votes
0answers
25 views

Changing page's name after page creation

I have a page, I can't know the name of the page before doing an elaboration with PHP, i thought about changing the page name with javascript after discovering the page name, I have not written the ...
0
votes
1answer
82 views

Convert HTML5/CSS3 site to Wordpress Theme (need a lot of plugins) or just use the API?

I'm a PHP developer creating a new site with a Wordpress backend. I'm niota Wordpress expert, I've managed to make custom page types in the old site's theme and can manage plugins etc but I'm not an ...
3
votes
2answers
122 views

A special single page templates for posts under a category and all its child category

I have a blog in WordPress. I have multiple categories. I want to use a specific layout for all posts under a category and all of its sub categories. Example : My categories organized as bellow. ...
0
votes
0answers
52 views

Assistance with complex query based on ACF Post Object Field

I got the following scenario: Two Custom Post Types: Game Bonus Two Custom Taxonomies (Not Hierarchical ): Game-Type (Poker, Roulette, BlackJack, etc') Bonus-Type (Free Credits, Free Spins, ...
0
votes
0answers
34 views

Custom Homepage As Single Page or Custom Post Type?

Conceptual question for the WP community: I need to implement a custom homepage for a new site. It has some custom stuff going on but nothing too crazy: 4 big images, a carousel, some calls to action ...
-1
votes
1answer
16 views

What happens to bespoke page template references on theme change?

Apologies if this has been asked before, I have searched for an answer but perhaps aren't quite using the correct terminology. I have inherited a WordPress site that uses a custom theme. Within the ...
0
votes
0answers
43 views

Using get_template_part() to modify single.php for a custom post type

I have a custom post type plugin called shows that has custom meta such as host, time, length, etc. I want to make it theme independent and require minimum coding for it to work across a lot of ...
-1
votes
1answer
23 views

2 Categories using same template but one has a problem? [closed]

There are only two links at the top. Sims4 and Sims3. The Sims 4 page is not lining up the posts correctly but The Sims 3 page is. They both use the same template. Why?
0
votes
3answers
331 views

Change template for single product page, Woocommerce

I know there is a posibility to change the structure/design of the product page by editing the file "single-product-php" - in a child-theme. The changes made of that file will affect all the product ...
0
votes
1answer
24 views

Make child taxonomy categories use a set template

I have a custom taxonomy called product-categories. Currently all categories use the master template (taxonomy-product-categories.php). The category tree is roughly as follows. Products - Cheese -- ...
0
votes
3answers
103 views

Custom Post Type homepage template

This is what I want: I have made a Custom Post Type in my theme and it shows in my home too, but the problem is that tha CPT takes the same elements and style of a default post in Wordpress, how I can ...
0
votes
1answer
94 views

Choosing different templates for categories

I was searching about changing the default template of the categories in WordPress, I saw the codex which says that the only way by making a new file with the slug or the ID of the category, like this ...
0
votes
1answer
11 views

Page template for a site from network

Is there a way to dispay in the Wordpress admin distinct templates based on which blog you are ? Let's say that for the blog travel I have the page template page-travel.php. How can I hide it on all ...
0
votes
0answers
21 views

Home page template changing on modification from random pages

I'm currently having a major problem using wordpress 3.8.1. Whenever I'm modifying a page, the template on the home page changes to whatever the template of the page I'm modifying is. Home page as its ...
0
votes
0answers
33 views

Child pages in a Custom Post Type are appearing blank

I've registered a CPT with the following: function create_client_post_type() { $labels = array( 'name' => _x( 'Clients', 'Post Type General Name', 'text_domain' ), ...
-1
votes
1answer
77 views

How to create custom page templates with default page layout framework?

I'm writing a custom theme. Most of the content will use the regular index.php, header.php and footer.php. The index.php looks like <?php get_header(); get_sidebar(); ?> <div ...
0
votes
1answer
42 views

Show posts from all categories

I have a site with 5 different categories, each of them with a notices section. I would like also to have another section to see the latest notices from any category. So far, I figured out that I can ...
1
vote
2answers
52 views

How to check active theme is parent or child wordpress

I am working on a plugin in plugin. I make template folder and in template folder and there are files of plugin that shows my post type data. First Scenario When user activate my plugin the template ...
1
vote
1answer
46 views

Template for all categories of a custom post type?

Hello ladies and gents! I'm hoping you can help me with this one.. if it's each possible. I (ideally) need a general template for the categories of a custom post type. Custom post type: Listings ...
0
votes
1answer
63 views

how could I load a different template part by page

I would like to use get_template_part(); to load a different template parts on different pages. so on the home page it loads get_template_part( 'content', 'home' ); and on the blog page it would load ...
0
votes
0answers
18 views

creating one page theme but templates are not being applied to page content on the “one”page.

I am creating a one page theme. I have a loop that puts the content from each page on a single page but it does not apply the temple for each individual page. Here is the loop I am using. <?php ...
5
votes
2answers
162 views

View WordPress page template usage (or unused)

When I create a new page within WordPress, I have the option of specifying which template to use from my theme (from a dropdown list on the right-hand side of the interface). I need to find which of ...
0
votes
0answers
33 views

How can I stop the content template from grabbing media files?

I am running Wordpress 4.2.2 on localhost Mac OS X Yosemite. I am developing my first theme using underscores, and I am having a problem with the php content loop. I am using the ...
0
votes
1answer
29 views

When to use content-pagename.php?

I have seen themes using content-pagename.php in many themes. This file is usally used by get_template_part function. Also, pages are named as page-slug.php or page-id.php. However, I am not clear ...