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
1answer
32 views

Filter widget outputs

I've been trying to find a good solution for my problem, but I can't seem to find anything on this topic at all. I've got a custom sidebar, created by using register_sidebar and I've used wordpress's ...
0
votes
2answers
47 views

Child theme template file will not load

I have a child theme that will load my style.css file but will not load my php template file. I got this template file by copying and pasting it from the parent directory into a new file with the ...
1
vote
1answer
18 views

Conditional tags or Multiple files

If the official themes and Underscores are some sort of a guide, one would notice that multiple files with little differences are preferred over conditional tags (archive.php, search.php, ...
10
votes
2answers
654 views

To close or not to close php

I have read that it is advised (especially with php 7) to not close the php files with ?> Many of my WP php files end like this: <?php get_sidebar(); ?> <?php get_footer(); ?> ...
0
votes
0answers
17 views

Create page outside/without administration, inside theme

Is it possible to create a page/php-file (eg. schools.php) that is based inside my theme. And reached with the url: http://example.com/schools. And that the page uses WP system, so I can include ...
0
votes
0answers
20 views

Style only one category product different

I want my page of my categories, electronic, to be different from the other category pages. Is it possible? How?
-2
votes
1answer
119 views

<head> files disappearing from template

I have a site (link below), that every now and again, a bunch of the CSS of JS links in the head, simply disappear from the template (when i view source, they are not there). this of course means that ...
0
votes
1answer
20 views

Post not showing in my custom advanced search

I've created a custom-search-page for my theme that have to search in my CPT non-hierarchical taxonomy and eventually filter the results if some preference is inserted through the options form of ...
0
votes
1answer
36 views

Theme Dev | Convert Template to Theme

What is the solution in theme development for section in this template Home Page so user can edit from admin panel. "Main Features" Section, at bottom of slider, it says "Strong Structure", "Global ...
0
votes
1answer
42 views

Child theme Page Template not loading

I've currently setup a multilingual multisite. But one page isn't picking up the parents page template. Working: http://www.jeroenbrugman.com/contact Not working: ...
0
votes
2answers
18 views

get_month_link uses what wordpress template?

I tried using archive.php and category.php but always index.php is used of my template. How can I customize what template file is used?
0
votes
1answer
69 views

Load different single.php templates according to post layout selection

I have created a way of choosing different layouts for posts(sidebar right, sidebar left, full width). This is done through a meta box that displays radio buttons with an image for each layout type. ...
0
votes
1answer
34 views

Retrieve a custom form field modified by a filter

I use a 3rd party plugin that creates a form with some fields. I want to use one of these fields in one of my templates. Is there a way to do this? UPDATE I found a solution, see the accepted ...
0
votes
1answer
41 views

Splitting the_content() by size?

I have a situation where users don't want to format quotes in post body and want to just paste their content, assign a quote in a custom field, and the template will now render the quote when viewing ...
0
votes
2answers
17 views

Adding wrapper elements in the_date() like in the_title()?

So this works: the_title( '<h1 class="entry-title">', '</h1>' ); But this does not: the_date( '<h4 class="entry-date">', '</h4>' ); I don't know enough if this is ...
3
votes
2answers
70 views

Taxonomy Templates… by hierarchical level?

I'm wondering if there's a way to specify by filename different templates for different levels within a hierarchical taxonomy. I know about taxonomy-taxonomyname.php and taxonomy-taxonomyname-term.php ...
0
votes
1answer
16 views

How do you assign custom template for Posts page (under Front page displays setting)

How do you assign custom template for Posts page (under Front page displays setting)? Settings > Reading in backend. I notice once I set Posts page to specific page, the Template dropdown on edit ...
-1
votes
1answer
28 views

PHP Button Custom link [closed]

At this part of code of a wp template I want to change the permalink url of the "Book Now" button to custom link example: "www.mywebsite.com" byt_render_field("description clearfix", "", "", ...
7
votes
2answers
262 views

Why do templates contain so many PHP tag pairs?

I have some PHP experience, but hardly any WP theme writing experience...I'm just starting the journey. All of the themes I have looked at so far in the .org repository have code that looks like ...
0
votes
1answer
36 views

Loading a template for a URL pattern

I am creating gallery pages for events and csr-events custom post type. Now it has three types of pages: www.example.com/gallery www.example.com/gallery/events www.example.com/gallery/csr-events ...
0
votes
1answer
46 views

WooCommerce - Print Processing orders [closed]

On our WooCommerce webshop we have an PHP page that generates the processing orders. Now I need to show the SKU in the table, but I don't know how to do that :) Below is an example of the page as it ...
0
votes
0answers
100 views

How to call function in functions.php in external file inside same theme?

I'm trying to develop a theme by my self, in my theme, i have a function inside functions.php and a php file named ajax.php. i was trying to call a function inside functions.php in ajax.php, but its ...
0
votes
1answer
12 views

Cant pull in featured Image

I have 6 posts with a featured image set for each. I have created a template file called portfolio-template.php. I have set the portfolio page to use that template file. Inside portfolio-template.php ...
0
votes
1answer
59 views

the_content() not showing full posts in category template

i want to show the full posts in category archive page, i put the_content() in the category template (content.php) <article id="post-<?php the_ID(); ?>" <?php post_class( 'entry' ); ...
1
vote
2answers
80 views

Searching multiple tags and adding jQuery dependant script onto page template?

I have this simple javascript file for checking boxes in a tree view menu: treeview.js $(".acidjs-css3-treeview").delegate("label input:checkbox", "change", function() { var checkbox = ...
0
votes
0answers
30 views

Change menu order in Restaurateur theme

I have installed a theme called Restaurateur, which includes a "Restaurateur Menu Item CPT" plugin that displays a menu page with fast food categories and meals. When you load the site, all meals are ...
1
vote
1answer
56 views

Check if a menu is empty?

I have menus set corresponding to a custom field on a page. Ie I have menu1, menu2, and menu3 on three pages under custom field => MenuName. Under functions.php I have: /* Add Menu Locations */ ...
1
vote
1answer
33 views

Custom field value not saving when it contains a URL?

I implemented a custom field into one of my post formats called 'url'. When I enter a random string of characters into the field, it saves just fine and I display it in my template like this: ...
0
votes
0answers
26 views

Loop returns more items than exist?

Using the answer here: http://wordpress.stackexchange.com/a/207601/45709 exact works as it is intended. It returns 3 slides because only three slides exist. I had to slightly modify the code because ...
1
vote
1answer
40 views

How to loop over custom fields in a page template?

I was originally using a single field and things worked perfectly with the following code. Now I need to alter it to loop of several fields that are similar. To start: I've created several custom ...
0
votes
1answer
22 views

Template code to split a post and print a custom field?

So I want a blog post but in the center of every blog post I want to split the content and print a custom field attached to the blog post type. Ie you field called "Blog Quote" and the user will ...
1
vote
1answer
92 views

Override mini-cart.php from plugin

(Its not the cache thing) Im creating a plugin that among other things modifies woocommerce template files. Before i placed woocommerce overrides in child theme. But i want to move it to the plugin to ...
0
votes
1answer
61 views

Gravity Forms merge tags in templates?

Is there a way to put Gravity Forms merge tags in template.php files or other sections of the website? A plugin maybe? I need to retrieve a field value from one of my Gravity Forms and use it in the ...
0
votes
2answers
25 views

Problem retrieving custom field for a custom post type

I am using the code below in a page template. I have a custom post type of BOOK and there are 2 categories, author and contributor. My aim is to display the books in author category first, then ...
1
vote
0answers
19 views

Adding Page Templates to post but it ignored it

I follow the post to add the template metabox to a custom post type's editor, but it doesn't work. When I visit the post, it shows "NOT FOUND ANY POST" which looks like index.php or single.php ...
0
votes
1answer
40 views

How to set custom homepage via a plugin

I am developing a plugin movie database plugin and i want set few custom templates to wordpress theme using the plugin. how can I achieve this?
0
votes
0answers
10 views

List Taxonomy name of item with 2nd tax filter

I'm not even sure where to begin, or if what I'm requesting is possible. Here's the situation: I'm using a sermon plugin for a church website. (Sermon Manager). There are custom taxonomies for Series ...
0
votes
0answers
35 views

Display the post on page scroll and auto update URL

I have to create a page template on which I can show all the posts by category when scrolling down the page; here is an example. My theme index page code is: do_action( 'st_theme_init' ); ...
0
votes
2answers
81 views

How To Create WooCommerce Custom Template For Specific Product?

I know this may be slightly off topic, but this really is the best place to ask a question related to WooCommerce & WordPress. I've search high and low for an answer to this question and there ...
0
votes
0answers
26 views

How to decouple custom post types components from template?

I am in my early stage on learning wp development and tried something "simple". To manage some custom entities in my back-end and try to display them in front-end. So what i did was: Created custom ...
0
votes
1answer
31 views

!= and !== both not always working? [closed]

In multiple wp templates i use !== in a IF statement, but i found that this code is not working in 1 template. I changed it to != and now it works. My question is are both the same if statements and ...
0
votes
1answer
35 views

Locating the template behind a WordPress Page

Is there a way to tell from a WordPress page what template the page was built from. In my case, there's a page at mysite.com/checkout and I happen to know that the template used to build this page ...
0
votes
0answers
19 views

Author predefined templates

Is there some way in WordPress to "templatize" the page published by each author on the website? For instance, I would want each post to have a video compulsorily, and will be incorporating a YouTube ...
0
votes
2answers
24 views

Hide a specific post from a page template

I am trying to hide a specific post from a page template? Does anyone have experience with this, would prefer to not have to use a plugin. Was thinking of using wp_post ID but am unsure of how to go ...
0
votes
1answer
11 views

Editing the tag pages and using templates

Pretty simple question, but probably with a complex answer. I was wondering if there is a possiblity to customize a certain tag's page. I have a website where we I post music, and I tag the artists ...
0
votes
1answer
56 views

Define PHP variable from a seperate API if statement

I am trying to put together a function that will echo certain text based on a range of numbers. One of number(s) I am trying to compare against is echoed in my template as such -- <?php if ( ...
0
votes
1answer
19 views

Displaying a list of Contacts

I would like to list contacts, and I'm unsure how I should do this. Which method should I use "Theme Customization API " or "custom post type"? My contact page would look like this: <h1>Title ...
1
vote
1answer
36 views

Use touch_time() on front-end form via plugin

I'm working on a plug-in that let people create posts from front-end form. I want to add date&time fields in the form using touch_time() but don't know how to use it on front-end. I have <div ...
0
votes
1answer
26 views

Add pagination to a template loaded by query variable

I have set a query_var,called men, which loads a custom template displaying men's clothes. The rewrite rule is as follows: ...
1
vote
4answers
95 views

WordPress Template Hierarchy

Hi I have question about file names. If I have custom post type, and for template I can create for example single-portfolio.php and get content of portfolio posts into this file, but i need to get ...