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
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 ...
imdes's user avatar
  • 1
0 votes
0 answers
81 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
23 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
7 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
42 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
19 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
  • 135
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:...
BostonMacOSX's user avatar
0 votes
0 answers
30 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
27 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
11 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
18 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
50 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
  • 145
0 votes
0 answers
23 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
0 votes
1 answer
66 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
0 answers
12 views

May I know where to edit the tax rate?

I'm newbie in Wordpress. Our company website using the shopper as theme. But where can I find this part and change it?
user230346's user avatar
0 votes
1 answer
70 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
54 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
51 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
28 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
0 answers
86 views

display related posts based on the PAGE TITLE

could you please help me to correct the code. I need to display related posts based on the PAGE TITLE keywords, so when page (not post) loads it shows title+content and related block of posts ...
rvznsw's user avatar
  • 1
0 votes
0 answers
12 views

I want to show a list of posts under specified categories

I want to show a list of post under the category to which posts belong. I have created a custom post name->Post Link and it has a taxonomy->new category and I have also created Advance Fields ...
Abdul Rasheed's user avatar
0 votes
0 answers
12 views

I want to show a list of post with title that have link goes to that post and icon under the specific category to which it belongs

I want to show a list of post with title that have link goes to that post and icon under the specific category to which it belongs. My custom post is post link and taxonomy name is new categories My ...
Abdul Rasheed's user avatar
0 votes
1 answer
32 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
245 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
41 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
63 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
124 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
96 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
43 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
58 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
18 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
0 votes
1 answer
242 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
40 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
0 answers
20 views

redirect user from login page if is logged

Is possible to use the is_page('template-name') inside a plugin code? I need to check if the user is logged in and is trying to view the login page. I want to redirect to the profile page <?php if(...
devdev's user avatar
  • 1
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
36 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
94 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
  • 66
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
590 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
505 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
205 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
  • 33
0 votes
0 answers
162 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
28 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
135 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 ...
Abhas Kumar Sinha's user avatar
0 votes
0 answers
59 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
34 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
23 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() ){ ...
Daryl Jake Cantojos's user avatar
0 votes
0 answers
66 views

Show index.php template instead of 404 page template

I have some posts that were permanently deleted, however, instead of wordpress returning the 404.php page template, it is returning the index.php template. In other posts, the behavior is right, but ...
Renan Bessa's user avatar
0 votes
1 answer
49 views

Does wordpress templates always in files or in database?

I have theme and in header.php and I found this templates (see attached screenshot). But there is no content directory in template directory. Even I searched for those files (header-private.php and ...
Avijit Palit's user avatar

1
2 3 4 5
25