Skip to main content

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
1k 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
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
729 views

Show all parent pages and their children below from same author as currently viewed page

I am trying to create a section on my page template that displays all the parent (top level) pages with its children listed below but only by the same author of the currently viewed page. I have this ...
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 ...
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 ...
1 vote
2 answers
2k 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
1 answer
958 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
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 ...
17 votes
2 answers
49k views

What does is_page_template() compare against?

Looking through the Wordpress documentation, it says that is_page_template() compares against a "template name", if one is provided. I have a template stored in page-homepage.php called Homepage: /* ...
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
829 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' ...
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 ...
2 votes
3 answers
3k 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 ...
0 votes
0 answers
13 views

Latest Wordpress Version Changes to Block Editor Template

With the latest version of WordPress I noticed that I'm not able to change the template file based on the custom page templates that I've made when I'm on BLOCK EDITOR mode. I am ONLY able to change ...
1 vote
3 answers
1k 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
1 answer
708 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 ...
1 vote
2 answers
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
111 views

How to delete a page template created from the editor?

I was experimenting and tried creating a page template from the page editor by clicking the button below. I no longer want that template there, as I'm just going to do it the old-fashioned way and ...
1 vote
1 answer
741 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(); ?>
0 votes
1 answer
677 views

Short code template + ajax

I am doing a simple page that would work a single page inside Wordpress using Ajax. So to do this, I create a template page with a short-code in it. But the thing is that I really can't do ajax work ...
0 votes
1 answer
1k 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 ...
10 votes
6 answers
36k views

Page editor missing Templates drop down

Update: As with so many mysteries, the cause turned out to be extremely stupid. I had the file saved in a different theme's directory. Thanks to @a4jp.com I'm building a theme using underscores. I've ...
5 votes
2 answers
2k views

Creating Ajax backend for Specialised Page Template? Should admin-ajax.php be used?

We're scoping an upcoming project that will require the development of a large php web application within an existing wordpress site - this is for our use only and we've no intention of trying to ...
14 votes
2 answers
3k views

How to move page template files like page-{slug}.php to a sub-directory?

I want to move page template files like page-{slug}.php to a sub-directory within my theme, in a way that WordPress will recognize them automatically. If the page templates of the said form doesn't ...
1 vote
1 answer
97 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 ...
1 vote
1 answer
363 views

Hide individual page title using checkbox in custom meta box?

I tried to write code to have a checkbox on Pages in the backend to check if I want to hide the title of the page in frontend. But I find that the post meta is sometimes reset to show the title even ...
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 ...
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
812 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. ...
0 votes
0 answers
14 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
0 answers
13 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 ...
1 vote
1 answer
56 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
55 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 ...
84 votes
4 answers
120k 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 ...
0 votes
2 answers
123 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 ...
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 ...
2 votes
1 answer
297 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 (...
0 votes
0 answers
124 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
674 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
32 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
659 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
13 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
33 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
92 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
37 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
6k 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 ...

1
2 3 4 5
25