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

Wordpress Fatal error: Call to undefined get_header() in index.php on line 15 [closed]

I downloaded a wordpress theme recently and i tried to run it but it gives me an fatal error shows that call to undefined fatal error(). Why this error generates ? I am a new bie to wordpress theme ...
4
votes
1answer
40 views

Executing Queries in tag.php

I'm probably being dense, but I can't seem to figure out what the issue here is. The site I'm developing uses a custom loop, with a query that excludes any posts ticked as archived. The reason I ...
0
votes
0answers
14 views

change template by permalink endpoint via plugin

I'm trying to change template using this code: add_filter( 'query_vars', 'add_query_vars'); function add_query_vars($vars){ $vars[] = "photos"; return $vars; } function ...
0
votes
1answer
51 views

How to customize search result page title?

I would like to customize the page title of the search result page: from: <title>Search Results for “search string” – Page 2 – Sitename</title> to: <title>“search string” result ...
1
vote
1answer
32 views

Get WordPress to use another custom “author.php” file (“custom-author-file.php”)

currently, this example code in WordPress: <a href="<?php echo get_author_posts_url(get_the_author_meta('ID')); ?>"><?php the_author(); ?></a> turns into: <a href="http:/...
0
votes
0answers
46 views

Make shortcode work in all posts displayed by loop, not just the first one

I have a post archive displaying post and author meta at roadtripsharing.com/road_trip I added a do_shortcode(); in the loop, specifically related to the "New Message" button which opens a dialogue ...
1
vote
1answer
506 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 ...
0
votes
1answer
19 views

Remove “ Browse Category : ” from Archive title

I have the Shaped Blog theme and I try to remove "Browse Category:" from my Archive title. I look in the code and found in "template-tags.php" this code : ` //////////////////////////////////////...
0
votes
1answer
41 views

Custom post type with two templates

I have a custom post type with an archive-my-post-type page and now I need a second archive page without header and footer and with a custom content. So my question how can I create a second page ...
0
votes
0answers
80 views

Override template hierarchy

add_filter( 'template_include', 'my_callback' ); The above filter returns which template is there and what will be used, but i need to have all tries for finding template in template hierarchy. For ...
1
vote
2answers
82 views

if ( is_home() && ! is_front_page() )

I see the following code a lot in index.php files. I understand that is_front_page() returns true when viewing the Site Front Page (whether displaying the blog posts index or a static page), while ...
4
votes
2answers
651 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
645 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
3answers
658 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
1answer
26 views

Custom taxonomy returns 404

I'm getting a 404 page when I visit my custom taxonomy page. Custom taxonomy is called 'manufacturer'. I also have a cpt called 'product'. EDIT 1: It has something to do with the cpt rewrite. If I ...
2
votes
2answers
549 views

Get image URL from media library in input

On wp-admin/post.php?post=447&action=edit for example I have a link and an input. The link appears as follows: <a href="#" class="button insert-media add_media" data-editor="tj_image_url" &...
14
votes
5answers
8k views

How to rearrange fields in comment_form()

Im using a custom filter to change the fields, but can´t figure out how to change the order of the fields in the comment form. Desired order: comment field (first/top) name email website This is ...
0
votes
1answer
34 views

Archive for a Taxonomy of a Custom Post type

I have a situation like this: /disrupt-founders/disrupt-categories/help-me-be-healthier/ What I am wanting to do it create an archive page that is unique for the Taxonomy based on the Custom Post ...
0
votes
0answers
10 views

Short description under my content images MH Magazine Lite

Originally comments and the date the content was published was displayed under the image of my content however I used this code to change it to a short description. However only some of the ...
0
votes
1answer
28 views

Single Post Templates Doubt

While I was reading template hierarchy. The single post template file is used to render a single post. WordPress uses the following path: single-{post-type}-{slug}.php – (Since 4.4) First, WordPress ...
0
votes
1answer
31 views

What template is used for viewing Media Library Files?

I would like to create a special page template in my theme for viewing the media library files. Currently, when I click a Media Library image file I get a page template from the parent theme. Does ...
1
vote
3answers
89 views

How to load different CSS in different Header?

I have two different files for the header in my theme. These are header.php and header-full.php. How can I load different CSS in different headers? I enqueue my CSS files in function.php like this:
0
votes
0answers
12 views

Wordpress Bootstrap menus shifted to the right

Here is m development site url. development.lauterbachgroup.com as you can see the drop down menus are shifted to the right by what seems like a fixed amount. I have a solution to fix the issue by ...
1
vote
2answers
130 views

New template, where to place CSS?

Till today I never used header.php and footer.php because my theme has multiple templates and I do not know how or where to place the CSS and JS files. Could someone please explain how to have a ...
5
votes
4answers
2k views

Print WordPress template filename(s) for debugging

I've taken over the maintainance of a large WP-MS powered site. The site has ~200 templates, many page specific, and with no standard naming procedure. It would save a lot of time if while surfing ...
0
votes
2answers
1k views

Custom Post Type with Nested Taxonomy and Template Files

I have a custom Post Type of "Portfolio" with a rewrite slug of portfolio. So the URL on the frontend is: domain.com/portfolio. I have a custom Taxonomy of "Categories" with a rewrite slug of ...
4
votes
3answers
42k 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
2answers
33 views

Hard Coding Components on a Client Specific Websites

This is something I have been meaning to ask for a while to get some feedback. If you are creating theme template files for a client and you know what needs to go where e.g. buttons, logo, component ...
0
votes
1answer
25 views

Automatically use specific template to load subpages

I have a page called Joinery and when open some new pages where I set that their parent is Joinery (under Page attributes), I would like to set Wordpress to automatically use file page-joinery-...
1
vote
4answers
737 views

Flush Rewrite Rules when new site is created on network

I am working with a multisite setup and I have created some custom post types, which seem to work fine except when trying to view any of the post types pages on the front end, I get a white screen. ...
0
votes
2answers
35 views

Custom Post Type tag taxonomy “Page Not Found”

I have a custom post type that looks like: register_post_type( 'letters', array( 'labels' => array( 'all_items' => __( 'All Letters', 'text_domain' ), 'name' => __( '...
0
votes
1answer
387 views

Add Previous/Next Buttons to CPT Single Pages Only

I'm working with a site that is displaying a portfolio CPT on the home page in a "Grid Loop." On the single pages, i'd like to add Previous & Next Item buttons. I thus added this code: function ...
1
vote
1answer
56 views

Genesis + Ajax + Jquery | Failling to call action

I want to execute an action, without realoading my page. I folllow this tuto https://codex.wordpress.org/AJAX_in_Plugins But each time my page reloads, and I can't have the result value. Here is my ...
1
vote
1answer
37 views

How do I find out the full path of a page's template?

If I run the following query on the WordPress database, I get a list of templates: select distinct(meta_value) from wp_postmeta where meta_key='_wp_page_template'; The templates that come back are ...
0
votes
1answer
372 views

Assign template to edit address form, billing and shipping (woocommerce)

By default, woocommerce has endpoints for editing billing and shipping addresses. You just have to go to my-account/edit-address/billing/ or my-account/edit-address/shipping. What I want is to use a ...
1
vote
1answer
68 views

Meta description - template code to get category description

Below is the code I wrote for header.php so that the description for a product category can be obtained and used for the <meta> description tag when viewing such a "page" on the site. Is ...
0
votes
0answers
41 views

Load WordPress templates with jQuery load()

I'm working on a dynamic menu that slides up and down when you click on a list item in a secondary menu and it's closed when you scroll or press the 'X' button. The list is declared like this in the ...
0
votes
3answers
53 views

Should template files be copied to the child theme for editing?

I know that the style.css file needs to be copied to the child theme before being edited for changes. Is that also true for template.php files? If so, do I need to just copy the specific template ...
1
vote
2answers
16k views

Show Woocommerce minicart widget in checkout page sidebar? And, how to make this update secure by overriding widget?

Before asking question here I want to tell that I have already asked the question in stackoverflow and wordpress forum but have not got any answer. So finally I came here. I have installed the ...
0
votes
1answer
609 views

Why won't the action hook wp_head accept parameters?

I'm working on a plugin that adds scripting to the head using add_action('wp_head',..); I have to pass a variable to the function to get my desired result. To test this I'm simple "echoing" out ...
0
votes
0answers
24 views

How to add comments on a custom page with URL parameter?

I tried to look for this for several days but I can't find anything. Maybe I'm not using the good "words" so I hope someone we'll guide me in the right way. I am building a custom page with a list of ...
-4
votes
1answer
46 views

Slider widget not displaying the caption for images

Here is my code for the slider.The place for a caption will appear blank above the image. <div class="slide-caption"> <div class="slide-data"> <a href="<?php // ...
0
votes
0answers
44 views

Submit a Custom Post Type in WordPress from the Front End in Every Category

I want a front-end submission form in my WordPress website. Where this form should be available to each category? I want only two things in the form namely post title and post content. Is there ...
0
votes
1answer
13 views

Access or edit custom generated permalinks with WP_Rewrite

I want to create custom permalinks for my plugin using WP_Rewrite. I found the codex the have great examples and this stack topic also explained a lot to me. Currently I've got the following code ...
0
votes
1answer
39 views

Page template gives 'Parse error: syntax error' when used, but no error found!

I get this message, whenever I activate this page template for one page, for instance about.php : Parse error: syntax error, unexpected end of file in /home/u425744603/public_html/wp-content/...
0
votes
2answers
28 views

Wordpress Child Theme Template auth_redirect wrapper

I'm successfully utilizing a child theme in Wordpress. I would like to create a page template that simply forces login for any visits to the pages where this template is in use. (Simply need to add &...
0
votes
3answers
29 views

Custom Content Page

We've made a whole lot of templates for different types of blog posts. However, we also want to do fully custom 'power pages' that do not follow the WordPress theme we are using. These pages would be ...
0
votes
1answer
41 views

How to echo a plugin's function into a template?

I've tried checking for a similar question but couldn't find one. If possible please link me to this as I might be creating a duplicate. Anyways.. I am using a basic testimonial plugin (Clean ...
-3
votes
1answer
36 views

Create a shortcode to display the “the_content ()” in my post [closed]

I should create a shortcode to display the contents of the post in my template. Could someone help me? I made a shortcode to display the form of comments, this just can not unfortunately. Thanks ...
1
vote
1answer
68 views

Updating category template to change how subcategories display

I'm looking to update my category template to display subcategory posts differently than category posts. I'm fairly new to Wordpress template editing but know HTML/CSS well, and PHP enough to ...