The Stack Overflow podcast is back! Listen to an interview with our new CEO.

Questions tagged [templates]

Within the context of WordPress Theme-ing, the term 'template' refers to PHP files used to display content.

Filter by
Sorted by
Tagged with
0
votes
1answer
21 views

How do I get the page template name chosen?

I'd like to modify the admin so the default text editor is removed whenever someone is using the default template. (If they manually choose something other than the default, keep the editor). if ($...
0
votes
0answers
17 views

Add rewrite rule for custom page template

When we add a rewrite rule to create an endpoint and then redirect to a custom template, by default Wordpress sets the body class as a post. Is there any way to create an endpoint without having to ...
0
votes
0answers
39 views

Change Jobs for Wordpress templates

I'm using the Jobs for Wordpress plugin to post jobs on my clients website. I'm trying to change the templates so I can use my own style and layout, but I can't change the layout and position of the ...
0
votes
0answers
13 views

Show template notice instead of reply form when user is logged out

When using the shortcode [bbp-reply-form], how do I display a template notice in the place of the form, like “You must be logged in to reply to this topic.”, when the user is logged out? Its only ...
0
votes
1answer
25 views

how to do Thematic like this website using wordpress?

i'm building a wp site about nuclear conference, and want to make this "Thematic Areas" like this site, when clicking on any "thematic" it will popup in same home page.. the link of website:...
0
votes
2answers
34 views

Adding regular php file to site

How do I create a page(in wordpress theme folder) so that it can be accessed on my site as examplepage.com/somepost.php? I can see it as examplepage.com/wp-content/themes/mytheme/somepost.php but is ...
1
vote
1answer
100 views

WooCommerce: The model of e-mail is displaying only the html, not css

I'm using the version 3.4.7 of WooCommerce and configuring the e-mails, I stare with a strange thing: the templates didn't appear the css. I experienced this in all of my sites, this is a test site ...
0
votes
1answer
13 views

Using same variable names in files added with get_template_part()

Say I have a file named content-header.php and content-body.php. In content-header.php I have this variable: $some_var = 'apples'; and in content-body.php I have a variable with the same name but ...
0
votes
0answers
17 views

Generate file with PHP for download inside a template file

I am trying to generate ICS files for event CPT on the fly utilizing this script: https://gist.github.com/jakebellacera/635416 I have created a template file: <?php /* Template Name: download-ics-...
1
vote
1answer
29 views

Can I override a CPT template on a per post basis with Gutenberg block editor?

I have a CPT defined in code called event, and there is a template file for the markup (single-event.php). I am wondering if it is possible to override a post within the Event CPT with the Gutenberg ...
0
votes
0answers
39 views

Display product thumbnail in Woocommerce email notifications

I've overridden Woocommerce template file email-order-details to display the product thumbnail in customer's email: <?php echo wc_get_email_order_items( $order, array( // WPCS: XSS ok. ...
1
vote
1answer
30 views

What's the equivalent of front-page.php for a custom static page?

I just added a static page option in Reading Settings with the help of this post. If front-page.php exists, it is used for Homepage. What should I name my template file to ensure that my custom ...
0
votes
2answers
26 views

Single-page.php template file name not shown

I am developing a theme and I noticed that get_post_meta($post->ID, '_wp_page_template', true); returns 'static-page.php' (as expected) when queried on static pages but returns nothing (expected '...
0
votes
0answers
38 views

I changed the template for WooCommerce product for category image (Category and Taxonomy Image plugin) but the image is still not displayed. Help!

I am trying to display category image instead of text on my product archive, but looks like something does not work. I am using Category and Taxonomy Image plugin (https://sl.wordpress.org/plugins/wp-...
1
vote
3answers
69 views

Wordpress Theme Development: How to redirect templates the right way?

I'm developing a theme for WordPress. I have a doubt about templates redirect. For example, I have a theme that have the front-page.php template and I don't use the index.php template. What I should ...
-1
votes
1answer
34 views

How to create a post template with two sidebars

I'm looking for a way to have a post template that has two sidebars, one on the right side, the other on the left side, with always the same content on each one of them. I defined that left sidebar ...
-1
votes
1answer
9 views

pass dynamic value to page to pull in categorised post cards

our developers are telling us that we must create 1 template per category to achieve this scenario: we are creating dynamic product pages we have a separate app that stores all the product attributes ...
0
votes
1answer
25 views

How can I delete the word `Category:` from page titles? [duplicate]

If I installed a new WordPress with twentysixteen theme and went to uncategorized page, I will see at the title something like Category: Uncategorized how can I remove the category: word from pages ...
0
votes
1answer
39 views

How can I add category variable inside posts?

I want to add a category variable along with the date variable that post has been published. For example, when I go to a post, I see the following under the post title: last updated on May 10, 2019 ...
2
votes
2answers
56 views

Load template file without a post type

Is there a way of loading a template file without having a post? I'm loading set of data via an API. Set up my index page but having a brain freeze with single template files as these posts are not in ...
0
votes
0answers
31 views

Child theme enqueueing style.min.css not style.css

Theme Name : StrapPress with bootstrap 4.2 I created child theme using Child Theme Configurator. It created functions.php and style.css, but when I applied new styles in the style.css it did not ...
0
votes
2answers
94 views

12 column grid layout

I'm Looking for a way to create the grid as on the pictures. A 12 columns based layout with a simple way to add text, images, video etc. etc. Tried the Bootstrap way without success. I’m up for ...
0
votes
1answer
29 views

Language file doesn't work (poeedit)

I'm trying to translate a WordPress template. I went to language files, then opened that copy with Poedit and started translating to my language (persian). After finishing the translation, I changed ...
0
votes
0answers
15 views

Custom Taxonomy 'archive' template name

I have a CPT with a custom taxonomy. So I have archive-projects.php single-projects.php for the CPT. That's fine. For the custom taxonomy I have taxonomy-project-categories.php Which I use to ...
0
votes
1answer
27 views

how to remove pages loading with the archive templates

I have custom post type "project", and it is loading with the template "archive-project". I already have a page "applications" to load "archive-project" So the same page is accessible via both URL's ...
0
votes
1answer
29 views

Exclude certain template from wp_list_pages

I'm trying to do something similar to the question in Exclude pages with certain template from wp_list_pages, but the $exclude variable doesn't seem to be returning the _wp_page_template value to then ...
0
votes
1answer
19 views

How to configure my blog page

I've been learning WordPress for about 2 weeks now and I've got stuck in the "front-page.php", "index.php" and "front-page.php" controversy. Here's my question.. How can I make the /blog use the home....
0
votes
0answers
37 views

Visual composer: can't use shortcode in template page

I need to add a visualcomposer this shortcode inside a category template page: [vc_row][vc_column][vc_basic_grid post_type="post" max_items="10" style="pagination" items_per_page="2" element_width="6"...
1
vote
2answers
94 views

Disable front-page.php template

I use front-page.php on my template to display home page. But I want to disable if the user uses another page for the home page from settings. Is there a solution? When user select a page from ...
0
votes
0answers
34 views

Accidentally deleted code in header.php

I accidentally deleted some code in my <head> section which made website header disappear. Later when add <script type="text/javascript"> header is appearing now but, when i try to open my ...
1
vote
2answers
234 views

Create Pages from Database

i've recently decided to create a website with wordpress. My goal is to a visualize data stored in a MySQL database. Each id in the database should represent one page on the website. From what i've ...
0
votes
0answers
18 views

How to Generate a Lot of Pages from a Database in Wordpress?

I have a page template that I have to use for hundreds of different products. I don't intend to create all those pages manually, and I want to know how to generate them automatically from a database ...
1
vote
2answers
51 views

Why do I get the same excerpt for all items in my RSS feed?

I'm new to coding and know next to nothing. I've done a ton research on the web, and I foudn the following code to import an RSS feed and place it in my template. The problem is that while I get 10 ...
0
votes
1answer
90 views

Merge multiple custom post types in a single archive template

I have multiple custom post types, viz., research, documents, booklets. I have a single archive template for each of them , archive-research.php, archive-documents.php, archive-booklets.php ...
0
votes
0answers
18 views

Why does a custom php code inside a custom template not get executed?

So in order to have some php code executed inside a page on wordpress there are 2 ways. One of them is to create a page template and when creating the new page in wordpress set the Page Attribute to ...
0
votes
0answers
28 views

front-page.php includes a placeholder text field. How to get rid of it?

I have used front-page.php as a custom template for my site's home page. The page includes a page editor field even though I have coded the template entirely to use ACF Pro custom fields. The editor ...
0
votes
1answer
17 views

BuddyPress : how can I call the template Wordpress would have chosen (template hierarchy)?

playing with BuddyPress here ! I made some new user profile pages, and when I display the content, I want to make a new posts query, and display the loop. Thing is, I want to display that loop using ...
0
votes
1answer
61 views

Template files not working for archives and categories

I added category-news.php template file to the theme directory but it doesn't apply the template of the category but instead to the index.php file. category-slug.php is the highest level of the ...
0
votes
1answer
489 views

Opening a JQuery modal window on click of a button with a JQuery plugin

I am trying to open a Jquery Modal window on click of a button. And inserting this Button into a plugins content template (WP SHow posts). I'm using jquerymodal.com's modal code, since I don't need a ...
0
votes
0answers
85 views

Display a custom 404 page without a redirect

In a plugin I want to display a specific page without redirecting (and thus without changing the URL) like the plugin https://wordpress.org/plugins/404page/ does. I can capture 404s and redirect them, ...
0
votes
0answers
53 views

Why wordpress custom template comments shows Undefined index?

During making a custom template comment I see this notice: Notice : Undefined index: comment_field in C:\xampp\htdocs\..\wp-content\themes\..\functions\comments-html.php on line 155 Following is my ...
1
vote
1answer
31 views

How to display (plugin?) output on a single page (not a widget, probably not a short code) - template, plugin, combination?

I've seen many variants of this question but none of the answers I've found yet have answered my question. Not new to PHP but new to WP and yes I've read a lot of docs. So this is where I'm diving in ...
0
votes
0answers
16 views

Woocommerce - Different product view based on user roles

I am currently working on a website for a client. He wants the products to be displayed in a table view for users with the ceratin role "resellers1" and "resellers2" and every other user will see the ...
0
votes
1answer
29 views

Advice on creating a WP Archive Template with Custom Taxonomy (get_term_meta)

I have created some custom taxonomies (using WordPress Pods) and they work great - but there's just one thing that I need them to do, and here's my question: How do I go about creating an archive ...
0
votes
0answers
26 views

Show blog-posts on Template

Below you see the index.php of my Theme. As far as I understand, wordpress is using this file to generate category-pages with thumbnails, headlines, excerpts etc. So now I want to make a "special" ...
1
vote
1answer
62 views

Custom url structure for custom template

I have a custom taxonomy called activities and a custom role called operator. So, if example.com/operators/bird-watching is visited then I want to list all the operators that offers bird-watching. ...
0
votes
1answer
48 views

How do I add a text input field for customers to leave a note on a single WooCommerce product page?

I'm constructing a little webshop using WordPress, WooCommerce and a theme called Storefront. I would like to add the ability for clients to add a custom note for the product vendor on the product ...
0
votes
1answer
38 views

Assigning alternate single-{cpt} template based on blog_id in multisite

I have a multisite network with some shared custom post types, and I'm trying to create a function that loads a custom single-{cpt} template for a given post type by $blog_id when defined, and ...
0
votes
1answer
59 views

Prevent 404 and serve custom template for custom URL

In a nutshell what I want to achieve is this: If slug equals foobar serve the foobar.php template. I know I could do this with page-foobar.php but I don't want to create a page for this. add_action(...
0
votes
1answer
27 views

add_filter function concatenate string and locate_template function

I am trying to inject a small php component to the end of my main site navigation. I have written this filter: add_filter('wp_nav_menu_items', 'add_css_switcher', 10, 2); function add_css_switcher(...