Pages are one of WordPress's 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.

learn more… | top users | synonyms

0
votes
0answers
20 views

Using a custom template to fill a page

I have a custom post type, which I would like to display on a standard page (because of my single page layout). I tried this using a custom template, but the page renders completely empty. What am I ...
0
votes
0answers
10 views

Ampersand in Title Causes issues in Breadcrumbs & Sidebar

I'm having a problem with ampersands in Wordpress Page Titles. I have a sidebar that displays the Page Parent Title & a list of children underneath. If the the Page Parent Title has an Ampersand ...
0
votes
1answer
38 views

wp_login_form redirect problem

I have added a login form to a page template using wp_login_form(). This page template is used for a welcome/login page for an online seminar. When the user logs in I want them to be redirected to the ...
0
votes
3answers
30 views

Page uses index.php instead of custom template while changing permalink

I'm asking this question with the hope. Here is the problem: I made a custom page template with comments in it [/Template Name: custom page template/] and assign this template to a page. This page ...
0
votes
1answer
39 views

Get pagination working for custom loops within page templates

I've got a custom loop for which I'd like pagination. The codex and examples I've found online indicate that I should get pagination as long as I pass the 'paged' query variable into the loop as the ...
0
votes
1answer
20 views

Can not hook into custom post type template with: is_page() conditional?

I am using a custom post type: FAQ, to create an ongoing page of FAQ items. I have created a custom template: faq-template.php, to display the items. I need to hook other elements into the bottom ...
0
votes
1answer
18 views

custom fields not showing before get_header

I am trying to use this code in my WordPress site <?php if(get_post_format() == 'video'){ function insert_game(){ get_template_part( 'content', 'video-top' ); ...
0
votes
1answer
48 views

How can I modify a custom post type and custom page template for a child theme if all content seams to be handled by theme's 'native' plugin?

I need the child theme to use a 'modified' version of its parent custom post type and correspondent page template. Basically I would like to add 5 new metaboxes, change 2 existing labels, and include ...
0
votes
0answers
15 views

Header appears twice

I've simple custom page template like this: get_header(); include('pages/index.php'); get_footer(); index.php looks like this. if(!(isset($_POST['full_name']) && $_POST['full_name'] != ...
0
votes
1answer
25 views

Permalink for specific page name

I create a new page with post name is 'my-page'. I also have 2 custom query strings. So, the URL will be like: http://domain.com/my-page/?qst1=aaa&qst2=bbb I want the URL like: ...
1
vote
3answers
44 views

Show different page for first time user

As per my requirement I need to show a page say firstpage.php for user who visit my site for first time else should show home page say homepage.php I created both this pages as page-templates For ...
0
votes
0answers
17 views

How to add class and span to

First of all this is my first wordpress theme where im making So i want to add class to <a> and <span> in navbar and want to looks like this <a class="menu_top" ...
1
vote
1answer
29 views

Programmatically set page template based on page ID

How would I set the page template based on the ID? I have Redux Framework installed in my site and one of the options is to set a registration page. On this page, I want to use a specific template, ...
0
votes
0answers
27 views

Custom Homepage As Single Page or Custom Post Type?

Conceptual question for the WP community: I need to implement a custom homepage for a new site. It has some custom stuff going on but nothing too crazy: 4 big images, a carousel, some calls to action ...
0
votes
0answers
18 views

page content not showing

When I try to enter some text or html contents in my pages, it won't display at all. Though, it appears if I widgetize it. index.php <?php get_header(); ?> <?php if( have_posts() ): ...
-1
votes
1answer
16 views

What happens to bespoke page template references on theme change?

Apologies if this has been asked before, I have searched for an answer but perhaps aren't quite using the correct terminology. I have inherited a WordPress site that uses a custom theme. Within the ...
1
vote
1answer
60 views

WP_Query doesn't get sticky post at the top, when used in a page template

I'm creating a theme in which I've created a page template called page_default-blog.php to be used for creating a blog page. In this file I have the following code: $paged = (get_query_var('page')) ? ...
1
vote
1answer
20 views

How do I set and list page_template with wpcli?

I have a page that has a new template, and I want to set that new template with wp-cli. When I wp post get <id> I get an output like the following: ...
0
votes
0answers
25 views

Page Template CSS file not loading

I have created a php file and in that file include 'practice.html'; I am including a html file. In the HTML file I have a few CSS files linked. But When I upload the page template (php file) I only ...
0
votes
1answer
10 views

Page template for a site from network

Is there a way to dispay in the Wordpress admin distinct templates based on which blog you are ? Let's say that for the blog travel I have the page template page-travel.php. How can I hide it on all ...
1
vote
1answer
29 views

Hook for when a page template is changed

I know that you can remove the editor section of the page editor page ( :/) depending on the template chosen using add_action( 'load-page.php', 'hide_editor_function' ); (with proper functionality of ...
0
votes
0answers
7 views

page template removed when update content from plugin

The page template is removed when i try to update the page content. here how i do it in the plugin. $page = get_post(3476); $page->post_title = $options['text']['job_title_prefix'] . ...
0
votes
0answers
33 views

Add input field to edit page depend on selected page template

I want to add some input fields to "edit" page depends on template. Step 1: add_action( 'add_meta_boxes', 'cd_meta_box_add' ); function cd_meta_box_add() { add_meta_box( 'my-meta-box-id', 'My First ...
0
votes
0answers
19 views

Home page template changing on modification from random pages

I'm currently having a major problem using wordpress 3.8.1. Whenever I'm modifying a page, the template on the home page changes to whatever the template of the page I'm modifying is. Home page as its ...
0
votes
1answer
24 views

Capturing /page-name/[0-99999] in both template and number

Apologies if this has been answered already - I have singularly failed to word my question in a way that Google can help. I'm trying to create a page that acts as a base URL for a range of items with ...
0
votes
1answer
25 views

get_page_template returning nothing

I run this code in front-page.php as well in category-foo.php <?php echo is_page_template( 'front-page.php' ) ? "yes" : "no" ?> and get both times "no" printed i tried as well <?php ...
0
votes
1answer
43 views

how could I load a different template part by page

I would like to use get_template_part(); to load a different template parts on different pages. so on the home page it loads get_template_part( 'content', 'home' ); and on the blog page it would load ...
0
votes
0answers
12 views

Have custom post template work across multiple themes

I made a custom post type plugin to enter times for a radio show. I entered some css into the single page template and it is coming out very differently for different themes and sometimes outright ...
0
votes
1answer
25 views

When to use content-pagename.php?

I have seen themes using content-pagename.php in many themes. This file is usally used by get_template_part function. Also, pages are named as page-slug.php or page-id.php. However, I am not clear ...
0
votes
2answers
53 views

Page Template For Custom Post Type doesn't work on URL containing CPT name, other URL's work

Here's a mystery for you. I created a Custom Post Type called "portfolio". Then I wanted a page template to show just those CPT's. It's a custom loop with paging, and it works perfectly if I don't ...
0
votes
2answers
49 views

!is_page_template not working with && operator

On single custom post types using the single-course.php template I want a different breadcrumb option to happen, but it's not obeying the && operator in the if statement: <?php if ( ...
0
votes
1answer
27 views

Custom templates stopped working

I'm experiencing the weirdest bug: I had a website working just fine, then it was assigned to me the task to create a new template. I created the template, everything working and tested ok, until I ...
0
votes
0answers
44 views

Create custom post type just like a page post_type

Here's what I'm trying to achieve: A custom post type with the attributes/properties of a page post_type I'm aware of the supports array which allows page attributes to be used, but this isn't what ...
0
votes
2answers
16 views

Show author on every sub-page

Is it possible to display the author on all pages (not blog-entries) who created it? Every plugin I find is for blog-posts.
0
votes
2answers
23 views

Grabbing the page template name?

I am attempting to compare a username to a page template name. I found the following code: get_post_meta( $post->ID, '_wp_page_template', true ); But this isn't quite what I am looking for. This ...
0
votes
0answers
84 views

Storefront Theme: Shop & Product Pages do not Respect Template=“Full width”

I have set the Shop and Product pages to use the Full width template but I still see the sidebar. Setting Template="Full width" seems to hide this sidebar for the other pages. Settings: ...
0
votes
2answers
61 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 ...
0
votes
0answers
19 views

How to add scripts or attributes into wp_nav_menu?

This is my original list Menu which inlude the scripts. <li> <a href="/" data-start="color: rgba(255, 255, 255, 1);" data-300="color: rgba(160, 199, 52, 1); ">Home ...
0
votes
0answers
13 views

Child pages of child pages

I am having problem listing child pages of my sub pages. Here is my code <?php // Set up the objects needed $id = get_the_ID(); $args = array( 'post_type' => 'page', ...
0
votes
0answers
47 views

Submit form to another template (ugly url)

I've created a submit form with some filters that makes a query request: <form action="<?php echo get_template_directory_uri();?>/list-items.php"> my form here... </form> Created ...
0
votes
1answer
67 views

Use a template file for a specific url without creating a page

I wonder if its possible to use a template file for a specific url without having to create a page for that template. This is my simplified problem: I have created a page in WP with some link ...
3
votes
2answers
118 views

A check for if is parent page, if has children, if has grandchildren

I have one default page template that I wish to use for two scenarios. I'd prefer to use only one page template for the sake of simplicity for my client. Here's what I'm trying to accomplish: if ...
1
vote
0answers
90 views

Page Template as Custom Post Type Archive

My goal is to have the slug www.domain.com/resources used by a Page Template rather than an Archive Page, and have single CPT posts as children of that slug, such as www.domain.com/resources/post. ...
0
votes
0answers
12 views

attaching multiple templates to page on plugin installation?

I want to create multiple pages on plugin installation and attaching a different template to each of those pages. I have done a lot of "googling" and haven't gotten any positive output?
0
votes
2answers
39 views

How to Use index.php file for “Blog” Page And this is Not a Home Page

I Created a Page(from Pages -> Add New) Called "Blog" when click the "Blog" menu in header I want to display the posts from default post not Custom Post Type How to do this ?
1
vote
1answer
31 views

Why is the Page Template dropdown menu using the wrong file name?

This is strange. I have a file, page_market.php, that is named "Market Main Page". It WAS being used when I chose that page template, but now it is not working at all. Instead, it looks like I'm ...
0
votes
0answers
10 views

Unable to use template modules while creating page

I am trying to create a product page and wish to use a custom template that I built. I selected the template in the Template Option but none of the template modules were imported the page edit ...
0
votes
0answers
45 views

Using empty page template - calling index.php into a template

I am building my first theme and I would like to have it in one index.php, which includes header, sidebar and footer, which i don't want to use via get_sidebar() etc. My sites don't need post-types or ...
0
votes
0answers
138 views

WooCommerce Shop Page Category Display with multiple category per product

In my woocommerce store all of my products are organized in two categories. My problem is on the shop page, the category is displayed above the name of each product, but it displays the category that ...
-1
votes
1answer
70 views

How can I get parent term from a child term

I have a custom post type and a taxonomy, when adding a post if I select a child term and not the parent term then I cannot use get terms as the parent term wont be in the array as it wasn't selected ...