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
1answer
5 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
24 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
5 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
11 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
14 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
18 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
15 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
22 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
7 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
22 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
45 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
33 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
26 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
30 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
14 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
21 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
45 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
39 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
15 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
31 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
47 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 ...
2
votes
2answers
84 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
78 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
11 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
38 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
26 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
8 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
37 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
115 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
43 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 ...
0
votes
1answer
22 views

How do I change the scan depth for page template files?

I want to move my template files to a file sub-directory like ./tpl/page but it seems to only scan one directory deep. Is there a way in my theme that I can set it to scan deeper?
0
votes
0answers
30 views

Why Wordpress gets old templates code instead of the last updated ones

I recently finished building my WP theme (child theme of twentyfifteen). My friend started updating content and accidentally added content to a page which don't have a function that gets and displays ...
0
votes
1answer
26 views

How to add page under a custom post type?

I would like to add a page that uses a custom template (page-coffee-about.php), so it will appear under a custom post type called "coffee". The URL of the custom page should be ...
1
vote
2answers
47 views

Custom post type archive page template

I am trying to implement an archive for a custom post type: http://mywebsite:8888/about-us/client-news/2015/03/ The problem is that it keeps serving me a 404 page and I cannot work out what page ...
0
votes
2answers
72 views

Dynamically generate child-URLs for posts or custom posts

How can I have a post (or custom post) with a definite URL: www.test.com/category/post-name and a child-URL referring to a specific section of that post www.test.com/category/post-name/sub-url ...
0
votes
2answers
39 views

Dynamically change page that loads

I'm trying to figure out how I can change the page that loads. Let's assume I'm just using the default permalink and I have a URL with a page_id. I want to be able to override the page that would ...
0
votes
1answer
22 views

Custom form not showing in correct place on page

I have a page like this: <h2 class="subHeader contentSubHeader">Are you already a member? Don´t miss your next career opportunity!</h2> <p class="subHeader ...
0
votes
1answer
44 views

Adding secondary featured image for page_for_posts

@Howdy_McGee helped me sort out adding a banner image to page_for_posts, however I need to resize images showing up in the blogroll for page_for_posts so it doesn't use the featured image banner ...
0
votes
2answers
74 views

How to make an archive page displaying posts in a date range

I'm trying to make a couple of Page Templates for different Pages that should act as an archive to display posts (a Custom Post Type actually) in a certain date range. The website it concerns is ...
1
vote
1answer
48 views

Inconsistent `body_class()` function

Here's my scenario: I'm using body_class() in my <body> tag as per the Codex instructions I've created specialized page templates (as described here) for the following pages: Home: ...
0
votes
0answers
29 views

Remove action added from class

This has been asked before and I know how to do this but im having trouble removing a specific action added by the easy columns plugin. The action is added similar to below: class EasyColumns { ...
0
votes
1answer
50 views

Injecting pre-defined text from custom page template to editor

I am creating a custom page template: < ?php /* * Template Name: sliding content * Description: Sliding category contents */ get_header(); ?> <div id="primary" class="content-area"> ...
0
votes
1answer
55 views

Multiple get_posts() queries on one page

I'm building custom page template, which has some content editable through proper articles/posts. Below are those code blocks: <?php $contact = new WP_Query(); $contact = get_posts( array( 'slug' ...
1
vote
0answers
27 views

how to setup custom content structures

I have some custom pages I need to develop, and I want them to be easily edited by my client. The problem is that the markup is fairly complicated, I want to be able to give them the ability to edit ...
0
votes
0answers
66 views

custom post type archive slug vs. custom page template

I registered a custom post type for events and now I asked myself how to handle upcoming events and events in the past properly. By now, I'm displaying upcoming events on a custom page template I ...
0
votes
0answers
45 views

Post gallery as carousel

So I have this idea in mind: I would like to create custom page template, and whenever in post gallery is between tags, for example: Lorem ipsum somethinginkgsd.... [carousel] Gallery here ...
0
votes
0answers
100 views

Custom template of page with blog posts list for multi-blog page

I need to use (on my theme) multi blog pages (Posts page). My idea is using page template for it, but I have a problem with getting all posts in template file. Regular loop the_post() from index.php ...
-1
votes
1answer
44 views

Adding css tweak based on page template

I have a parent page that is listing out all of it's child pages. This is done using the below: <?php $query = new ...
0
votes
1answer
20 views

Can you create a custom page with content in the center already defined?

Is this possible? So for example, you select from the templates a page called "custom-blog-home" and on this page in the centre you have two section, one is a set of blogs being pulled in and styled ...