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
2answers
968 views

Custom templates folder

I created a custom folder ("/templates") and I put all of my template files in the folder. instead of root ("/wp-content/themes/my-theme/"). It works fine. Do I have to add some function for ...
0
votes
3answers
37 views

How to create custom layouts and static pages in themes for clients

How do I build goodlooking, custom pages into my themes. I've decided to use underscores to create custom client themes, as I need complete freedom in design, and all the tutorials I've found on theme ...
0
votes
0answers
20 views

WooCommerce how to get attribute slug by variation id? [on hold]

Is there a function to get the slug for a given variation_id? In the wp admin back-end: For a custom post type I'm able to attach a related wooccommerce product to the post through a custom field, ...
0
votes
1answer
710 views

How to retrieve depth of menu into template

In wp_nav_menu i use for the menu, with custom walker, i can get the $depth parameter in the start_el function function start_el(&$output, $item, $depth, $args) but, outside this ...
3
votes
1answer
42 views

What is best way passing variables to theme templates and using them different places like widgets?

I have a template file at /parts/template.php which contains a post listing code like, echo get_the_title(); //same lines with my_render_function and i am using it at archive.php with this lines. ...
1
vote
1answer
574 views

Cannot edit style.css from admin panel, because the template is looking for style.min.css

I am trying to edit the style.css file for a Wordpress theme, however the changes I make (via admin or ftp) are not reflected on the site because that is using style.min.css. It is very cumbersome ...
0
votes
1answer
22 views

How to add custom 'layout' buttons to wordpress editor?

I'd like to modify the editor by adding some 'layout' buttons. Ideally, I'd like to add the ability to add some html 'partial' by simply clicking a button. This is to help my client to create ...
0
votes
0answers
9 views

How to set the template of a page created via plugin with template inside plugin

I've been trying to make a plugin that creates a couple of pages and then sets their template. This issue is that I have the templates inside the plugin. To create the pages I'm using: $post = ...
0
votes
1answer
434 views

Advantages of wordpress theme vs wordpress as a backend only

I've been wondering what would be the best option: Creating a wordpress theme Using wordpress only as backend and using a MVC framework for the rest I've never worked with wordpress themes ...
0
votes
3answers
81 views

How to move page template to custom folder?

I created page template by uses slug, for example, page-contact.php, page-gallery.php and other. How i can move this templates to one folder, for example /theme/temp/...?
-1
votes
0answers
11 views

get_user_level in Front End Only Users

I'm using a plugin called Front End Only Users and I would like to use php to get a user's level so I can conditionally show hide information in a custom page template. I know I can use shortcodes to ...
0
votes
1answer
25 views

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

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
32 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 ...
2
votes
1answer
2k views

Shared Content but “Updatable” Through the Main Site

I have been doing quite a lot of research the past week, and have not been able to find a solid answer that fixes my problem. So, I decided to come here to ask to see if anyone knows of how to help ...
2
votes
2answers
3k views

Passing parameters to a custom page template using clean urls

I am now passing parameters to a custom template in the following format www.example.com/?pageid=12&rid=24&title=this-is-the-title I have created two tables . So I need to fetch data and ...
0
votes
4answers
2k views

Create single.php for specific category by category id

I'm trying to create template for specific category with id 1 for example. The template should be applied to all of the pages belongs to this category. So, it should be something like single-1.php. I ...
0
votes
0answers
12 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 ...
1
vote
3answers
5k views

Customizing get_the_excerpt() to specific length and “Read More” output.

I am costuming a template. There is a list grabbing the introduction from the first 1-2 paragraphs (all the articles from a category). If I set the excerpt to 295 words, sometimes the list grabs ...
0
votes
1answer
29 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
25 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 ...
0
votes
3answers
906 views

Category link redirect to custom template page instead of index.php?

I want to make template page for my custom taxonomy. I have custom taxonomy categories listed as navigation links. It's the country list (China, Slovenia, Serbia...). Every of this categories has ...
0
votes
0answers
37 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
330 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
15 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
35 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
76 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
41 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
613 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
588 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 ...
10
votes
4answers
25k views

Can I assign a template to a custom post type?

can I assign a template file to custom post types? I have created a custom post type called items, and I would like to assign templates to the items like you can do with pages.
0
votes
3answers
562 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
23 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
539 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
7k 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
26 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
28 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
75 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
11 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
125 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
40k 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
30 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
22 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 ...
1
vote
4answers
719 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
33 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
378 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
44 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 ...