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
0answers
165 views

Customizing a new page used for blog posts with Avada theme

I'm using the avada theme for my website and I created a page called 'My Blog' and in reading settings I set this to display recent posts. It works, but when I created the page I selected a custom ...
0
votes
0answers
19 views

Custom post type single page uses the right template in preview mode but shows a different template after being posted

I've been developing a Wordpress theme. I've created a custom post type called blog in functions.php. // Blog Post Type Creation function te_blog_type() { register_post_type("blog", ...
0
votes
1answer
47 views

Pages from custom table

I have custom table "catalog" inside wordpress database: id|name|description|slug|price I have template file "catalog" and page "Catalog" where i show all items from catalog table. But how i can ...
0
votes
0answers
98 views

Overriding the template files using a plugin for all themes

I believe these are the common filters to use when overriding a template template_include single_template page_template archive_template The works but it seem that they are theme depended. I am ...
0
votes
1answer
42 views

how to display this functions?

I want to add this my page.php. Does anyone help me? if(function_exists('add_theme_support')){ add_theme_support('post-thumbnails'); } function mallu_link_add_meta_box(){ $...
1
vote
1answer
44 views

How to Include a Loop Template File in a Plugin

I am trying to include a template file into a loop i made in a shortcode, in a plugin. Everything shows up fine when the template is actually pasted into the loop, but to make things neat I want to ...
0
votes
1answer
10 views

Why aren't some plugin styles loading when I load a template?

I'm using template_redirect to load custom template files based on the URL: add_action( 'template_redirect', function() { if (is_singular('business')) { load_template(get_plugin_path()...
0
votes
1answer
777 views

Warning , Use of undefined constant PLUGIN_PATH?

I having a warning in my error log Use of undefined constant PLUGIN_PATH - assumed 'PLUGIN_PATH' (this will throw an Error in a future version of PHP) When I googled it I couldn't find the ...
0
votes
0answers
23 views

How to display a post(by id) along with css in a page?

I am curious if it's possible to get a post content along with its CSS (say if button background color is green on the post) and display it a page? I am able to get the content but the CSS are not ...
0
votes
1answer
107 views

Create template for just a print

I have custom post which prints some content in tabbed table, where only selected tab is visible. Now, if print is selected, I would like to print contents of all the tabs. The problem is, that some ...
0
votes
1answer
96 views

How do I remove the word “Blog” from a WordPress Homepage?

I would like to remove the word "Blog" from this WordPress homepage. It is existing within the selected theme. Where in the Theme Editor code should I look to find and delete this text? The theme is ...
0
votes
1answer
5k views

How to add an HTML <rel=preload> tag to the Header?

Since the google speed insights report suggests adding a < link rel="preload" href="/lity.css" as="style" /> to speed up the loading of the following resources https://www.myoutlet.lt/wp-...
1
vote
1answer
38 views

I can not include page to wordpress function add_filter, the_content

Wordpress Function add_filter I want to include extra page, on add_filter How can I correct this ? Thanks in Advance ! function page_content($content) { global $post; if ( is_object( $...
0
votes
1answer
91 views

Post Attribute Section missing for Custom post type

This is how I created the custom post type function wp_custom_post_type_listing() { $labels = array( 'name' => _x('Listing', 'post type general name', 'wpprolister'), ...
0
votes
0answers
46 views

Is it possible to link an external stylesheet, exclusively within a specific single post template?

SOLUTION Big shoutout to the wonderful SallyM, who answered this very succinctly in the comments of this post. If it helps anybody, here's the code that I used. Note: Replace the //CONTENT// with ...
0
votes
1answer
39 views

is_page_template showing partial results

Trying to load conditional content thru the header, but only front page is being identified correctly. Archive, post and custom type templates aren't. Using Query Monitor to identify correct ...
0
votes
1answer
194 views

Woocommerce - wc_cart_totals_shipping_method_label() breaking out option tag

I'm trying to change the default cart-shipping.php template to use a dropdown menu rather than radio buttons. I have successfully managed to do this on the cart page by changing the printf function ...
0
votes
1answer
14 views

How do I use a plugin to swap out the template file for a custom post type?

I'm trying to apply a filter for a custom post type and give it a different template. All from within a plugin. However, despite confirming that add_hooks() is called (everything else works in that ...
0
votes
2answers
118 views

dynamic_sidebar() stopped working

A custom page template which has been in use for 3 or 4 years which rendered a custom sidebar has suddenly stopped rendering it. I can't for the life work out what the problem is. /* functions.php */ ...
0
votes
1answer
23 views

Editing fields required in the WooCommerce / WordPress registration form [closed]

I can't seem to find the template file or find the setting within WooCommerce to amend the fields requested in the registration form for a WordPress site. I did not set up the form to begin with and ...
0
votes
0answers
19 views

Search button click sends to single-custom_post_type instead staying at the same page

I created a template to display search results based on user selects. The problem is after I click on the search button it sends to the single-product(This is a Product custom post type). I also have ...
0
votes
1answer
79 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
42 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
1answer
30 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
41 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
524 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
18 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 ...
1
vote
1answer
44 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
1answer
422 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
32 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
58 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 '...
1
vote
3answers
655 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
255 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
10 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
39 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
47 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
64 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
125 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
310 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
31 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
1answer
92 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
98 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
24 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....
1
vote
2answers
167 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
87 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
957 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 ...
1
vote
2answers
86 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
681 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
35 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 ...

1 2 3
4
5
39