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
24 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
0answers
21 views

How to select a template for displaying custom post type

Hi i know how to implement post types list in any page or template in worpress using code . for example $args = array( 'post_type' => 'home_banner'); $loop = new WP_Query( $args ); while ( ...
0
votes
1answer
43 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
77 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
31 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, ...
-3
votes
0answers
11 views

How to load contents of menu items in a part of index.php and not in page templates or single.php

As you can see in the picture, I have a vertical menu in index.php and when clicking on each item in the menu I want the content of that page (menu item) to appear in a section in index.php and not ...
0
votes
0answers
27 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
27 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
99 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
21 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
89 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
86 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
10 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
19 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
24 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' ), ...
0
votes
2answers
63 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
40 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
37 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
40 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
44 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
16 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 ...
4
votes
2answers
132 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
25 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 ...
0
votes
1answer
63 views

Create dynamic content from one WP page to multiple other pages

I want to create dynamic content that is taken from a specific paragraph from one page and writes to a paragraph on multiple pages that feature that same content. I am new to PHP and not sure how to ...
0
votes
0answers
25 views

Parent to another Custom Post Type - Template files not being recognized

I have two custom post types - 'gaming-consoles' and 'xbox-games'. I also have two custom templates for these post types: single-gaming-consoles.php and single-xbox-games.php - which worked great. ...
0
votes
2answers
24 views

Create a free scripts and styles template within a plugin

Let me explain what Im trying to do. Im creating a plugin that will have a main page like a dashboard that will be used to manage the public facing side of the plugin. Just think like a separate app ...
0
votes
2answers
43 views

Wordpress Custom taxonomy template

I am trying to create custom template for custom taxonomy. For example i have a custom taxonomy registered in WP with name brands and slug brand i used following code to register custom taxonomy. ...
0
votes
0answers
23 views

Show child theme for users on specific IP

I have some users coming in from a fixed IP range on a very slow connection (256kbps) so want to server them a child theme that has a lot of the bandwidth intensive features removed. For ease of ...
0
votes
1answer
39 views

Best way to organize data in this scenario

My question is about data organization more than code, I hope it still has its place here. My site's main menu has an item pointing to a page called "Videos". This page has 2 main parts: The last ...
0
votes
0answers
46 views

Get Page ID of blog homepage

my start page in WP shows the latest posts. I added some meta fields to the start page in the WP backend which I want to access before the list of recent posts starts. I try to access the meta values ...
0
votes
0answers
19 views

Define meta fields in a page template

I had an idea for managing fields for page templates and I thought I'd post it here to see if (1) this is terrible and (2) if there's a better way to define the fields in the template. Here's the ...
0
votes
1answer
70 views

custom post type plugin - single template

I'm writing a plugin that creates a cpt. I can include a template for viewing a single instance of the cpt using the single_template filter. And have it look for a template overload in the theme. ...
-1
votes
1answer
78 views

How do you access the Product Short Description in a WooCommerce email template? [closed]

I would like to output the Product Short Description beneath the product name inside the order items table inside WooCommerce emails. I think I know where to place code inside the email template file, ...
0
votes
1answer
19 views

Display a post via template

I want to display a single post in the sidebar-area (not the sidebar itself) and can't seem to get it working. I know the post_id (it's 1571 btw), so I looked around and only found this link from 7 ...
0
votes
1answer
45 views

How to refresh a template page on Wordpress in 3 seconds - easiest method?

Basically, on my site I have content submitted via a search bar. I'm using a content-none template to detect if the user is signed in - and if so it submits a post programmatically (if the post ...
0
votes
1answer
38 views

How to call a certain object/menubar in a PHP file

I made a template and had some help with adding a CSS file to the template. Now I'm stuck on the question, how do I add a certain menubar to my header. Example: topbar - has menu with "Welcome ...
0
votes
2answers
54 views

How to add new CSS file to new PHP file

I've made a new template file for Wordpress constructing the elements of the page via PHP and Wordpress recognizes the template as such. Then I wanted to include a CSS file for said template (same ...
0
votes
1answer
29 views

Templates for Mobile Site

Is there any built-in method for displaying a different template based off of browser size device (i.e. mobile device detection)? I've done some research and all I can find is a ton of plugins that ...
0
votes
1answer
63 views

How to display only posts assigned to a particular, isolated, subcategory

I am trying to set up my wp site where I use posts assigned to categories and subcategories (about 3 levels). I have a list of 1st level categories as my primary menu. When clicked, the intended ...
0
votes
2answers
65 views

Page editor missing Templates drop down

Update: As with so many mysteries, the cause turned out to be extremely stupid. I had the file saved in a different theme's directory. Thanks to @a4jp.com I'm building a theme using underscores. I've ...
0
votes
2answers
50 views

Understanding the Template hierarchy

I've got a template called News. When I go to the Dashboard and edit the Page called News which has a web address of news.html I can see it uses this template (i.e. in the Page Attributes > Template ...
0
votes
0answers
11 views

Display posts: date of editing

I am from Russia and I have to use Google Translate. I'm sorry ) Does not think like me to build a loop to the pattern on the front page posts to be displayed on the date of editing. Top recently ...
0
votes
1answer
42 views

Redirect Every Instance of The Author Template Pages to Custom Author Pages

What I'm looking to do is actually a simple redirect, but for the EVERY page contained in the /author/ slug. The working slug I want to redirect to is /team/. For example, if someone were to type ...
0
votes
0answers
16 views

Category Template - to be editable from the backend?

I have different categories that includes posts of the category. I want to add text and images before or after the posts of the categories are displayed on the frontend. I want to solve this via ...
1
vote
1answer
69 views

WooCommerce: Add content prior to or after checkout form

I'm trying to produce a message to appear prior to (or after) the checkout form on the checkout page (Example: https://susieoshandbags.com/shop/checkout/). So I did the following: add_action( ...
0
votes
0answers
47 views

Submit form to another template (ugly url)

I've created a submit form with some filters that makes a query request: <form action="<?php echo get_template_directory_uri();?>/list-items.php"> my form here... </form> Created ...