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

How i can create link href between two template have the same custom post type

I have custom post type "episodes" i create template for this custom post type "single-episodes" when get template from "inc/episodios.php" like this ... get_header(); // ...
0
votes
0answers
9 views

Create link between two template have the same custom post type

I have custom post type "episodes" i create template for this custom post type "single-episodes" when get template from "inc/episodios.php" like this ... get_header(); // ...
0
votes
0answers
31 views

why won't my custom css load with the enqueue method or any other method?

<?php function load_stylesheets(){ wp_register_style('sj', get_template_directory_uri() . "/sj.css", array(), 1.0, 'all'); wp_enqueue_style('sj'); } add_action('wp_enqueue_scripts', '...
0
votes
1answer
13 views

Will the latest Bootstrap work properly with the default Wordpress jQuery?

Wordpress still uses jQuery 1.x for fear of wrong compatibility with plugins and themes. They are trying to update it, but you can see that it will take a while yet (sources: one, two, three) Now I am ...
0
votes
1answer
25 views

Woocommerce - Change the template?

I found the solution here WooCommerce: Change template for single product page But, it doesn't actually explain how to do it.. or i'm just not understanding enough. I did give it a go and placed that ...
1
vote
0answers
11 views

Wordpress comments not appearing in blog posts, likely because of Redux template. Could I fix this with a plugin that adds a comment form as a block? [closed]

Although I'm comfortable with coding I'm quite new to website building so please forgive me if I'm using clunky or inaccurate terminology. On my Wordpress website I installed the Redux plugin. It has ...
1
vote
1answer
17 views

Include custom post type single template, but respect theme override of template if it exists

Through a plugin, I have created a custom post type named "my_custom". Also through the plugin, I am successfully including a template for the display of a "single" item of my ...
0
votes
0answers
9 views

Block for custom title-header in Flatsome

I would like display a diferent image in my title-header on Flatsome theme for now I Use a CSS like that .postid-29280 .page-title-bg { background-image: url("my image") !important; } but I ...
1
vote
1answer
10 views

What part of template to edit to remove category name from the top of posts?

In the “Twenty Twenty” template I cannot figure out how to remove the display of category name(s) from the top of posts.
0
votes
0answers
16 views

How to change Woocommerce product shortcode template

I have <?php echo do_shortcode('[product id="163"] ') ?>that returns a product by ID. How can I change the template?
1
vote
1answer
14 views

Exclude a category from the filed under list only on some templates

this is a follow up question to this post Exclude a category from the filed under list The solution given works for me. However, I'm curious how I can get this to work conditionally? Specifically, ...
0
votes
0answers
34 views

Different template parts when on different pages

I need to get different template parts when locating on different pages, for e.g. Homepage. <?php if (is_home()) { get_template_part( 'partials/hp-header' ) } else { get_template_part(...
0
votes
0answers
19 views

Is it all right to put the whole <head> tag into template_part file?

I need to have more than one headers so this looks as a good idea but I'm not sure if it is valid. If so, what am I supposed to name a file? I named it head.php so far. Example: <html> <!-- ...
0
votes
1answer
11 views

How can i conditionally load taxonomy-{taxonomy}.php template php files through functions.php

I have a movie review site, i would like to conditionally load the taxonomies of actors and directors only if a option of my theme is active. At the moment in the root theme folder I have these 2 ...
0
votes
2answers
45 views

How To Load an HTML File As A WordPress Page (With No 301/No Redirect)

Here's what I'm trying to do: Page URL: https://example.com/the-page/ What it should load: https://example.com/content/oct2020/index.html When visitors go to the permalink /the-page/, I'd like that ...
3
votes
1answer
41 views

How can I add a custom header to a custom template in a plugin without using the theme folders

There is a lot of documentation on how to create custom headers for a theme. For example, if I wanted to add a header named: header-custom.php I would add this to my template file: get_header('...
1
vote
1answer
19 views

Include Lumen/Laravel app in custom Wordpress template

I've built a small app with Lumen and now I want to include it on my wordpress site. However I have difficulty getting it to work. My approach was making a custom template and using it on a post with ...
-1
votes
1answer
29 views

Custom template not working for existing pages [closed]

I was playing around with using a custom template per page. (Because I need to load different post types per page). When creating a new page, and link my custom template to it via Page Attributes, it ...
0
votes
1answer
20 views

Differentiation between index.php and page.php

I am currently developing a theme in wordpress for learning purposes. To set out to you my page hierarchy I have the following: index.php: fallback for all website pages home.php: blog page front-...
0
votes
1answer
16 views

How can I include ALL post types in the_post_navigation() links, not just current post type?

I have a site with several Custom Post Types: blog posts, movie reviews & book reviews. In my single.php template I call the_post_navigation(). When viewing a blog post the previous and next links ...
0
votes
2answers
19 views

Page template option missing

I checked everything suggested in that response: "page attributes" option is checked, template file is located at theme root folder, I tried several file encoding options in my text editor (...
0
votes
0answers
17 views

Custom taxonomy template shows different content if there are children

I am trying to create a template for my custom post type (products) custom taxonomy (product_category) that will show sub categories if there are any and but if there aren't, then it should list the ...
1
vote
0answers
21 views

Get and insert order email address to the PHP template inside HTML text

I broke my head trying to solve the following case. I have a WooCommerce admin-new-order.php PHP template I want to customize. All I want is to add the order email address to the top of the email body ...
0
votes
1answer
12 views

Post template not applying on theme (potentially rendering as Page template)

I have a Post template, when I select it in the Post options, it saves, but doesn't apply the template on the frontend. Any ideas why this is happening? The posts in question are in the default posts ...
0
votes
1answer
12 views

Undefined get_header function

I installed wordpress according to the site https://ipipe.ru/info/ustanovka-wordpress-na-openserver and then wanted to use underscores.me, where I entered worldelectronics and pressed the generate ...
0
votes
1answer
14 views

How to get custom page template being edited in gutenberg editor

I want to know custom page template name (the one chosen in page attributes - template) in PHP, before page opens in order to enqueue additional scripts according to chosen template. I know how to get ...
0
votes
1answer
43 views

How to add attributes to <body> tag when template cannot be directly modified

This is similar to How to add data- attribute to <body> tag but different in that I am n ow searching for a solution that does not require modifications to the template file. I have a ...
0
votes
0answers
13 views

Are there any guidelines/standards for post styling?

I am a beginner in Wordpress Theme development. I have been trying to create my first theme and I have already started by adding some basic styling. I am using single.php as a template for loading the ...
0
votes
0answers
12 views

Default Template Selected After Changes in Elementor

I'm working with custom templates in WordPress. I'm using the Elementor plugin to build the site. When I open any page and make some changes in Elementor and then click the update button, I see that ...
0
votes
0answers
14 views

Modify the order to display: post title - thumbnail - excerpt for odd column?

Hi to all I'd like to modify my wordpress template (blog-entries category) to display starting from column4 and only for odd columns: 1) thumbnail 2) post title 3) excerpt. The now schema is title-...
0
votes
0answers
100 views

Uncaught Error: Call to undefined function twentytwenty_the_post_meta()

I'm working with WordPress customization, I created a template who has the following code <?php /* Template name: Master Template */ get_header(); ?> <body> <?php if(...
0
votes
1answer
34 views

Is there a way to hook or call a custom woocomerce template that is not part of the default templates of woocommerce?

So I'm currently using Woocommerce and managed to figure how to override templates based on the documentation. Now I have a problem, so i managed to override a specific template let's say upsell.php. ...
0
votes
0answers
12 views

Modify the loop template in a plugin

Is it possible to modify the output of a loop template from a plugin without using template_include to define a whole new template. My goal is to only modify the loop's output so that the plugin won't ...
0
votes
1answer
111 views

How to custom page template for the Gutenberg editor

I have read several questions/answers/articles about "custom templates," including the Block Editor Handbook, but nothing gets at what I'm looking for. Granted, this does smack of questions ...
0
votes
1answer
10 views

Removing a widget via theme editor

I recently updated our company's website and now we are seeing our newsletter sign-up widget appearing on landing pages where it previously had not. Our landing page template is set up to remove this ...
0
votes
2answers
39 views

Timber + MtHaml, or any other HAML-like HTML shorthand

I use Timber for all my projects, but I would also like to start using a templating language like HAML or Pug. I found a PHP implementation of HAML called MtHaml, which supports twig. I thought this ...
0
votes
0answers
23 views

Removing Yoast from Specific Template

We have a custom template, content generated by an API so no WordPress edit page, and Yoast is spitting out meta data that is based on our most recent blog post, so entirely unrelated to the custom ...
2
votes
1answer
14 views

Adding variable for post title so post template can include auto-generated link to view on external website.com/{post title}

There's an external website that I'll be referencing within my posts that uses the same static format for their pages. Let's say it's website.com/view/1111, website.com/view/1112, etc. What I want to ...
0
votes
1answer
33 views

How to implement template file and the loop

I am trying to understand how to use a custom template file, in this case simply to list all posts. Based on my research, and initial responses to this post, the code looks like this: <?php /** *...
0
votes
1answer
17 views

How to get the most recent modified date of anything in the footer of my site?

I would like to be able to post the most recent updated date in my footer. However, I can't seem to find a way to do that globally for the site, just for each post/page at a time using ...
0
votes
1answer
28 views

Setting posts_per_page for taxonomy term template

I have a custom taxonomy term page set up to display posts associated with that term (taxonomy-insight_type-academia.php). I figured I could use the following to limit the posts on that page based on ...
0
votes
0answers
11 views

Woocommerce default css

I am creating a custom woocommerce template I added in the various pages: header.php <?php wp_head(); ?> <body <?php body_class( '' ); ?>> footer.php <?php wp_footer(); ?> ...
0
votes
0answers
21 views

How to name custom search page PHP file?

I'm reading about how to create a custom search page. It's not clear for me how to proceed, in the wordpress documentation I've read that I can't use the name search.php for a search page because it's ...
0
votes
1answer
24 views

Conditional to determine if search.php page is the current template

I have a specific CSS-file for my search results, so the search.php template. I want a PHP if-condition to determine if the current template is the search.php template, so that I can load that CSS-...
0
votes
1answer
114 views

Would like to use hook or filters to customize email templates

I hired a contractor to help me with my site a few years ago when I didn't have the coding experience that I do today. The contractor ended up making new templates for almost every email, and they are ...
0
votes
1answer
32 views

Plugin Admin Menu Boiler Plate

So, I've done a lot of searching around and there doesn't appear to be any form of Boiler Plate for creating Custom Forms, Dropdowns and that kind of thing within a custom Wordpress plugin. Although, ...
1
vote
1answer
26 views

Custom search results page not working with empty search

I have a custom search results page that works fine except when an empty input box is submitted. When an empty input box is submitted, the header on the results page displays "XX results found&...
0
votes
0answers
9 views

Show content/template for the /tag/ or /taxonomy/ part of the URL in Wordpress

Heu, I've been trying to figure this problem out but can't quite find an answer. On my WordPress site, the URL for tags is mysite.com/tag/tag-term. This displays fine using the tag.php template. ...
0
votes
0answers
22 views

Template includes

I want to use custom template redirects for urls such as http://example.com/foo and http://example.com/foo/bar I'm using add_rewrite_rule function for this add_action('init', function() { ...
0
votes
0answers
6 views

Select custom author page for custom role

I've made a custom author template model.php for a custom role model (Ultimate members Plugin) and I have the default author.php also. I want to assign model.php to model when someone goes to model a ...

1
2 3 4 5
39