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

Page template without header & footer

I have created a page that doesn't use the header and footer. I have closed all the tags, but the page is breaking, nothing appears. My code is like this, <?php /* Template Name: [Blank] /* ...
6
votes
2answers
474 views

What is singular.php?

From 4.3 we have a new template, singular.php. I tried to understand what is it, but I didn't get it. :) The page.php for pages. The single.php for every post types. If we have single-[post-type].php ...
0
votes
1answer
25 views

Utilizing the template hierarchy while storing page templates in a subdirectory

I'd like to store the page templates for my theme in their own directory, /pages/ for example. I'd also like to utilize the page-{slug}.php functionality of the Template Hierarchy, and not have to ...
0
votes
0answers
9 views

How to run function depending on what template is selected in page UI dashboard?

I'm trying to run a function only if a particular template is selected in the page UI dashboard. So basically when someone goes to create a page within wordpress. They can select a template from the ...
-1
votes
1answer
29 views

wp_query on page template not working (Genesis framework)

I'm trying to use wp_query as part of a page template. The page is tagged with a taxonomy term and I'm trying to grab a list of posts that are also tagged with this taxonomy term. I'm able to grab ...
2
votes
1answer
77 views

Adding PHP/HTML code inside page from custom template

I'm helping my son with his financial site with some custom programming. The first project for him is a custom spreadsheet using jQuery, flot, php, etc. I created a child theme, created a template, ...
1
vote
2answers
51 views

Adding items to page template dropdown on Page Edit Screen

I am developing a WP theme with MVC approach. It only have index.php, functions.php and styles.css on the parent directory. So, I do not want to place page templates on it rather then I want to ...
0
votes
0answers
27 views

Custom taxonomy page template name is use for it?

I want to know that how can i specify the page template name for my custom taxonomy and where it should be place in page-template directory or at theme root directory? eg. i have custom Taxonomy ...
0
votes
0answers
7 views

How to set page to be a parent of a custom post?

This question is regarding the navigation menu (wp_nav_menu). The nav menu has two classes that depicts the current page: .current_page_parent, .current_page_item. This works great for both Blog and ...
0
votes
2answers
32 views

Display images in template file

I have one template file for the main page, after creating home page I have added text to check if it reflect changes on my home page or not and it was successfully displaying text. But when I try to ...
0
votes
0answers
13 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
44 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
11 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
70 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
25 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
31 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
28 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
16 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
65 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
58 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
29 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
29 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
26 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
66 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
64 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
39 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
78 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
24 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
45 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
72 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
21 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
70 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
39 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
17 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
79 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
37 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
38 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
17 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
10 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
81 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
39 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
86 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
16 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
33 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 ...