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
1
vote
1answer
17 views

Wordpress page templates in a directory

I'm trying to organize my page-$slug.php files all inside a folder, i saw in a post that it was possible to store the files inside a directory in the root path of the theme... i tried to store them ...
1
vote
1answer
17 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
0answers
17 views

Rewrite rules automatically for pages using specific template

I'm using rewrite rules to add an optional parameter to a page. This page uses a specific page template which handles the implementation of an external data source. add_rewrite_rule('^page/([0-9]+)/?'...
1
vote
1answer
16 views

Get list of taxonomies associated with Subscribers

I used this tutorial so that I would have the ability to associate categories with users. However, I changed the code so that it would show only on Subscribers profiles (not Authors like in the ...
1
vote
1answer
32 views

Missing 'Page Attributes'

I'm building my own theme and so far so good. I created a template and named it correctly but it doesn't appear in any drop-down or indeed there's even no page attribute option at all. Do I need ...
0
votes
0answers
14 views

Creating a page/template by inputting content into a form

I would like to create a page in Wordpress by inputting the content into a form field. Here is an image of what I am talking about: Instead of me having to create the page manually and formatting it, ...
0
votes
0answers
38 views

INNER JOIN custom tables - SQL Query

H, I am trying to get results from two tables with INNER JOIN in WordPress theme template file, but I don't know what's I am doing wrong. Please help me, here is the code below global $wpdb; $user_id ...
0
votes
1answer
66 views

Run Product Filter Javascript On Page Template

I am trying to run the below script on a vehicles WordPress page template. The page template shows products that are the result of a product filter (make, model, year, transmission, etc..). The ...
0
votes
0answers
28 views

Get template name (slug) in function.php

I have post filtering by taxonomy, everything works is good, but i want return another html dependence on page template. If this is page "about us" return another html tag. This is my working code, ...
0
votes
0answers
26 views

How to Refresh Page Template Settings

Is there a method to refresh the page template settings when a new layout is dictated? I just changed the top-level pages of www.rodwellbuildingservices.com master menu such as page ...
0
votes
0answers
24 views

Custom post type not pulling CSS

I created a page template for CPT but the it's not pulling up the CSS. Can anyone please tell me what could be the problem?
0
votes
0answers
47 views

Show Yoast SEO meta tags in Custom WordPress Templates (Theme)

I overwrote twenty nineteen theme in WordPress and included all my templates. After that, I installed the Yoast SEO plugin to add dynamic meta tags to pages created using custom templates. I have ...
0
votes
2answers
21 views

Blog template with different header to rest of site

I would like to change one thing on my wordpress custom template - there are big image sliders used throughout the site except on the contact us, checkout and my account pages. The blog page was added ...
1
vote
1answer
37 views

how to use custom page template in a page?

I have a custom page template, and I want to use this in my page. I have created a new page and in template choose custom page template name. It's working, but I have added 4 blocks in my page, and ...
0
votes
0answers
15 views

Woocommerce Templates - How do I change page template layout? How do I edit shop page?

Ok, forgive my frustration. I am going absolutely bonkers with this. Where the hell do I edit the page template (layout) for the shop page? I realize (now, after much frustration) that it default ...
0
votes
0answers
28 views

page.php template file render a core gutenberg component programmatically

Is it possible to render a Gutenberg component programmatically directly in page.php template file? I don't have specific requirements and I am newbie as well in Wordpress with Gutenberg. But I was ...
0
votes
0answers
32 views

Set a template on a custom post in the plugin

I looked at some answers and didn't help I'm trying the next section (right away) but it returns the template if errors in WordPress's built-in function lines. Like get_header () add_filter('...
0
votes
1answer
13 views

Page with some post value id showing page not found

I have customized the template and sending some value using POST method to each custom page. All custom page is working good except the last custom page where I need to insert the data with mail send ...
0
votes
1answer
23 views

Remove sidebar on single page using plugin API

I’m building a plugin that requires a full width page for a large table. I want to control the sidebar on that page regardless of the theme being used. How do I either, remove the sidebar ...
0
votes
1answer
99 views

the_content() printing DOCTYPE, <html> and <body> tags in the middle of page

I'm building a custom Wordpress theme and I've just come across a bizarre issue where the_content() seems to be printing out the page content wrapped in the following: <!DOCTYPE html PUBLIC "-//...
1
vote
1answer
55 views

Choosing a default page tempate (Classic => Gutenberg)

This code was working in the "Classic" era to set a default page template: /* Blank Page by default */ add_action('add_meta_boxes', 'blank_default_page_template', 1); function ...
1
vote
0answers
27 views

Showing the WordPress standard text area on a Woocommerce Single Product Page?

I'm trying to show the WordPress default text area on a Woocommerce Single Product Page but can't find the appropriate hook to add to the template? I would have thought it would've been well ...
1
vote
1answer
27 views

list pages using page.php and NOT page-{slug}.php

I made a view templates for specific slugs page1-220 use page.php contact uses page-contact.php service uses page-service.php Now I want to list the pages with their templates on a "overview" ...
0
votes
0answers
13 views

Wordpress convert html section to widget

I have converting html template to wordpress. In home page i need to create customize section. while converting i could't convert image with specific classes. HTML Code: <section class="homePanel ...
0
votes
0answers
19 views

How can I use a custom template to load custom post type posts based on a post_meta value

I have a CPT which saves a location and and its slug into wp_postmeta table. The location is selected from a dropdown in CPT edit page and it is not a taxonomy. Now I want to create a custom template ...
0
votes
1answer
28 views

Page template not working when logged out

I created a page template that removes the navigation and footer coder (while still keeping the call to the style sheet and any javascript) and it works when I am logged into wordpress, but when I log ...
0
votes
1answer
23 views

Subpage is redirecting to spam site

My Wordpress site has recently been hacked and I followed the steps described here to clear it: https://wordpress.org/support/article/faq-my-site-was-hacked/ The whole site redirected to a spam ...
0
votes
0answers
137 views

Help where theme CSS overriding Elementor page builder CSS

am using Phlox theme and Elementor page builder to build my site www.kirstenwucher.com Issue with spacing suddenly cropped up and although I am not a coder and web designer through asking and getting ...
0
votes
0answers
14 views

How to insert page-heading in custom page?

I am using Jobs for Wordpress plugin and single jobs page doesn't have a page-header with a page title. I would like to have a page-header like on every other page and not to make it from scratch. ...
0
votes
0answers
28 views

How to redirect to a login virtual page?

I'm writing my first WordPress theme from scratch. I need to redirect not logged in users to a virtual login page, when I do wp_safe_redirect( get_site_url() . '/login' ) I would show a virtual page ...
0
votes
0answers
13 views

edit_form_after_editor hook not work

I'm following a tutorial to create a custom page builder based on bootstrap 4. I have a problem with the page template registration, I've installed the classic editor and I've tryed to make it a ...
0
votes
1answer
24 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
0answers
19 views

Show alternative menu based on page template AND post category

I'm trying to display a menu based on the page template AND the post category is used. I got it to work for the page template like this: if (is_page_template('page-template-heroes.php')){ ...
0
votes
0answers
12 views

Ho to get page URL assigned to specific page template (outside that template page)

I have created custom page template (template-clock.php) This template is dynamic and it is getting information by link (?cat=99). Now I want to create dynamic link to that page from home page. But ...
0
votes
0answers
20 views

wordpress template showing black images instead of the url image only on Safari browser

My wordpress template called boxwp is showing black images instead of the url image i load using <img src> . This happens only in my template and only on. Safari browser. I checked chrome and ...
0
votes
0answers
18 views

Search button click sends to single-custom_post_type instead staying at the same page

I created a template to display search results based on user selects. The problem is after I click on the search button it sends to the single-product(This is a Product custom post type). I also have ...
0
votes
2answers
64 views

Calling a function from functions.php in custom page/ blog post

Is it possible to call a function from functions.php in custom page or blog post? I put simple function in functions.php: function testTest() { echo "Test"; } And called it from the page: <?...
0
votes
1answer
28 views

How do I get the page template name chosen?

I'd like to modify the admin so the default text editor is removed whenever someone is using the default template. (If they manually choose something other than the default, keep the editor). if ($...
2
votes
1answer
13 views

Taxonomy page template changing when using query variables

I'm hoping someone can help me fill in the gaps in my understanding of page templates and query vars: I've registered a custom taxonomy 'stream', and have set up a page template for that taxonomy, ...
0
votes
0answers
10 views

Missing content on page, seems to have happened recently but latest revision date says June 2018

Our front office recently realized one of our pages was missing all of its content. (Theme, navbar and sidebar, are all intact.) I check the page in WordPress and it shows the latest Revision was ...
0
votes
1answer
19 views

How to integrate custom HTML template in a premium wordpress theme?

I have installed a premium wordpress theme in the server. But I just want to use my own html and css in the page template. There will be a new header, footer and menu. Is there any way to do that ...
0
votes
2answers
31 views

Single-page.php template file name not shown

I am developing a theme and I noticed that get_post_meta($post->ID, '_wp_page_template', true); returns 'static-page.php' (as expected) when queried on static pages but returns nothing (expected '...
1
vote
0answers
21 views

need help with a user-specific custom page template

I created a custom page template that will show sales from a hotel. I have 3 users and I want each user to only see their hotel sales on a user profile specific page. The template calls data using the ...
0
votes
0answers
23 views

How to show WP admin edit page within template page/post?

So I am wanting to show the wp-admin/post.php?post=999&action=edit Inside my custom template of the single.php and page.php. So I understand that I can do it using an iFrame by basically ...
0
votes
0answers
15 views

Pagination Shows Up But Won't Work on Custom Gallery Page

I'm trying to build a post gallery page with pagination. Posts and pagination are displayed fine but for some reason pagination won't show the clicked page and remain on page 1. This is my code: <?...
1
vote
2answers
107 views

Disable front-page.php template

I use front-page.php on my template to display home page. But I want to disable if the user uses another page for the home page from settings. Is there a solution? When user select a page from ...
0
votes
1answer
73 views

Pre get posts where template is not equal to one specified?

I'm trying to not show certain posts in the admin area based on the page template. Here is what I have so far: add_filter( 'parse_query', 'hide_some_posts' ); function hide_some_posts( $query ) { ...
0
votes
1answer
33 views

How to properly add and access a JavaScript file in Wordpress?

I intend to use a JavaScript library on my WP website and have uploaded the JS file via FTP to the following directory belonging to the currently activated theme Salient: /public_html/wp-content/...
0
votes
1answer
129 views

Page template added via plugin not saved in Gutenberg

I have added page templates via plugin. It works absolutely fine with classic editor but while using Gutenberg, the page can not be published when page template is assigned. However, page templates ...
0
votes
0answers
21 views

I want to edit the tags template by adding text that displays all tags from the listed posts

So I have tag "Iphone", I enter on page of this tag and there I get the: h1 description Listed posts that have this tag I want to add between description and listed posts the sentence: You can also ...