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

-2
votes
0answers
13 views

Display posts on page template where category matches the page's custom field

I'm attempting to create a page template that displays posts that have a category that matches that page's custom field values. In the page template I have a custom field named "Page Category". If ...
1
vote
1answer
15 views

Child page in custom post throws 404 page not found

Currently I am trying to add a page as a child in my custom post section. The parent pages in my custom posts works correctly, I've set a template file for them as singe-custom_post_name.php. All ...
1
vote
0answers
17 views

Show Custom Post Type meta boxes only on Page Edit

I've went through the laborious process of creating the CPT. I see it on the sidebar of my WP install, I can add new, save data, and on frontend I can output the data. Is it possible with WP to move ...
2
votes
1answer
27 views

how to change link of some wordpress pages

I've made templates for the pages of my wordpress site such as: singup,signin,suggestions. Default wordpress pages link is as follows: doamin.com/signup/ or doamin.com/signin/ or ...
1
vote
1answer
13 views

WP-CLI not setting page template with page_template=“template-name.php”

I'm having trouble setting the page template with wp-cli. According to this post, How do I set and list page_template with wpcli, it looks like: wp post create --post_type=page ...
-1
votes
0answers
19 views

Pagination in page template

I use this code for category and archive pages, but when I paste wpbeginner_numeric_posts_nav(); in the page template, why don't I see a list of numbered pages (I have 20 posts)? function ...
1
vote
0answers
20 views

Adding the_content() in custom template email

Let my explain the scenario first: I have a very custom page template. That is use in combination with a CPT and a few Custom fields. The CPT is called "werklijsten" (it's in dutch so bare with me) ...
1
vote
0answers
23 views

Creating a Page Template to display all items from a Custom Post Type

To begin with I should note that I'm fairly new to both php and editing in the WordPress-files, BUT I have actually managed to succesfully create a page template that puts out a list of all items in a ...
2
votes
1answer
11 views

Including Custom Post Type posts in a page template contextually (or should I widget?)

Please see the attached mockup… Each element in the sidebar (e.g., Communications) will probably have to be a Page. I'm aiming for maximum flexibility. I am using Epik (a Genesis child theme). I ...
1
vote
0answers
66 views

Problem with multiple shortcode in page template

We have a page (wmnf-events.php) with no content that uses a template file (page-wmnf-events.php). The template has 4 different div containers where each container has the same shortcode but for a ...
1
vote
1answer
39 views

Find the page template of the previous page

I am am working on a listing type theme and have a search results page that take people to a more details page. I also have links throughout the site that will also take visitors straight to the more ...
0
votes
0answers
19 views

Every page on the website has a same theme

I have tried to apply home page theme to all the pages in the top navigation, what the problem is that, i want to know whether if i change a post in one page, will it affect others too ?
1
vote
2answers
22 views

Implement content-nosidebar.php / content-leftsidebar.php

I've been trying to create Page Layout's so that the person using the theme to position the sidebar either on the left, right or have the page as a full width one. I've looked at another theme and ...
1
vote
1answer
53 views

Creating a new page template

Problem I have a template and I want to add new page to my theme for example about. I rename file to template-about.php. Also added comments into template: <? /*Template Name: About Us*/?> ...
1
vote
1answer
30 views

Filter widget outputs

I've been trying to find a good solution for my problem, but I can't seem to find anything on this topic at all. I've got a custom sidebar, created by using register_sidebar and I've used wordpress's ...
0
votes
1answer
27 views

Calling custom plugin class methods from a template

Is it possible to call instance methods of a class from a template file that is loaded by that class? If I try to invoke $this from the template, I get Fatal error: Using $this when not in object ...
0
votes
1answer
19 views

how to get the title, description, pictures on the page?

I created a template, but it does not output anything <?php /* Template Name: Gallery */ get_header(); ?> <section> <div class="row"> <div class="container"> ...
0
votes
1answer
27 views

Template Redirect to /2015 to use page template

We work with non-profits and come across this issue a lot. We need to use a page template for the url structure domain.com/2015 where we'll be adding an "end of year" report. We're not using the ...
2
votes
2answers
73 views

Ordering Posts List By Taxonomy Terms?

I am wondering how to write code to order a list of posts by their terms from custom taxonomies? Here is what I have so far: I have a page that lists all the posts in a Custom Post Type, on one ...
1
vote
1answer
17 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
48 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
17 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
23 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
15 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
64 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
66 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
16 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
36 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
159 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
18 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
38 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
16 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
43 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
53 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
30 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
33 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
40 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
25 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
49 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
22 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
98 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
154 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
291 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
39 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
29 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
85 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
63 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', ...