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

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

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
18 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
14 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
0answers
8 views

Set page title based on slug and not page ID in Wordpress and RankMath

I have a custom theme. There is a template for all products (and main product page uses same template). So: mysite.com/products = post id = 12 mysite.com/products/product1 = post id = 12 Current ...
0
votes
2answers
20 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
18 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
5 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
14 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
18 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
0answers
19 views
+50

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
10 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
8 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 ...
0
votes
0answers
13 views

How to design post date to a neat one?

The following screenshot is my website right now. You can see how the date is positioned awkwardly? This is what I want it to look like. You can seehow the date is neatly placed. The social media ...
1
vote
2answers
30 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
6 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
19 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
14 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
16 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
30 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
12 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
14 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
28 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
68 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
48 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
20 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
24 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
10 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
24 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
26 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
19 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
vote
1answer
22 views

Custom template page with custom archives listing by user

I'm having an archive page for my post type. It's working, I'm using the template part with the get_post_type() parameters. content-activite.php: <?php $post_id = get_the_ID(); $post_thumbnail = ...
1
vote
1answer
29 views

How to make tag post listing page working?

I'm adding tags to posts. Clicking a tag takes you to an overview listing of all posts for that tag. I created this listing by adding template "tag.php", which includes: $tag = get_queried_object(); ...
1
vote
0answers
20 views

(FES EDD) New vendor submission page is blank

When someone signups as a vendor and tries to post a new submission(service), when its posted the page is blank: https://markety.gg/downloads/demo-from-dilip In the backend, the submission is ...
0
votes
1answer
32 views

Change default template in the block editor (Gutenberg)

I want to change the default template for my pages to a template called fullwidthpage.php. I have seen this question posted and answered for pre-Gutenberg Wordpress, but I have not found a working ...
0
votes
1answer
19 views

Attachment URL for an image is loading direct image file

I'm working on a site that is using a theme with an attachment.php file in the theme. However, when going to an image's attachment page (i.e. https://domain/john-doe/) it loads the direct image (i.e. ...
0
votes
0answers
10 views

Use multiple templates for an article

I'm doing a special area for my website , in which I'm trying to show certain files available for download from certain products. The Situation I use many category templates to display the certain ...
0
votes
0answers
36 views

Loading different header and footer in woocommerce templates (AMP)

I would like to use different header and footer in my woocommerce AMP templates instead of default one. I already achieved this but I can’t manage to do it for WooCommerce templates. So let me explain ...
0
votes
0answers
20 views

Custom WooCommerce template for product

I've created a specific product template for a few of my WooCommerce products. However not all of the plugins and WooCommerce JS files load on this page. I assume it's leaving out some default headers ...
0
votes
0answers
13 views

how to create going/interested button for event listing website - wordpress

I am building an event listing website in WordPress. The theme already has almost every basic features that i would require except button like event interested/going, by which I can record attendees ...
0
votes
1answer
38 views

Custom post type defaults to index.php for archive page

I've developed a custom theme with a custom post type named events. For some reason, however, WP refuses to use my archive page template with the file name archive-events.php per WP's template ...
0
votes
0answers
16 views

Bulk Wordpress Pages

I'm adding pages in bulk and want to use the page title throughout multiple spots in the template. For Instance; "Smithtown Real Estate" is the page title. I have 3-4 boxes that will have different ...
0
votes
1answer
38 views

Why <?php echo get_template_directory_uri() ?> still output /wp-content/themes/twentynineteen?

I've developed some twentynineteen-child template. Today, I need to convert my last child-template into a template stand-alone. I removed the following line from the style.css file: Template: ...
0
votes
0answers
21 views

Create link/button to create new post using specific template

I created a custom template. Via New > Post I can select the template manually. In order to have an easy handling for users I want to create a button or link in wordpress menu to create a new post ...
0
votes
1answer
110 views

Conflict between Yoast SEO and my custom theme

I’ve been developping custom themes for not so long, so it is the first time I have a conflict between my theme and a plugin and I'm not really sure how to debug this exactly and fix it. When my ...

1
2 3 4 5
38