Stack Exchange Network

Stack Exchange network consists of 174 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
1answer
18 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
0answers
9 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
18 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
23 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
18 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
23 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
26 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
21 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
7 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
15 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
40 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
0answers
16 views

WP create a template for pages that aren't inside of the DB

I have a question. Is it possible in Wordpress to create pages, that aren't actually inside of the wp_post table? What I would need is, anytime there is a page with a certain slug, such as www....
0
votes
2answers
27 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
21 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
26 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 ...
0
votes
0answers
22 views

Child Page with custom queried page not working in wordpress

I have created a custom post type in my wordpress theme. In that i have kept area taxonomy. I have created custom page template also for this if the page is parent then it works fine. If i keep it as ...
0
votes
0answers
28 views

Custom page template returns to default page template after saving

I have a custom page template set up in Wordpress. When I select it and save a page, it returns to the default template. After reading another question on the subject, here's what I've tried: *...
1
vote
2answers
24 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
21 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
31 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
0answers
8 views

How to change the price plan table through template and how can I change it in WordPress

How to change the price plan table through template and how can I change it in WordPress...means, I want to give my price plan table look new and eager to know where I can make some changes in order ...
0
votes
0answers
25 views

Wordpress Templates missing

Woke up this morning to a broken website because my wordpress templates that come in my theme are not showing in the "Page Attributes" section on the page editor. Any clue to why they disappeared? I ...
0
votes
0answers
16 views

What is the best approach to create Pages with same Page Template but different post types?

The goal is to have something like this below in Wordpress: Three pages : Cars Movies Fruits Three Post Types cars_posts movies_posts fruits_posts Each Post Types have multiple posts ...
0
votes
1answer
40 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 ...
1
vote
1answer
58 views

Wordpress showing archive.php instead page

I have a problem with same name (slug) for category and page and wordpress is showing archive.php instead page custom template. Permalinks settings for category is . and i want to stay this way but ...
0
votes
0answers
16 views

WooCommerce cart handling problem

I use Aventura wordpress template and predefined tour_cart parameter to handle cart. I directed to URL like this, when try to put some items to cart: tour-cart/?tour_id=2100&people_available=&...
0
votes
1answer
40 views

get_page_template_slug returns incorrect path

I'm currently experiencing a very strange issue which I can't find any reason to it. I have a theme which is working fine on all servers. Now, I have one client who is having issues with it. The ...
0
votes
1answer
27 views

Template for front page (latest posts)

I am having index.php -> This renders the latest post with sidebar page.php-> This renders the page layout : Templates are fullwidth,sidebarleft& sidebarright single.php-> This renders the ...
0
votes
0answers
41 views

Creating template files for custom taxonomies

I have created custom post type Products using CPT plugin, then I created three custom taxonomies to be used when adding new products, let's say they're Brands, Usage and Types. What I'm trying to ...
0
votes
0answers
13 views

Page is not loading is it the page template code?

I am having a problem when trying to load a page using a page template. Other page templates are working so this leads me to think it is the page template code which has been created. Can anyone help ...
0
votes
1answer
18 views

Adding styles/scripts to specific page

I'm trying to add styles and scripts to specific template, But it's not working. In functions.php I tried: if( is_page_template('file.php') ){} if( is_page_template( get_template_directory() . 'file....
0
votes
1answer
1k views

Custom page for WooCommerce's /product-category/

I am building a website from scratch on WordPress using WooCommerce. I'll be having products from numerous brands and to have an easier time organizing them, I've made each brand a category. Currently,...
0
votes
1answer
73 views

Custom URL redirect in WP

I am trying to make my own redirect page for external link. My target My target is that, when a user open the link www.mysite.com/wp/GoTo/?URL=www.google.com, the browser open the page www.google....
-1
votes
1answer
22 views

Inject class in body when particular page template is used

<body <?php body_class(); ?> > In header.php I have written the above code. But I want when this page template is in use: page-customer.php then body_customer class should go above. ...
0
votes
0answers
69 views

wp_logout() not working after form submission

I am pretty new to Wordpress, so please forgive me if this sounds like a silly question. I have a Wordpress Page which is using the default page.php template in my theme. I modified the page.php ...
1
vote
1answer
24 views

Change content of page in child theme using plugin

I have a child theme in which I created a page template. I am able to show different content based on time of day by writing some PHP inside the actual page e.g. if ( $time < '10:00'){ echo "The ...
0
votes
1answer
21 views

Plugin json page

From a simple plugin I have to create a page where to give data in json form. function create_page_json() { $return = array( 'value1' => '1', 'value2' => 'ok' ); $...
8
votes
1answer
242 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 ...
0
votes
0answers
21 views

dynamic parts inside a (template) page

I’m developing a site that’s needs to be easy to change on the go by people who have almost zero understanding of coding. So I’m coding a WordPress theme so they can change allot of aspects later on. ...
0
votes
0answers
19 views

Is it possible to create blog posts that open as new landing pages? (i.e. can each new blog post be a new landing page)

We are a commercial real estate company that updates our properties by posting new blog posts into 2 major categories, sale and lease. I want to turn these blog posts into individual landing pages for ...
2
votes
2answers
324 views

Custom Post Type slug same as page name causing a conflict

I have a Custom Post Type all set up. I would like the slug to be the same as a page name, because all of these CPT's will be queried on that particular page (/team-members). If I set the Custom Post ...
0
votes
2answers
65 views

Change text size and color for tags and category meta description on product page

how can I change text size and color for SKU, tags, and category meta description on the product page? It's too big and bright. Takes too much place especially in the mobile version. Thanks!
2
votes
1answer
27 views

Dequeue theme stylesheets but keep widget styling on custom page template

Bit of an unusual one. I have created a plugin that will only display content on a custom page template. For this reason, I have dequeued all the theme styles via $wp_styles and loaded in the plugin ...
0
votes
0answers
18 views

Paginate links repeating value in links

I would like the pagination of a certain page to look like this: site.com/page-name/page/2/paged2/1 so I used this: <?php global $wp_rewrite, $wp_query_videos; $wp_query->query_vars['paged'] ...
0
votes
1answer
387 views

Woocommerce not showing reviews

I am using a custom Woocommerce page template for the single-product.php - however the page isn't displaying any reviews or the box to add reviews. I have checked the settings for Woocommerce to ...
0
votes
0answers
26 views

Set page title in WordPress with PHP

I know this question has been asked thousands of times before, but I have attempted a lots of these solutions without any success. Attempted solutions, among others (added to the template page) ...
1
vote
3answers
21 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 ...
1
vote
1answer
134 views

Use same page template for parent and child pages in a theme

I am working on a template which one uses on both parent and child pages. Suppose I have a: template name: TEST I need to use that template on both parent and child pages: Parent page name -> ...