Questions tagged [page-template]

Pages are one of WordPress' built-in Post Types. You'll probably want most of your website Pages to look about the same. Sometimes, though, you may need a specific Page, or a group of Pages, to display or behave differently. This is easily accomplished with Page Templates.

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

Wordpress post-template null warnings

I am getting these PHP8.0 Warnings from my WordPress site. The warnings are pointing to core code, not anything custom. When I turn debugging on there are no error messages on the site. I also checked ...
Dawn's user avatar
  • 23
0 votes
0 answers
7 views

Site Library issue

How can we use this site library template for a single page ( blogs page where we fetch and display all the blog posts ) without affecting the website theme or pages. and how to connect with ...
Jai Gupta's user avatar
0 votes
0 answers
7 views

Quiz page template, checked attribute missing when option selected

I would like to add a quiz page template to my WordPress site. Part of the template is the code below. The problem is that when any of the inputs is selected, the checked attribute is missing. <div ...
Kostas Stoumpos's user avatar
0 votes
0 answers
13 views

How to add content region to a post or a page

I need to add a region to a certain pages. Currently our posts are one column. What we need to do is to add region where we could display Table of Contents so it would become two column layout ...
Łukasz Korona's user avatar
0 votes
0 answers
12 views

How to create download page with countdown in wordpress?

I'm working on a WordPress project and aiming to create a download page similar to "APK Material Download" with a countdown timer before users can access the download link. I've explored ...
Inam Ur Rehman's user avatar
1 vote
1 answer
38 views

Where to put media files when adding custom template to a theme?

Goal I need to use a legacy html static page for the homepage of a newly installed wp website. I used this answer, the second method, to add a template to my theme and to set the settings > reading ...
AxZxP's user avatar
  • 13
0 votes
0 answers
40 views

Change information (phone number) in header of WordPress site using Veda theme

The site is located at www.morrellplumbing.com.au and the header looks like this: I need to change the phone number, but for the life of me, I cannot find where it is stored in the Wordpress ...
Dale M's user avatar
  • 101
0 votes
1 answer
18 views

condition for specific pages

I have a php page template used for all archive product categories. If I want to change the button on one of the categories, is there an 'if' 'then' condition I can put in? e.g button for all ...
imdes's user avatar
  • 1
0 votes
0 answers
100 views

Creating a page that will dynamically get posts from 2 taxonomies

I have 2 taxonomies type and city I want to have page where it will dynamically query a city and type depending on the link for example: type/condo/city/toronto should get all my properties from ...
Bon Andre Opina's user avatar
0 votes
0 answers
28 views

Page not found when I click anything on my website

I've just bought a WordPress theme called Vehica. After installing it and its plugins I go to my website and click for example 'about us' or anything else it will redirect me to: Not Found The ...
bighunterson's user avatar
0 votes
0 answers
12 views

I belive I deleted the template

I'm new to wordpress and I don't even know what exactly is wrong with my WP so bear with me for a bit. The steps I performed: Picked a blank canvas theme and from the several headers and footers ...
MiguelP's user avatar
  • 101
1 vote
2 answers
64 views

Can wordpress search inside a custom page template?

I got a site that all of its pages (besides the blog), are implemented using custom page templates. The custom templates use static HTML content, which, I believe, isn't indexed in the catabase. ...
neoswf's user avatar
  • 125
0 votes
1 answer
30 views

Extra HTML code added to my <table> (on Chrome DevTools) but not on source code

As I'm working on a <table> displayed on a page (still in Draft) on WordPress, something weird happened : While I've written this very simple code on my editor : <table> <tr scope=&...
PhpDoe's user avatar
  • 197
0 votes
0 answers
27 views

Confused about editing the HTML in a template

So I set up a child template off of 2023 WP 6.2.2 .... I then added my own template (Template one) however the thing i'm not sure of is how to do is edit the HTML of the template... So a few questions:...
BostonMacOSX's user avatar
0 votes
0 answers
35 views

starter template custom page header issue

I am a beginner in WordPress and I am creating a website using a starter template. The pages of the starter template have a background header but when I create a new page it is not showing as the page ...
Jaiffable's user avatar
0 votes
1 answer
32 views

How to provide page_template path in custom plugin using WordPress

How we can provide page_template path in custom plugin using WordPress? I given a path in page_template='templatepage/checkoutpage.php' as array of post.Inserting post data by wp_insertpost() function....
Mallesh's user avatar
0 votes
0 answers
17 views

Generating Multiple Divi Pages from Database

I have a template in Divi that I want to use as the basis for generating hundreds of pages. I would like to replace some terms in the title of the page, as well as the body of the page, based on data ...
2567655222's user avatar
0 votes
0 answers
25 views

How do I update the SEO information on dynamic pages being generated from template_include?

I have set up a function to dynamically create pages through query variables. The use case is that we're calling a job's board API and then generating the URL and content of the page based on what get'...
worldwidejamie's user avatar
0 votes
1 answer
140 views

How to add readable name and description to templates?

I created single-post-type-name.html in templates but they show up like this in the dashboard: Is there a way to have it like "Single Post Type Name" and also add a description like the ...
Rain Man's user avatar
  • 154
0 votes
0 answers
25 views

Styling best practices for single pages/templates

What's the best practice for CSS that is specific to one PHP file? For example, let's say I make a page page-456.php that is styled differently from the rest of the site, what's the best practice to ...
Coopero's user avatar
  • 101
1 vote
1 answer
207 views

WordPress Page Slug with URL custom template

So I want to create a custom template file for my user profile page something like this URL http://localhost/wordpress/user/username. Here you can see I have created a new page in Admin with this ...
Mittul At TechnoBrave's user avatar
0 votes
1 answer
143 views

how to create a page that shows all of multiple category posts on a single page

I have been attempting to get a solution to work that was previously posted for this question 1 I created the template as posted: <?php /* Template Name: Multiple Categories */ get_header(); $...
Thorigol's user avatar
0 votes
1 answer
100 views

duplicating page templates

I am not much of a coder other than basic html and css lol so I have spent days trying to find a solution to this.... an old developer had created custom page templates for this website that call ...
imdes's user avatar
  • 1
0 votes
1 answer
100 views

REST API error in block editor for custom templates

I'm working on a plugin that adds custom templates to WordPress for use with the active theme. The template files are located in a plugin directory and are being passed into WordPress with the ...
Kylen's user avatar
  • 1
0 votes
1 answer
33 views

I'm building a WordPress theme and noticed that the 404 page template runs along with the corresponding templates for each page. Any idea why?

function debug($message){ error_log($message, 3, get_template_directory() . '/debug.log'); } I added the above function to each of the templates. For example, front-page.php includes a line that ...
SuPalle's user avatar
  • 11
0 votes
1 answer
101 views

Template Redirect Function Only Working When Logged In

I added a template_redirect to my functions.php file, which redirects private staff members to a "Staff No Longer Available" page. However, my code only works when I am logged in. Am I ...
Michelle's user avatar
2 votes
2 answers
515 views

Is there a way to change the default post template selection for a specific category?

When we add the new post,the default template is selected. I want to change the default selected template to my custom template automatically before publishing or saving the post. Here's an example: ...
pardhan's user avatar
  • 21
0 votes
1 answer
52 views

How to automatically set a Template Page Name next to a page in menu screen such as WooCommerce pages, front page, or posts page in wordpress?

When creating a menu, and after selecting a page as front page and another page as posts page..it appears next to the page in menu screen. For example, "Front Page" appears next to home page,...
Hatem Frere's user avatar
0 votes
1 answer
103 views

Logout redirect via page template without confirmation?

I'm trying to redirect users when they visit my page template template-logout.php, but I keep getting the Wordpress "Do you really want to logout?" question despite wpnonce being generated. ...
Osu's user avatar
  • 1,442
0 votes
0 answers
215 views

How to show feature image, Title, Breadcrumb before Page in flatsome theme

I can find how to display it in Post and Product section, but in Page I don't see it anywhere So please guide me how to display Featured Image, Title and Breadcrumb behind the header like the picture ...
emptyss's user avatar
0 votes
0 answers
136 views

Custom Post Type doesn't have template content when creating programmatically in PHP but does when created in WP Admin

I've created a default template for a CPT for example... // Define template $template = [ [ 'core/heading', ], ]; // Register the CPT register_post_type( 'my_cpt', [ //...
Michael Elementary's user avatar
0 votes
0 answers
54 views

Using a Page Template Not in Theme

My plugin creates (on demand via a 'create template' button) a page template that is stored in uploads/plugin-name folder (so it will survive a plugin update). The plugin also creates (again on demand)...
Rick Hellewell's user avatar
1 vote
1 answer
84 views

DIV containing iframe disappears below break point of 992 in Oxygen Builder

I have a dynamic CSS grid using a repeater in Oxygen Builder that displays a mix of images and videos from an ACF repeater. I have used the following CSS which works fine up to 992px. .embed-...
philthebass's user avatar
0 votes
0 answers
22 views

Separate page for pagination possible?

This is how my index.php looks like for my custom theme (I'm not sure if Line 4-5 is necessary). When I put pagination in the home or post, I would like to be able to take the user to a separate ...
Elaine Byene's user avatar
1 vote
1 answer
493 views

Create Page with Template File from Plugin Folder

I have a plugin that creates a template file stored in the plugin's 'templates' folder. It also creates a new page using code similar to: $template_file = plugin_dir_path( __FILE__ ) . '/...
Rick Hellewell's user avatar
0 votes
1 answer
48 views

Find Any Theme's page.php File

I'm developing a plugin that needs to create a page template that uses any theme's 'page.php' file. The intent is to read the source code of that theme's page.php, modify it to add additional ...
Rick Hellewell's user avatar
0 votes
1 answer
23 views

Is there a way to have WordPress autodetect page templates in the page-templates directory and any sub-folders?

I know you can put custom page templates in the page-templates directory and WordPress will automatically detect them and make them selectable from a dropdown in the admin, but I would love to be able ...
kevindeleon's user avatar
1 vote
0 answers
38 views

Can you programme the selected page template to display block patterns automatically?

Ideally, if I select a template called "3 columns", the block patterns layout I've premade would automatically load into place. I understand you can predetermine regular posts block pattern ...
NotReallyRuby's user avatar
0 votes
0 answers
152 views

Custom search template is showing 404 when adding query string

I've created a custom theme and a page template page-search.php, because the original search will search under the homepage url. The page works just fine without query string but when I add /?s=1 at ...
odedta's user avatar
  • 86
0 votes
1 answer
24 views

Problem with custom loop navigation inside the blog page

I have a problem I am not able to solve. I have a custom theme with some custom post types and I need to display an archive for all CPT somewhere in my site. After some reading, I decided that the ...
Ramon Ruiz's user avatar
0 votes
1 answer
15 views

Wordpress giving me the index

i'm having a problem and i can't seem to figure out how to solve it. I'm just beginning to develop custom themes in wordpress and i wanted to create the custom template for portfolio and a single page ...
dev_wannabe's user avatar
0 votes
2 answers
783 views

ACF get_sub_field ALT TAG in the repeater doesn't show

I have one problem. I can't get the alt tag inside me repeater fields in ACF, I've tried multiple methods and nothing works for me, could you please help me? I can't fix this problem for a week :( ...
Tanya Nami's user avatar
0 votes
1 answer
681 views

wp_get_canonical_url showing first url of the post for custom page

I have created a tag.php page in the theme. It's working perfectly. I am getting the tags post on the page. Now I have added the below link to the header.php page. <link rel="alternate" ...
user9437856's user avatar
0 votes
0 answers
219 views

Find php file anywhere in folder and subfolder from template

I'm asking if it's possible to call a php page or to define a link without having to define the folder "detectmobile" where it is located ? require (get_template_directory() . '/detectmobile/...
imagIne's user avatar
  • 53
0 votes
0 answers
192 views

How to save HTML data into SQL post_content column

I have a custom template file containing some HTML tags and get_post_meta function. I want to insert the HTML data into post_content column. Is there a wordpress function or SQL function to save into ...
Morty_Smith's user avatar
0 votes
1 answer
32 views

Create page (not the post type) dynamically

I'm working on a custom plugin where the user/customer will be purchasing a ticket (it'll be a woo product) to take a quiz and win some prize... So suppose the URL of a product/quiz would be like ...
Faye D.'s user avatar
  • 127
0 votes
0 answers
178 views

Why wp_remote_get() fetches certain web pages while it doesn't work for my localhost?

Why I'm not able to parse csv files (or equivalently open them) using WordPress shortcode? Problem: I wish to use a shortcode to Parse Contents of a csv file and display its contents effectively. But ...
User 29449's user avatar
0 votes
0 answers
73 views

RSS feed for a custom page template

I would like to know if it is possible to have a custom feed based on a page template and how? This is my custom query: $my_custom_query = new WP_Query( array('cat' => array (4335, 12488), '...
bpy's user avatar
  • 299
1 vote
0 answers
35 views

Pagination stopped working after assigning custom page template to new page (different slug)

I am having a problem with pagination on one of my CPT after assigning the custom page template to a different page with a different slug. It all worked perfectly on the test page I developed it with. ...
Ralf Weber's user avatar
0 votes
0 answers
24 views

Custom Header added within Dashboard pages, is this possible with custom template files?

I created a custom template and called it Header Home"header-home.php" <?php /** * Template Name: Header Home */ ?> <?php if( have_post() ) { while( have_post() ){ ...
daaaaaaaaaaaaaryl's user avatar

1
2 3 4 5
25