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
0 answers
6 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 ...
0 votes
5 answers
3k 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
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 ...
1 vote
2 answers
794 views

Custom Post Type Template Alternative

I've managed to figure out how to use Custom Post Type templates now and they are great. I do however want to know if there is not a way to use a current template I have developed for other pages. ...
1 vote
1 answer
738 views

Template selection area is not visible on page editor sidebar in wordpress twentty sixteen default theme

Template selection area is not visible on page editor sidebar in wordpress twentty sixteen default theme <?php /** * Template Name:Zoho testAPI * * * * */ echo phpinfo(); ?>
1 vote
1 answer
1k views

Custom Loop Using Shortcode in Custom Page Template

I am trying to output a custom loop created using shortcode in a custom page template. Here is the code I am using to generate the shortcode: function archive_sc( $atts ) { // Attributes ...
0 votes
1 answer
704 views

Search custom post type result in same template page

I have a saperate search section for products custom post type. Required result within the same page with pagging. and once clicked on any result it show in saperate page. But all in product custom ...
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 ...
0 votes
1 answer
865 views

Wordpress page template to show posts as per category dynamically

New to PHP. I have a custom page template that I want to use to show a list of posts. The idea is that each post has a category and I can provide a category to a page. For example let's say there are ...
0 votes
0 answers
10 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 ...
0 votes
1 answer
806 views

How can I create a button that when clicked populates a div with a list of foods that are checked as a certain type of ACF?

I have not asked any questions here before so I'm sorry if I do it wrong. I am new to custom theme template files. I am new to wordpress and php also. This is a learning exercise for me. I am making a ...
1 vote
1 answer
33 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 ...
0 votes
0 answers
26 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 ...
83 votes
4 answers
118k views

Create custom page templates with plugins?

Is it possible to make custom page templates available from a plugin?
5 votes
1 answer
7k views

Loading custom page template via plugin

I am following a rather outdated tutorial on custom post types and the last step is to create a custom page template, where this is intended to show all posts of the custom type in archive listing ...
1 vote
1 answer
4k views

How to get the value of input hidden html from text editor to custom page template?

I have 10 or more input hidden in 10 or more pages with different values in Wordpress text editor and I want to get the value using $_POST in a custom page template. How to do this? I tried to called ...
2 votes
2 answers
2k views

Full width layout for custom post type pages

I'm trying to remove a widget area called 'Primary' from a certain page on a site. This is the function where I manage the sidebars: //ADD CATEGORIES IN SIDEBAR OF SINGLE POST TYPE add_action( '...
0 votes
1 answer
1k views

Redirect based on referer using Advanced Custom Fields

Im currently trying to protect some WP pages by assigning a specific template to them. Ive created the ACF fields "Referring URL" and "Redirect URL", as these could alter depending which page the ...
1 vote
2 answers
1k views

How to duplicate a page template but make minor changes to the header?

I will apologize in advance, I am very new to this. I have been teaching myself php as a hobby, but now I need it for work! I don't work as a web designer, but to try and save some money, I need to ...
0 votes
2 answers
1k views

How to use custom footer template in a site-plugin?

I have a site-plugin to centralize most of the theme customization. I want to override the default footer.php template with a customfooter.php (removes the Proudly Powered by WordPress) stored inside ...
0 votes
2 answers
2k views

Display images in template file

I have one template file for the main page, after creating home page I have added text to check if it reflect changes on my home page or not and it was successfully displaying text. But when I try to ...
0 votes
1 answer
900 views

Restrict Access to Logged-In Users Page Template

I am trying to create a page template that restricts content to only logged-in users, if they are not logged in then they are re-directed to a specific page. I have created a page template called ...
0 votes
1 answer
1k views

How to edit woocommerce sub-category page

I am trying to make a product listing site using WooCommerce. Now the system is when someone clicks on any category, they go to the subcategory page. I want to add a sidebar with all product ...
0 votes
2 answers
807 views

Creating custom post-listing templates in twentyseventeen child theme

I'm using a child theme based on 'Twenty Seventeen' and have created a custom post type ('review'). I want to make two Pages, one which lists 'reviews' and the other which lists a mixture of 'posts' ...
0 votes
2 answers
105 views

How to Change Site Elements based on referring URL

I want to create WordPress website that changes branding and theme based on the referring URL. We provide white label services to funeral homes and we want to create a generic site where funeral ...
1 vote
1 answer
2k views

I want to duplicate homepage for all my pages

I want to duplicate my homepage then call the pages A. page b & c. - So that I can edit just a few things on all the pages. I already have some pages but I can't get bits exactly the same.I copied ...
0 votes
1 answer
15 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 ...
2 votes
3 answers
2k views

How to specify which Gutenberg blocks are available in the editor for a page template

Using an example given here: enter link description here I've successfully been able to restrict the block types available globally or by post type (eg: page). But what I really would like to do is ...
2 votes
1 answer
2k views

Hyphens instead of Underscores in Post-type Archive Template Filenames when Post-type handle contains underscore

I'm working on implementing WordPress coding standards on a theme which has several custom post-types, each of which have underscores in their handles. The theme uses the custom post-type handle in ...
2 votes
1 answer
231 views

Get name of current page template in Gutenberg era

In a block theme I'd like to be able to make some edits to the head meta based on the (block-based) page template used. The traditional get_page_template() doesn't seem to work as hoped in this case (...
1 vote
3 answers
801 views

How to create a custom page(not a template) in a theme

I have been searching for theme developing info but all that are related to this subject are talking about a custom page at page.php. What I am trying to achieve is different. The scenario is that I ...
0 votes
0 answers
89 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 ...
0 votes
1 answer
655 views

AJAX Post from same domain to a wordpress page

I am trying to create an ajax post listener to a wordpress page in a domain (let's just say http://example.com). Another web app in the same domain (http://example.com) exists and a user sends ajax ...
0 votes
0 answers
25 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 ...
0 votes
2 answers
486 views

How to get a page url segment on wordpress?

I've created a regular wordpress page named "user" which is using a custom template. This page is supposed to be called like so: www.site.com/user/<ID> Is it possible to get the ID ...
0 votes
0 answers
10 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 ...
0 votes
0 answers
23 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:...
1 vote
2 answers
53 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. ...
0 votes
1 answer
22 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=&...
0 votes
1 answer
5k views

No templates for condition page.php Elementor [closed]

I am building a WordPress theme and I want it to support the Elementor theme. But I get this error in Elementor Debugging mode. No Template for condition > theme name -page.php What could be the ...
0 votes
0 answers
33 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 ...
0 votes
1 answer
29 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....
0 votes
0 answers
12 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 ...
4 votes
2 answers
631 views

load/require specific php files for specific pages/templates/post types

I have a plugin with multiple php files. I want to load some of them only when specific template files are loaded. I don't want to load everything. Currently, I'm doing it with add_action( 'wp', '...
6 votes
4 answers
24k views

Is there a default template file for child pages / subpages?

This seems like a very simple question. I'm looking for something like sub-page.php or page-child.php where I can do some different things on the child pages of my theme. They are different enough ...
19 votes
6 answers
21k views

How to *remove* a parent theme page template from a child theme?

I'm using the TwentyTen theme to create a child theme, but I can't seem to get rid of the 'One column, no sidebar' page template that is in the TwentyTen parent theme. I thought just copying it over ...
0 votes
0 answers
23 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'...
2 votes
2 answers
382 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: ...
0 votes
1 answer
79 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 ...
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 ...

1
2 3 4 5
25