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

Link a page type with custom WP_query variable

Basicly i want the URL : http://localhost/brands/[brand-name] to be addressed to a page template single-brandname where "[brand-name]" is a custom variable introduced in permalink. The Main Brands ...
0
votes
1answer
23 views

Create a custom page template inside my wordpress plugin

I'm developing a Wordpress plugin and I want to create a file to where I want to redirect the user to show some information. I know that a perfect solution for this is using Wordpress custom pages. ...
0
votes
0answers
9 views

Losing Page Description on paginated static front page

I have a static front page with an image slider in the masthead and then products below. When the page loads with a url that is paginated 'www.mydomain.com/page2/' for some reason the markup for the ...
0
votes
2answers
55 views

Pagination for custom loop on custom page template is not displaying anything

I have created a page where user can see his favourite post which has been bookmarked by him get_user_favorites($user_id); This function is responsible for returning me all the favourite posts ...
0
votes
0answers
17 views

Creating a Custom Title on a Custom Page Template

Most of our news site is made of WordPress Pages and Posts. Then we have several custom pages that format information from a non-WordPress database. exs. Calendar of Events, Local Nightlife Venues. ...
0
votes
1answer
21 views

Add a non-dynamic phrase/character after a page title?

I have a client that has an idea to add a coma after the main page title. Sure, this sounds simple to do-but it makes the navigation see 'WELCOME,' as well. Basically I am adding a phrase in the same ...
0
votes
0answers
21 views

How to achieve an elegant way when using ajax to get data for a table in WordPress?

I'm working on the update for a website which wasn't originally developed by me. The task is to have a table on a main page and, if you move a slider with value on it (100, 200, ... 1000), the table ...
0
votes
1answer
22 views

Trying to list out child pages with WP_Query

I'm trying to list out all the child pages of a custom page I've made. In my custom page, I'm doing this to list out the pages: <?php get_header(); ?> <?php $subpages = new WP_Query( ...
0
votes
0answers
15 views

WordPress Template Files added to directory after migration to Debian Server do not load, White Screen of Death

Okay here's the backstory: I run and develop a WordPress-based site. I work mostly in my editor and do not use the core WordPress backend anymore than I have to, I typically just work in template ...
3
votes
1answer
55 views

Limit number of pages that use a specific template?

I have a custom page template, so a .php file in my themes folder with this at the beginning /* * Template Name: MyTemplate */ Now I can, in the WP backend, create new pages and select this ...
0
votes
0answers
45 views

front end avatar with plugin Basic User Avatars for custom template

I try make front end upload with my custom template profile in front end. But it don't work. Somebody pls help. i follow code from this topic to make a custom template How to edit a user profile on ...
0
votes
1answer
22 views

Register Page Template from Plugin

I'm trying to figure out how to properly register a page template (and all of the associated assets, like CSS and Images) from a plugin. Basically, I've created a landing page that I want to live ...
0
votes
0answers
27 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
17 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
59 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
1answer
54 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
32 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
21 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
67 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
17 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
39 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
57 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
20 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
54 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
34 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
29 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
72 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
28 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
31 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
12 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
30 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
9 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
61 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
21 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
27 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
32 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
68 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
15 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
29 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
64 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
75 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
30 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
64 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
17 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
120 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
94 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
23 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
14 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', ...