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
29 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
16 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
17 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
10 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
19 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
17 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
15 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
14 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
19 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 ...
0
votes
1answer
11 views

How to get_term_meta on single custom post?

I added custom image and icon to my custom taxonomy, and I know how to display it in the front end in the taxonomy template page. $headImageId = get_term_meta( get_queried_object_id(), 'category-...
0
votes
1answer
22 views

Can a link in WordPress contain a query string that is picked up as $_POST

This question is about a very specific circumstance. The site has one template file that can run a default category query with thumbnail, linked title and excerpt, or it can run a linked title only ...
1
vote
2answers
35 views

Include Custom Style & Script into Custom Post Type Single Template

I'm creating a plugin to add a custom post type. For every custom post type, I also create custom single template. The custom single template is not using get_header(); or wp_head() functions, it is ...
0
votes
0answers
18 views

Any way to easily change a website template to a JSON file?

I am new to owning a website. I want to use the template ioboot. How can I easily change the contents so it is in all one json file to be able to upload it to AWS?
1
vote
6answers
371 views

WordPress automatically created files like .theme-name / .plugin-name.php [closed]

I noticed that in every single folder of my wordpress there's a file called .theme-name.php. For example, in the theme folder twentynineteen.php there is this file called .twentynineteen.php This is ...
0
votes
0answers
40 views

Create custom feed for child pages of a parent page

I have been trying to create URL feed for all child pages of a parent page. Those child pages have featured image and excerpt info (+author, published date) I found here that is possible to create ...
0
votes
0answers
19 views

For custom templates, is it better to use `template_include` or `type_template`?

I saw a lot of questions about including custom views in Wordpress (I mean custom templates). There were many answers. Some people recommend using template_include and others recommend using ...
0
votes
2answers
30 views

get_template_part for template in subdirectory not working

I'm working on my first wordpress site, and moving it online. I have been adding some extra templates to design a simple booking engine, that was working perfectly on my offline localhost server. ...
0
votes
1answer
20 views

Is there a way to by-pass the pagination function on one custom template?

I'm working on a site where the client wants only the linked titles of all posts in a particular category on one page. That is, the query does not pick up the smaller number of posts that is defined ...
0
votes
0answers
8 views

Swap WooCommerce product catalog ordering dropdown with buttons?

I'd like to swap the standard WooCommerce dropdown for ordering the product catalogue using buttons, yet no Google search for an easy method of doing this (or a plugin) has been fruitful. I'm using a ...
0
votes
1answer
15 views

How to add (and change the font of) the short product description to order page and customer's new order e-mail [closed]

I'd like to add the short product description to the e-mail that is sent to the customer when a new order is confirmed. I've added the following via a code snippets plug-in: add_filter( '...
0
votes
2answers
21 views

Adding css and js to a blank page created with custom template

I am new to wp, fair warning :) I have added a new blank page by adding a php file in the twentytwenty theme folder with: <?php /* Template Name: charles */ ?> Then, I have created a new ...
0
votes
2answers
88 views

Add custom template 'sub-page' to Custom Post type?

I have a custom post type called 'Inspections' Doing this, you can access an inspection record by going to example.com/inspections/inspection-slug-here However, I want to add some 'sub-pages' if you ...
0
votes
0answers
18 views

Loading a custom template file for plugin single page

I have had no end of trouble trying to load custom template files I create in plugins. I have got to the point where one is loading, but its like loading inside another template, if that makes sense. ...
0
votes
0answers
12 views

Is there any easy way to find which piece of PHP generated a piece of HMTL? (Like BrowserLink in ASP.NET)

Developing in Asp.NET on Visual Studio there is a technology called Browser Link which make really easy to find which piece of PHP code is generating a piece of HTML (you can read something about it ...
0
votes
0answers
12 views

I want to create a page template for bbpress user profile using single-user.php

I am trying to create a custom user page template in bbpress. I have created a file single-user.php in my child theme. And placed the code from bbpress single-user.php there. But the urls of the ...
1
vote
2answers
37 views

How to enable template page only for a post id page

I wish to limit the possibility to use a specific template page only for post id x I have created a page-blog.php template and I want it usable only for the post id 115 (id of my blog page). ...
0
votes
1answer
7 views

Is it possible to have a template that works on multiple categories where the link address contains the specific category?

This question is for a very specific refinement on the use of WordPress template files. The refinement would work similarly to how default archive.php and variants work, but we would like to have a ...
1
vote
1answer
23 views

I have a problem in the order of enqueues while enqueuing stylesheets and scripts for a specific page in my function.php

I'm working on converting a code template (html, css, js) into a Wordpress Theme. This wordpress theme is not a child theme. For the home page (front-page.php file) the enqueues of stylesheets and ...
0
votes
0answers
19 views

How to implement pagination in category.php template

I'm creating the category template for a custom theme. With this code I'm able to get the last six posts of the news category, I need to add pagination links at the bottom of the page, How I can do ...
0
votes
1answer
20 views

What's a good way to allow overwriting files within a child theme if I want the same folder structure?

My parent theme has a structure like this Core\Utilities\Gallery.php. It's in the namespace of Product\Theme\Core and the file is loaded using composer's autoload. I thought to myself, I have a great ...
0
votes
0answers
39 views

How to add post title to custom php?

I need to create a template to replace the default page of Events Made Easy. I created a php file for this template and copied the page.php code to the new php file. <?php // Exit if accessed ...
0
votes
0answers
14 views

<li> shows outside of <ul> in custom post type template

I have a custom post type template and a list with several items inside displaying data form advanced custom fields, this is my template code for the list <ul class="game-meta-data"> ...
0
votes
1answer
10 views

small problem in the article ()

WP 5.4 Theme masonic I try to show the numer of comments in each article it'as ok (see the picture) but on the next line, itshow () I don't know why !?!? the code in the file template-tags is: ...
0
votes
1answer
15 views

Two different single.php depending on source page

I wonder if I can have two single.php templates for different sources. The problem is: - I have the full website, with the blog and the home.php that opens posts in the single.php template. - Then, I ...
1
vote
2answers
41 views

Inject PHP code into “sidebar-content” - code before my WooCommerce sidebar widget?

I am trying to add some PHP code before my WooCommerce product page sidebar content and can't for the life of me find where to do that. I have tried editing sidebar.php, using the 'woocommerce_sidebar'...
0
votes
0answers
9 views

I want to get the data from WP-posts according to the Post_modified date. Please check my code and help me out

$args = array( 'post_status' => 'publish', 'post_type' => 'therapist', 'post_parent' => 0, array( 'meta_key' => 'post_modified', ...
1
vote
1answer
73 views

Rewrite Rules to custom template

At the moment I have the following: a custom template: my_custom_template.php where the function below is called. <?php $uni_data = get_uni_data() ?> a page: www.website.com/my_page which ...
0
votes
1answer
20 views

Updating page template pragmatically

While I understand that there are many similar questions answered which helped me find a solution to update the page template for my custom post type pragmatically and it works correctly. However, my ...
0
votes
1answer
15 views

Load info from customposttype into template page

So I have a Custom Post Type called members. to this custom post type, I have ACF linked with a form to make an account In this post type are users made and stored. Now I want to retrieve all ...
-1
votes
1answer
86 views

How to properly use a hook to create template for custom product type in a plugin such as Woocommerce? [closed]

I created my own product type for Woocommerce. But now I am looking for the solution for a frontend template. I see in de folder templates/single-product/add-to-cart templates for Simple, grouped ...
0
votes
0answers
9 views

Custom dashboard for page creation & content upload wrt the templates

I am a medium level developer. I've developed my website using Wordpress. Now I just want to build a custom dashboard for page creation & content upload for my visitors wrt the templates. More ...
1
vote
0answers
27 views

Woocommerce specific product template for product type

I am creating woocommerce based custom plugin and i have created a product type "Poster Product" Now i want to create a specific product template for poster product and the template should be created ...
1
vote
0answers
27 views

How to show single category archive

I have created the category.php template file for my wordpress custom theme. I put inside it the loop and the markup needed to disply my single category layout. I'm facing the issue that if the url is ...
0
votes
0answers
11 views

Nest HTML content between template part

Apologies for the lackluster title. I am curious if there's something similar in Wordpress as Nunjucks call or block. Essentially, I am curious if it is possible to create a template part and inject ...
1
vote
2answers
26 views

Standard Wordpress Search does not work / Search-results are not displayed / Custom template

My search-results are not displayed. Instead searches show a 404. See https://startupsagainstcorona.com/solutions/ for testing. Can someone help? What did I do? I implemented the standard WP-search ...
0
votes
1answer
33 views

Unable to access wordpress page

Website link: http://belmont.perth.anglican.org/ error message: Parse error: syntax error, unexpected '[' in /home/belmont.perth.anglican.org/htdocs/wp-content/plugins/photo-gallery/framework/...
1
vote
2answers
20 views

How do I find the directory of a page template?

This must be a very amateurish question but... I'm using page templates from the dropdown menu in page editor but I can't find their source code. I know that usually this can be found in themes/"...

1
2 3 4 5
38