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
11 views

How to fix missing information in a wordpress feed?

I am a new wordpress developer maintaining an existing site. The site has a custom template. If I go to mysite/mytemplate/feed I get a feed of that template -- except that one of the fields is empty. ...
0
votes
3answers
64 views

How can I see what template parts are being called for rendering the viewable page?

I have a theme where the developer used get_tempalate_part() a lot, and these parts are scattered across theme subdirectories as well as in directories in a plugin that was created to assist with the ...
0
votes
1answer
27 views

more tag in the $post->content when get_pages were used

I used get_pages() to get the content of the child pages of a page. Although the excerpt can also be an answer but is there any other way to display the contents of the page before the more tag when I ...
0
votes
1answer
35 views

Multiple pages to show posts

I don't have any code or pages to show yet so I'll just have to describe my question. I have group of posts, no categories or taxnomoy yet. On my home page I have a 'View all posts' link that is ...
0
votes
1answer
46 views

How to finish this loop?

I had already asked a question of how to get only get the child pages of a parent page that belonged to a certain taxonomy. A very helpful user gave me the answer to this, however, I was not provided ...
0
votes
0answers
82 views

Include Wordpress Page in TWIG Template File

A programmer recently converted my Wordpress site to the TWIG engine and I am having a great deal of difficulty trying to include the contents of a page in the template. Below is my TWIG file for a ...
0
votes
2answers
13 views

Get markup for post without loading into the template

I am writing a shortcode plugin that displays posts according to some parameters passed into the shortcode. I have the wp_query to get the posts and now I am trying to get the markup for the posts ...
0
votes
1answer
28 views

Is there an action hook that fires just before a template is loaded?

I'm looking for an action hook that occurs just before a template is parsed but AFTER the query has run and the variables are present. So if it's going to run index.php, just before it starts reading ...
3
votes
1answer
140 views

How to stop wordpress to make the default query?

My goal is a redirect to a custom template based on some new rewrite rule, but without having wordpress to make unusefull queries. my code: function add_rewrite_rules() { add_rewrite_rule( ...
1
vote
3answers
8k views

How to insert a logo in the header?

I am pretty new in WordPress world (I came from Joomla) I am finding some difficulties to insert a logo into this WordPress test site: http://onofri.org/example/ I want put my logo in the header of ...
0
votes
1answer
48 views

Setting a homepage - doesn't seem to work

have a page (home) that runs a template page-home.php that I can access at mydomin.com/home. I am wanting to have this as my static homepage page, so accessible at mydomain.com/ however I cannot seem ...
-1
votes
1answer
17 views

Tag page that displays specific posts

How would I go about coding a generic tag.php page that displays all the posts with a specific tag? For example, if I navigate to example.com/tag/your-tag, it should display all posts with the tag ...
0
votes
2answers
94 views

Display posts of child category in template

I have a custom post type called freebies. I want to use the archive-freebies.php for the child categories also. I have added in my functions.php the following: function inherit_template() { if ...
1
vote
1answer
44 views

How WordPress is able to change locale without using setlocale

In my plugin I print out the current locales via $originalLocales = explode(";", setlocale(LC_ALL, 0)); var_export($originalLocales);die; Obviously the result is same as the WPLANGdefined. ...
0
votes
0answers
25 views

How to include and handle more or less static text blocks/columns in a template

I have a front-page.php template, which contains dynamic content pulled from custom post types (like dates and quotes) but also more or less static text blocks in several sections alongside. The text ...
0
votes
1answer
161 views

How to set global variables in template page?

I know this works. In functions.php do: $variable = "value"; and in header.php use: global $variable; echo $variable; Is it possible to set a global variable in template page or include php ...
0
votes
1answer
85 views

How do I display two separate taxonomy archives for two post types that share a single taxonomy?

I have a custom content type, "products", which shares the category taxonomy with posts. We're using posts to discuss and review products. The idea is to have two separate URLs: ...
1
vote
2answers
246 views

“Issues” loading MANY featured images on a single page (custom template)

I have a page that loads a lot of featured items in a grid. There are up to 56 images loading, and it does have a bit of a delay. This is the code as it runs now: if( count( $postslist ) > 0 ) { ...
0
votes
0answers
53 views

Plural/singular URL schema challenge for section Page template combined with single Custom Post Type template

I'm coming back to WordPress after quite a hiatus (and it's not my normal CMS framework), and I'm working with custom post types for the first time. I'd like to have 2 page templates that support ...
0
votes
1answer
99 views

Get template part vs locate template function

I'm in single.php where I'm trying to get related-posts.php template. The problem is that when using get template part the related-posts.php isn't getting custom taxonomy name from single.php in ...
0
votes
2answers
35 views

Developer plugin to echo template names/filepaths [closed]

I am looking for a Wordpress plugin that prints file template names, maybe with a designating border. Magento has "template hints", as you can see in this screenshot: If there is not such a plugin ...
0
votes
1answer
28 views

Making plugin output customizable

I am writing a plugin that will display a timeline of historic events, and I am looking for ways to make the output customizable. I was considering including a template/example within the plugin ...
12
votes
5answers
5k views

single-{$post_type}-{slug}.php for custom post types

My favorite part of the Wordpress template hierarchy is the ability to quickly create template files for pages by slug, without having to edit the page in Wordpress to select a template. We can ...
0
votes
1answer
32 views

A page created with url of blog redirects to the posts page, how do I stop this?

I have a simple site where I want to handle blog posts with a custom page template. So I've created a new page called blog with a document url value of "blog". My custom php template page was ...
0
votes
0answers
21 views

Cookie free site

I have followed directions to make my wordpress cookie free. I've made my subdomain, pointed to my php folder and now I'm stuck. What am I suppose to do with this: bloginfo ('template _directory') ...
0
votes
1answer
42 views

Load different template for CPT (in loop) in my plugin?

I'm writing a plugin that register a new CPT named "sec-feature". In the following loop in my index.php, I want to load a feature-template.php for this CPT posts. But get_template_part just locate for ...
3
votes
2answers
652 views

How to prevent execution of default query, while preserving ability to use WP_Query in template?

PROBLEM: I'am trying to prevent execution of default WordPress query for custom category template. I have found a possible solution, but looks like it preventing execution of all post queries: ...
0
votes
3answers
85 views

How to publish a Page and Posts using single template

Does anyone know how to structure a WP template in the loop by: Publishing the page content on top, immediate followed by certain category posts underneath the page content? Seems like it should be ...
0
votes
0answers
33 views

Adding The Post Template Dropdown to WP-Admin

I'm developing a WP theme from the ground up for the first time. Having build WP sites before, I know there to be an option in Posts that will allow for the selection of a specific template. I have ...
0
votes
2answers
181 views

Use meta boxes inside an archive page template for Woocommerce

I'm creating my own Wordpress theme, and I'm trying to make it compatible with Woocommerce. I understand pretty much everything about theming woocommerce, including copying the template files and ...
0
votes
2answers
47 views

What is the most efficient way to create multiple versions of the same template?

I am currently building a WordPress theme that will give users the option to select different layouts for the same template. This will mainly pertain to the home and blog page. I'm thinking like one ...
0
votes
2answers
191 views

the_content of template page

When I use the_content in the page-template doesn't show anything. Loop to call the page-template in the index: index.php <?php /** * Main template file * * This is the most generic template ...
0
votes
0answers
39 views

Posts page template: How can I edit the markup for this?

I have in settings->reading changed the front page to display a static page. One for home, one for news with a custom template for each. Home works fine, however News will not change no matter what I ...
0
votes
1answer
711 views

Display custom widget value in header.php

I am using the code below for a custom widget. I have added some fields in the widget like: Title, Name and a checkbox. Now everything is fine but I want to show those values in header.php. Any idea ...
0
votes
1answer
72 views

Get URL of current post but not the page number

Instead of using a plugin, I am manually adding buttons into my template file, like so: <div class="fb-like" data-href="<?php get_permalink() ?>" data-width="100" data-layout="button_count" ...
0
votes
1answer
40 views

Category Templates for Post Types not Working

I came up with this in the codex in order to set my template for a specific category post. I have a category name called "Work". The slug for this category is "work". I created a "category-work.php" ...
0
votes
0answers
116 views

How to show blog post details on a different page?

I have currently made a template to list my blog posts <?php /*template name: Figures */ get_header(); ?> <?php nectar_page_header($post->ID); ?> <div class="container-wrap"> ...
0
votes
0answers
20 views

Auto-Create Pages from Template Directory

Is there a way to have WordPress automatically create static pages from all of the template files in a given directory? So rather than manually creating custom page templates in the WP dashboard, I'd ...
0
votes
0answers
25 views

Use custom posttype archive template for its related taxonomy term page?

I have a custom posttype "Mypost" which has taxonomies tax1, tax2. I want to use the "Mypost" archive template for the tax1 and tax2's term page. How can I do this?
0
votes
2answers
1k views

Why is my taxonomy template not shown?

I have created a custom taxonomy for my site called projects with a matching template called taxonomy-projects.php. The problem is that when I browse to http://mysite.com/projects the template is not ...
0
votes
1answer
187 views

Apply nextgen-gallery lightbox effect [closed]

I wrote a Template which uses custom-fields via WP-MoreFields plugin. And there I add an image. In my template I display that Image like this: <? echo wp_get_attachment_image( get_post_meta( ...
0
votes
0answers
15 views

Looping through a custom query makes WordPress assume another template [duplicate]

I am calling this code from my custom sidebar, in order to get related postings from the same category: query_posts(array( 'cat' => get_category_id(), 'showposts' => 5, 'post__not_in' ...
0
votes
1answer
348 views

Change wp-signup.php Page Template

I am using anti-splog on a multisite network with the randomly changing signup URL feature. Under the hood, it is pointing to wp-signup.php file. I created an override file the plugin looks for by ...
2
votes
4answers
2k views

Change page template programmatically ?

I have two page templates and Qtranslate installed. I want to choose one or another depending the language selected. Can I do something like this ? if($q_config['lang'] == 'en'){ // load ...
0
votes
1answer
141 views

Problem with custom page template and permalink

I created custom page template for news template_news.php with name template name: news and i created a page and configured for that page also i set permalink to /news/%postname% also i set ...
0
votes
0answers
26 views

Wordpress templates bug

I have a WP problem that's driving me crazy. I have created several templates, and it decides to switch them all the time... I think it does when I create a new template file, but it never did that ...
0
votes
1answer
67 views

Ajax Call in page theme not working?

Ok, i am VERY new to wordpress (2 Hours new). I am creating a page template, which works fine, but this is the issue i am having: In the template.php file, i have this code: <script ...
0
votes
4answers
363 views

How to access .html file that's located in the theme folder from the browser?

By default you cannot access a file inside the theme folder directly from the browser, what changes should I make to make an exception?
0
votes
1answer
20 views

comment files and s

I am building a custom template and would like to incorporate comments and replies using the standard WordPress core. What files and scripts do I need? I copied a comments.php file but the replies ...
0
votes
1answer
49 views

List all native posts in template page?

I've created a page template and I want to do a really simple task: List all (native) posts I have this code inside the template-file: $args = array( 'posts_per_page' => -1, ...