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

1
vote
1answer
19 views

Why does my content disapear when I make a page to match an archive name?

I made a custom post type called 'education'. I have added several pages to it. When it was first created I could go to http://example.com/education/ and see the posts, but I wanted to edit the ...
0
votes
1answer
49 views

The best way to create pages like an 'about', 'contact' and etc [closed]

I develop my own theme and I need to create nice looking sites like a contact page or about me page. But I don't have any idea what wordpress template file I can use. Will I have to use page-template ...
0
votes
2answers
18 views

Adding wrapper elements in the_date() like in the_title()?

So this works: the_title( '<h1 class="entry-title">', '</h1>' ); But this does not: the_date( '<h4 class="entry-date">', '</h4>' ); I don't know enough if this is ...
0
votes
1answer
33 views

Get Posts Based on Tag Matching Page Title

I have the following written to retrieve a list of posts that match the title of the page, by their tag. The problem is it does not play nicely with tags that have multiple words (and perhaps special ...
0
votes
1answer
17 views

Add additional templates to the templates drop down on add page menu [duplicate]

I'd like to add a custom page template to the drop down menu shown in the picture. Had a good google at this but couldn't find anything, was too hard to form a concise query. Thanks for reading
1
vote
1answer
97 views

Front End Sorting Questions

Please bare with me as I am self taught and trying to learn as much as possible. I am going to try and provide as much information as possible that I have learned from researching this problem. My ...
2
votes
2answers
80 views

Alphabetizing Posts in a Category Page?

I have written up a page template that will list posts in the same category as the name of the page. I am wondering how to alter it to get it to return the posts in alphabetical order? I have been ...
0
votes
1answer
19 views

How do you assign custom template for Posts page (under Front page displays setting)

How do you assign custom template for Posts page (under Front page displays setting)? Settings > Reading in backend. I notice once I set Posts page to specific page, the Template dropdown on edit ...
0
votes
1answer
49 views

Loading a template for a URL pattern

I am creating gallery pages for events and csr-events custom post type. Now it has three types of pages: www.example.com/gallery www.example.com/gallery/events www.example.com/gallery/csr-events ...
5
votes
2answers
225 views

Having different sidebar content for MANY pages?

I am continuing on from a topic I already posted but with a different angle. Please bare with me as I try to provide as much information as possible. I am looking to add a simple text area called ...
0
votes
1answer
30 views

Get parameters and custom page template

My WP website have calendar page with custom page template. If i open mysite.com/cal i see calendar of current month, if i open mysite.com/cal/?month=01&year=2015 i see calendar for january. It ...
0
votes
1answer
93 views

Different “Text Widgets” in Sidebar on Many Different Pages?

Hi there I have a few questions on adding different sidebar texts to sidebars per page. On one part of my site, I have pages dedicated to individual animals. I have figured out how to change the ...
0
votes
1answer
22 views

Image not showing on page template in Twenty Fifteen-theme

I'm creating a custom template for a few of my subpages using the Twenty Fifteen theme. For some reason the linked image below won't show, even though the url seems to be correct. I've started with ...
0
votes
1answer
56 views

How to add custom template in plugin?

I want to add a custom template for a custom post ('post_type' => 'matches'). I am writing a plugin.I keep my template in the templates/fp-fixture-template.php file. Here is the function: ...
0
votes
1answer
11 views

How do I make my pagination work?

In a custom page template, I use the following code to display posts from that category and sub-category. How do I make the pagination work? // The Query query_posts( array ( 'category_name' => ...
1
vote
1answer
70 views

Check if a menu is empty?

I have menus set corresponding to a custom field on a page. Ie I have menu1, menu2, and menu3 on three pages under custom field => MenuName. Under functions.php I have: /* Add Menu Locations */ ...
0
votes
1answer
50 views

AJAX Post from same domain to a wordpress page

I am trying to create an ajax post listener to a wordpress page in a domain (let's just say http://example.com). Another web app in the same domain (http://example.com) exists and a user sends ajax ...
0
votes
0answers
44 views

is_page_template wont allow me to enqueue scripts

I want to load specific javascript files onto any page that uses the template hello-world.php below is the code that I have used to target the page, register and enqueue scripts. But for some unknown ...
0
votes
1answer
21 views

How to add pages in wordpress using codes?

I am trying to add wordpress pages using codes on theme activation. But the main problem is i cannot check whether the page with that particular slugs exist or not. Our code looks like this : ...
0
votes
1answer
57 views

Using URL variables on a custom WP_Query

Background I have a page with a custom template 'listen', with a custom wp_query running on it... $custom_query_args = array( 'post_type' => 'post', 'tax_query' => array( ...
0
votes
2answers
17 views

What content to use for inserting images

I would like to create a page template that will have two containers. Left one should be for text (it is a multilingual website so that is why I need a page template), and the right side should be for ...
0
votes
1answer
27 views

Get_template_part seems to be ignoring my template

I am developing a website that requires specific pages to have certain elements change color in addition to a full-width calendar page. I figured that using page templates and changing what ...
0
votes
0answers
59 views

Adding Section tag before get_header(); ?>

I am currently working on a WordPress theme using FoundationPress. I have created a custom homepage template which I have labelled home-page.php and assigned as my front page. I would like to make ...
0
votes
2answers
28 views

Hide a specific post from a page template

I am trying to hide a specific post from a page template? Does anyone have experience with this, would prefer to not have to use a plugin. Was thinking of using wp_post ID but am unsure of how to go ...
0
votes
1answer
169 views

How to create a shortcode for custom page template

I have a custom page template and I want it to display on specific pages. The only way I know to do this is to create a shortcode for this custom page template, so that I can use the custom page ...
3
votes
2answers
285 views

How to remove all styles for certain page template?

I know how to create child themes and page templates. I have a child theme of Salient called Salient-Child, and I have a page template called blankPage.php. For all pages that use this template, I ...
1
vote
2answers
551 views

How to load all pages into one page with their templates

I am learning how to work with Wordpress, and im trying to build my own website in it. Since my website is a onepages, i would like to be able to load all my pages ( they then count as sections ) to ...
0
votes
1answer
79 views

require_once not working

I have a custom page template, and this template need to include one php file. I tried to put this script require('.../hc-v2-child/ayah.php') and this require(__DIR__.'ayah.php'); in functions.php ...
0
votes
1answer
32 views

Custom page template to sidebar/widget

I have a custom page template and I want it to display as a sidebar. How to do this? I google it but I did not find any articles/topics about this. Or how can I create a shortcode for this custom ...
0
votes
1answer
124 views

Pages Become “Archive” Instead of Using Page Template

Update: After further inspection it appears that the pages that were effected are being created as "Archive" pages, but there is no archive.php file so they are using index.php. Why would my pages ...
2
votes
1answer
76 views

Help with CPT template pagination

i created a themes CPT using the following code function pp_themes_post_type() { $args = array( 'public' => true, 'label' => 'ProfilePress Themes', ...
0
votes
0answers
28 views

Custom Page Templates for a complex application - code must sit in a plugin and not the Theme

I am developing a custom set of applications which sit on top of a WordPress site. The theme is developed by a third party, and I have decided it is time to remove the custom page templates from the ...
0
votes
1answer
44 views

Show all images attached to posts as a gallery page?

I want a gallery page where all images will be shown, which were uploaded with all posts. I tried this code with a page template, but the output of this code shows nothing, not even HTML code ...
0
votes
1answer
54 views

How do I hide tinymce within the edit screen of a particular page

I have a page. The page is assigned a unique page template. The template will use a custom loop. This loop will not call the content of the particular page. I'd like to hide tinymce from the user. ...
0
votes
0answers
11 views

How to get /* Template name */ value? [duplicate]

If I have a example instruction: /* Template name: Full Width */ How to get and place Full Width in a variable? Thanks
0
votes
2answers
48 views

wp_enqueue_style and different styles for blog template

I have a front-page.php to create the index page template and a page-blog.php to create the blog template. My styles are added using wp_enqueue_style in my functions.php, but I'd like to use different ...
0
votes
0answers
34 views

Trimming content from the get_post_field

I have a code that is showing the sub-pages contents on the main pages: <?php /* list sub-pages content */ $portfolioID = $post->ID; $portfolio_sections = array( 'post_type' => 'page', ...
1
vote
1answer
196 views

Get Pagination (WP-PageNavi) not to work

I have several problems to get the pagination work. I have a custom page template, in there i need to display all blog posts. I build up the following "query" and build up my html structure: $paged ...
0
votes
1answer
37 views

“post-name” Renders Using page.php, but “post-name-2” renders with single.php

Page One is rendering using my page.php template. Page Two, set up exactly the same as the previous one, is rendering using my single.php template. I want Page One to render using the single.php ...
0
votes
0answers
31 views

Skip over get_header()?

I'm trying to retrieve the content of a page with AJAX and am hoping that there's a way to essentially skip over the header. What I would like to do is get the rendered content of the page returned to ...
0
votes
1answer
25 views

Append custom field items to content from plugin

I know you can use add_filter( 'single_template', 'modify_page_template' ); function modify_page_template($single_template) { global $post; if ($post->post_type == 'post' || ...
1
vote
1answer
67 views

Custom page template with custom fields

I need to create a page template that has an image and text with a common style. The image url must be set using a custom field (or something like it) and left aligned to the page title and content. ...
0
votes
2answers
129 views

Showing content from one page on another

There are many posts that seem to strike around this area, but I'm more and more confused by each one I read. I have a page that shows the "Terms of Service" (id = 1086). I would like to display the ...
0
votes
0answers
40 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] /* ...
10
votes
3answers
1k 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
28 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
18 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
90 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
455 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
134 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 ...