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
0answers
46 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
19 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
106 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
45 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
21 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
1answer
27 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
66 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
48 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
72 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
44 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
32 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
169 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
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
50 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
20 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
105 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
83 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
53 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
245 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
35 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
95 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
23 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
69 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
12 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
75 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
54 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
45 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
66 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
18 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
60 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
190 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
338 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
613 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
86 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
33 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
132 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
80 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
30 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
46 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
56 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
49 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
35 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
219 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 ...