Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

0
votes
0answers
14 views

How to load page template according to the Searched Page

I have a search form which uses RELEVANSSI plugin to perform search and display Search Results. On my Search Results page there is pagination and Search Filters(hyperlinks) which allows user to show ...
-1
votes
1answer
20 views

Display text on a page on Internet Explorer browser only in WordPress

Client looking to display some text on a few pages of a WordPress website, but display for Internet Explorer users only. The message essentially will say that certain functionality won't work on such ...
0
votes
0answers
11 views

I can't see any options when I click on add theme and when I edit on Home Page using Elementor I get error

I have 2 errors on my wordpress websites:- 1) When I click on add theme, I cant see any option just blank screen like this. 2) When I edit Home Page using Elementor, I get the following error, Can ...
0
votes
1answer
14 views

How to show metabox on page if it is using a template

I was creating metaboxes for a special kind of pages. But i got stuck when showing metaboxes to the pages only who currently have the template 'Sky'. my template file name is sky-template.php and ...
0
votes
0answers
14 views

Woocommerce widgets don't appear on my custom template

I have created a page in Divi theme, and i displayed the shop grid with a loop. I tryied to add in the sidebar, a widget (Filter by price), but it doesn't appear on my custom page, but in the shop ...
1
vote
1answer
22 views

Problem with parameters in url and pagination

I created a custom template page and I show users list in it. I have a pagination for this users list and when I add a user to this list, I show a message at the top. This messaged is created from a ...
0
votes
1answer
27 views

providing access to post_id or post inside functions.php

I'm trying to add metaboxes to the bottom of any post which is created from a specific post template. ie I don't want metaboxes on all my posts, just certain posts. At the point when I decided to ...
1
vote
2answers
36 views

How to redirect Wordpress home page to custom static HTML page

I am facing an issue while I upload the custom HTML page into my Wordpress site. The page all alone working fine as I put it in separate folder or if I change its name to index.php . But then their ...
0
votes
0answers
12 views

How to use comments on a page template? Can't get them to show [closed]

I made a custom JS tool with a page template. It is set up like page-mypage.php. I want to add comments at the bottom, like what you see in regular pages. I enabled the "allow comments" checkbox on ...
0
votes
1answer
5 views

How to use the same custom page template to iframe multiple urls with entry of new url entered from backend

I am using this custom page template to iframe mulptiple urls. Currently I have been making a new custom page for each new url. I want to be able to use the same generic custom page template, and be ...
0
votes
1answer
26 views

How to save multiple values in custom post type from front end to back end

i created a plugin in WordPress , i created custom post type called "invoices" here it's the code add_action('init', 'invoices_register'); function invoices_register() { $labels = array( '...
0
votes
1answer
18 views

Set page template automatically according to parent slug

I've seen several similar topics on this forum but still unable to come to a solution. I have a parent slug named "en". I named its template as "page-en.php". Every time when I make a child page ...
0
votes
0answers
12 views

Display template content without reload of the page

I want to create a page in wordpress where red part will be a list (titles) of problems, yellow will be the content (description) of the problem, and blue will display a list of products what will ...
0
votes
2answers
20 views

How can I make custom page templates work on child theme?

I have created a page template called concert.php under page-templates directory with the following content: <?php /* Template Name: Concert*/ add_body_classes('page_concert'); /* Custom ...
0
votes
2answers
25 views

Wordpress pass url to page template when page does not exist

I created a page template to serve information dynamically. For url like example.com/the-hamptons => index.php?page_id=92&filter=the-hamptons For url like example.com/page-that-exists <- ...
0
votes
2answers
58 views

How to display the contents of URL1 when user visits URL2

I know how to do it with apache/mod_proxy, but I can't use mod_proxy on our shared host. So no .htaccess solutions. Currently I have the following code in child theme's page.php global $post ; if( ...
0
votes
0answers
26 views

How to add a full working piece of website already coded, to a large scale Website design project?

I've written 5 PHP files each of which are dependant of each other and contains one style.css also. This whole project works fine when executed alone and includes home.php which includes HTML code for ...
0
votes
3answers
49 views

WP_Query returns different results from get_posts() [closed]

So I have two code snippets, trying to get the child pages of the current page. The current page is "Sample", and the following code lives in page-sample.php. The first snippet uses get_posts() $...
2
votes
3answers
29 views

Loading page template into shortcode

I am attempting to load a page template into a shortcode so I can easily load the content wherever I want. I have done some research and many people have said this code has worked for them but for ...
0
votes
1answer
20 views

Hide Page Title with Post Meta

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
0answers
11 views

Finding and removing a particular page that shouldn't be active

So I have rogue pages that are in my site, that shouldn't be there. Using a theme, and these are left over from the theme I believe. I'm new to wordpress, and I'm trying to figure out how to find the ...
0
votes
1answer
66 views

is_page_template not working

Hi trying this code below to get working, but no look so far. Idea is simple if page template is page-47.php display <h1>Something</h1> else <h1>This will show on any other page</...
0
votes
3answers
29 views

Why doesn't my very simple jQuery work?

I just deployed a new Wordpress site. Everything looks good, now I'm setting up jQuery: Child theme functions.php: //enqueue scripts function my_theme_enqueue_scripts() { wp_register_script( '...
0
votes
1answer
18 views

Showing Custom Post Type with his templates on a custom page template

So here's my question: I need to build a custom post type to add employees to a website. The problem is, it need to be shown: 1 - Image on the Right 2 - Image on the Left ... and so on. For this I ...
0
votes
1answer
13 views

get_avatar() as backround image

<div class="kkk" style="background-image:url('<?php echo get_avatar_url(); ?>')"></div> I want to make to appear my avatar as a backround image in this code, but it doesn't work. ...
0
votes
0answers
21 views

Wordpress Product Detail and catalog

I want to have post for every product, some product may have similar feature.For example Size with different Value for each one. and some other product doesn't have Size Feature. i see this page and ...
0
votes
1answer
30 views

How to require specific PHP files for specific templates

How can I require specific PHP files for specific templates without any hook? Example: I've one PHP file "autocomplete.php' and once a page template "photographers.php' Now I want to require '...
3
votes
2answers
49 views

Add Archive Page Template via Plugin

So, I'm in the process of writing a plugin for a specific site. I understand WordPress picks the page template from the theme, with php script names according to the chart below. However, I'd like to ...
-1
votes
2answers
44 views

page-{slug} not loaded in custom theme

I'm working on a custom template for WordPress. I've created some page and then created the relative page-{slug}.php (example page-careers.php) that are supposed to be loaded from WordPress when the ...
0
votes
1answer
15 views

Displaying posts inside table having issues

I am trying to create a comparsion table like the attached image. But it was not working like in the image. for that i have done following code what i am getting is not like the image for example the ...
0
votes
1answer
20 views

get_the_excerpt() inside WP_Query - link URL Incorrect

I have a custom WP_Query loop, to pull out specific posts, that is working exactly as expected. The link can be retrieved from get_permalink(), as can any content that I'm requesting including ...
0
votes
1answer
12 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
1answer
20 views

redirect automatic page that serves custom posttype content

I registered blog as a custom post type. This content is queried on the page page-actueel-blog. But mydomain.com/blog also serves content (by default titles are queried). I don't want visitors to ...
0
votes
1answer
28 views

Set page template programaticlly in plugin

Task: I have created a page using my plugin and that page has to be set a certain page template within page creation. Everything works apart of setting page template. I have manually moved page ...
0
votes
0answers
24 views

How to Remove/Edit CPT template Content with Custom Meta Box

I try to Remove CPT template(single-proucts.php) Content with Custom Meta Box. I created a Input select option for change content in my CPT metabox it's working then update post I need to change ...
0
votes
0answers
24 views

Change Page Template Based on URL Rewrite in WordPress

I have created a custom post type author when it takes to single author details it was working fine. For example http://localhost/author/james/ It was showing single-author.php file. My question is ...
0
votes
1answer
27 views

How can I add text to a specific 'Edit Page'?

I have a specific Page, that I do not wish to be edited. As such, I would like to place a 'Do Not Edit This Page' message within a specific 'Edit Page' file as follows: Any ideas on how this can be ...
0
votes
1answer
22 views

Change Size of P Tag on One Page Template [closed]

I have two blog types on my website (Blogs and Updates). I need to change the P tag font size in both page templates. These are the page templates that show a list of the posts/articles. Blogs page (...
0
votes
1answer
10 views

Inserting article:tags meta in html head-element, using get tags, no wp_head

I´m trying to add code to a template file of mine, working with a raw theme I generated from “”. The file is a duplicate of single.php and called single-post.php. Like WP states in Codex. I am trying ...
0
votes
1answer
16 views

Static page won't identify template

I have two pages, one working correctly and one broken. The first is called Calendar and it has an ID of 34. I created a page template called page-34.php and wrote some custom code, and when I load ...
0
votes
1answer
12 views

Create page when a new site in multisite network is created?

I found this code to automatically create a page when a new site is created in the network. But I cannot figure out how to set which page template to be used when the page is created. I have a custom ...
0
votes
1answer
44 views

How can javascript be added to a custom-page.php template?

How can javascript be added to a custom-page.php template? How can the following javascript gotten from w3schools ajax tutorial be made to work from a custom-page.php template? Any help would be ...
0
votes
2answers
29 views

WordPress blog posts template bug [closed]

I'm facing an issue I've never seen before. I fully copied a WP website to my localhost machine and everything was looking fine. When I was trying to make some changes on the blog page template (that ...
0
votes
0answers
22 views

how do i fixe Page Builder on a custom page?

hi i create a theme from scratch for wordpress (with header and footer) i did my home-page but for the other page i wanted to keep the header and the footer and using Page Builder for the content but ...
0
votes
1answer
28 views

inserting content of 1 Post to in another with a template hierarchy

I have a page template I use for landing pages for various ad campaigns. The template uses custom fields for things like headlines and other shorter pieces of content within the page. However the ...
1
vote
2answers
26 views

Adding sidebar to template creates horizontal gap the size of the side bar

I have been killing myself trying to figure this out on my own. And I for the life of me cannot figure out what is causing my issues. I created a template for the testimonials page and used custom ...
0
votes
0answers
25 views

issues with Custom Post Type retaining page template value after publishing

As the title of this post implies, I am having issues creating/editing posts of a Custom Post Type, assigning it a page template via the 'Attributes' metabox and having that page template display as ...
0
votes
0answers
74 views

Woocommerce endpoint titles in my account template

I am working with woo-commerce user dashboard template. I need to print the title of current endpoint instead of the_title();. following image snapshot of DOMIAN.com/my-account/orders/. there should ...
0
votes
1answer
74 views

Use same page-mypage.php template for several pages

How can I use the same page-mypage.php file for different pages, without resorting to page templates?
0
votes
1answer
24 views

How do I customize the post page

I'm currently trying to add an post page on my Wordpress website. I put my new post page as the default post page, on Settings -> Reading. The id of my page is 353. So I created a new php file named ...