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

23
votes
2answers
15k views

Create custom page templates with plugins?

Is it possible to make custom page templates available from a plugin?
8
votes
4answers
2k views

Is there a WordPress plugin that registers a plugin file as a custom page template?

I need to create a plugin that makes custom page templates available in wp-admin. I'm wondering if someone has tackled this already, as it seems like a pretty typical process?
9
votes
6answers
6k views

How to *remove* a parent theme page template from a child theme?

I'm using the TwentyTen theme to create a child theme, but I can't seem to get rid of the 'One column, no sidebar' page template that is in the TwentyTen parent theme. I thought just copying it over ...
0
votes
1answer
3k views

Custom meta box shown when template is chosen [duplicate]

Possible Duplicate: Toggle admin metabox based upon chosen page template Is this possible to change editor screen immediately after someone picks some template from the drop down? I need a ...
2
votes
1answer
1k views

How to quickly switch custom post type singular template?

I have a custom post type called movies and I need to quickly switch the template that displays the movies cpt on the front end via a link. How can this be done? Files I have: single-movies.php ...
3
votes
1answer
1k views

Dynamically link to the latest post or simulate request of specific post in page template

I want to have a link in the wordpress menu pointing to the latest post of a specific category. Because I am not able put a dynamic URL in the wordpress menu, my approach was to put a page with a ...
0
votes
1answer
963 views

Dynamic page.php template for custom post types

I have a couple of custom post types registered. I would like to display all "posts" from each custom post type on its own page, and these pages must be visible in the nav menu. It would be great to ...
0
votes
1answer
3k views

Custom post type archive and single.php files not working

Hi I've created a custom post type called shows. here is the code for it. <?php add_action('init', 'show_register'); function show_register() { //arguments to create the post type. ...
4
votes
2answers
413 views

Do I need to use The Loop on pages?

I'm writing my first WordPress theme and have a question about the use of The Loop in page templates. The page templates I've looked at all follow basically the same pattern (example from Twenty ...
4
votes
3answers
1k views

Setting a custom sub-path for blog without using pages?

Warning: fairly pedantic request ahead. I have a design that makes use of posts (I.e., the blog) and a custom post type called "howto". The site front page ("/") has a template that displays the ...
3
votes
2answers
794 views

Create built-in pages without creating actual pages

For example: site.com/contact (or site.com/?page=contact if not using permalinks) when someone goes to that page I want to load a theme template, like page-contact.php But I don't want to create a ...
3
votes
2answers
3k views

Multiple areas of dynamic content in a page

I am new in Wordpress and what I really can't find how to do is the following: I have a new Page created from the CMS. This pages have different modules with text. Take for example this template ...
2
votes
1answer
552 views

Listing Parent, Child and GrandChild Categories and then the PostTitles on Page Template !

What I want to do is a loop like this is something like this I'm really sorry but its hard to format here! I going to put this short url http://pastebin.com/dEdKzgJz so you can see it better... Can ...
5
votes
3answers
4k views

Is it possible to stop selected plugins from loading on certain template pages?

I have a template page that has form on that is only used once in my site. The form uses form validation using jquery validate plugin (such a great plugin). Once the cart66 Plugin is loaded, the form ...
1
vote
3answers
183 views

Single page theme

I am trying to create single page theme. What i have trouble with is understanding this whole wordpress query logic. There is query object and supposedly i get all published posts like this: ...
0
votes
1answer
34 views

I want to rel=nofollow wordpress images

I have a default theme. When i add media to wordpress site. By default it use simple "a href" tag I want to add attribute "rel=nofollow" to it. Can anybody please point me in right direction?.
0
votes
2answers
423 views

Assign Page Template Within A Custom Post Type

I have registered a Custom Post Type and created a file called archive-myCPT.php and another one for single posts called single-myCPT.php. What I want to do is to create a page where I will show just ...
0
votes
1answer
859 views

How to create custom home page via plugin?

I want to code a plug-in that creates new custom home page. Note that I have never coded any plug-in before. 1) After activation of plug-in user needs to go to the options of the plug-in and set up ...
0
votes
2answers
700 views

Remove navigation from header in custom page template

I'm building a landing page and want to remove the navigation menu from the page. The navigation menu is in header.php which is of course in the page template. Is there a WordPress function I can use ...
0
votes
1answer
47 views

Recents posts pulling from different post type

This blog page is pulling from a Page Template called full-width-blog.php. The left of the content is where the supposed general posts should appear. On the right is the sidebar. How could you make ...
0
votes
1answer
121 views

How to show a post single post in page template

Currently I've divided posts into 5 different categories, based on the categories I've created 5 page templates. all of the pages are listed into the home page navigation menu. in my home page I'm ...
9
votes
5answers
2k views

How can I add an option to the Page Template list from a Plugin?

I've been looking around for the past couple hours for a way to create a custom page template from within a plugin but haven't had any luck yet. What I am specifically trying to do is add an option ...
4
votes
1answer
586 views

Creating a Custom Post Type for Inserting Preset Content into Post & Pages?

In response to Mike Schinkel's comment (see below) on my post about how to pre-populate content (essentially using a content template)... @Scott B I mean why did you support a file on disk ...
0
votes
2answers
978 views

Authors Page : A page of authors

I'm looking for a way to create a parent authors page and then use the author.php for the individual author pages. I've been out of the loop (no pun) for a couple months and am wondering the best way ...
2
votes
1answer
1k views

Control Custom Post Type template from a plugin

I can control the custom template to be used on custom post type pages but the template file would still need to have the markup of the theme. I was wondering if I could make it theme independent? ...
2
votes
4answers
833 views

How can I dynamically load another page template to provide an alternate layout of the posts?

I have a page that displays posts (4 on each row), with a thumbnail image & title for each. Is it possible to click a text/icon link and dynamically switch the page template? I'm looking to ...
1
vote
1answer
487 views

Page Templates - this code only works for one Custom Post Type

I have the code below in my functions.php file, it works great and allows me to use page templates in my custom post type 'services'. I have defined which 'type' to use on the first line with ...
5
votes
1answer
1k views

How to get IDs for objects in menu branch?

Is it possible to print content of all menu items, when displaying menu (or branch of menu as in question about displaying menu branches) ? Once I click on About Us I wish for new page to display ...
3
votes
1answer
5k views

Add custom template page programmatically

I'm trying to add template page from a plugin,and my template page is in this plugin folder.Is this posible?Here is my code: global $user_ID; $new_post = array( 'post_title' => 'Test ...
3
votes
4answers
2k views

How can I create an alternative home page?

I'm working on a site which has a fully customized front page. Now I'm asked to add a more classic looking blog type page which will be reacheable at http://domain/blog. I tried creating a custom ...
1
vote
1answer
148 views

Schedule Sticky Posts

I'd like to display the most two recent published sticky posts by modifying the primary loop. A simple affair with the following loop. However, if I schedule a sticky post to be published in the ...
0
votes
0answers
35 views

How do I enforce a 404 status for an EXISTING page?

I was able to replace the main query for 404 pages with pre_get_posts but as soon as I point to an existing page, the error changes to 301. What function should I hook to to change the status to 404 ...
-1
votes
1answer
63 views

Trouble with conditional tags

I've got some code I want to run on every page other than the blog page and the archive page. If I use <?php if ( !is_home() ) { ?> The code correctly doesn't show on the blog page. If I ...
6
votes
2answers
2k views

How to Change 404 page title

i have try many methods after searching on internet but unable to ramove Nothing Found from my 404 page title how to do it please help me even i have us this in my 404 page header if( is_404() ) ...
5
votes
2answers
657 views

Creating Ajax backend for Specialised Page Template? Should admin-ajax.php be used?

We're scoping an upcoming project that will require the development of a large php web application within an existing wordpress site - this is for our use only and we've no intention of trying to ...
4
votes
1answer
677 views

I put my blog on a subpage, how do I get page title?

I've got my blog setup on a subpage (not the front page) and I'm using the template file home.php, how can I get the contents from the page editor onto this subpage? If I change the title of the page ...
2
votes
2answers
533 views

How do I modify this page template to show subpage excerpts (not post excerpts)?

I have made a page template which shows linked subpages using this bit of code: <?php $mypages = get_pages( array( 'child_of' => $post->ID, 'sort_column' => 'menu_order', 'sort_or ...
2
votes
1answer
2k views

How to retrieve $_GET variables from rewritten URLs?

I need to receive some special $_GET parameters for a custom page I'm making, i know how to receive this through a simple $_GET like mysite.net/products/?id=1 , but I wanted to use the URL style of my ...
1
vote
1answer
44 views

How to Set a Custom Template for Blog Posts

I am trying to set a custom template for my blog posts page using the Template box on the Page Attributes section of the page. However, the template does not get used on the site. Is there a certain ...
1
vote
1answer
659 views

jQuery Ajax() doesn't work when the page is accessed as a WordPress template page

In one file (test_ajax.php) I have a which on change loads another page (registration_form_race_type.php) with a short message via jQuery Ajax(). It works fine when "test_ajax.php" is accessed via its ...
1
vote
2answers
18k views

How to display page content in a page template?

In my WordPress site, I made a custom page template, which contained a custom query [using WP_Query()]. With that query, I can perfectly get the posts of a certain category. But I want to show the ...
1
vote
2answers
546 views

Single page theme that uses pages for the content

I'm making a one page site. On the page I want to run WP_Query three or four times to pull in those 3-4 pages. The page looks a bit like this: <div class="row"> <?php $args = array( ...
1
vote
2answers
4k views

Create a new template for twentytwelve

Twenty Twelve comes with some page templates: Front Page & Full Width. These are in the folder /page-templates. I've created my own template and saved it into this folder, but it is not ...
1
vote
1answer
543 views

How to remove a parent theme template from Quick Edit?

I was looking for a way to hide the parent theme's templates and found this answer which works perfectly to remove the parent templates from the pages edit screen - How to *remove* a parent theme page ...
1
vote
1answer
89 views

Template plugin for blog posts? [closed]

can someone recommend a plugin to do the following? My wordpress CMS has two types of users: administrator and editor, both of whom are not technologically savvy, so they need things to be super ...
1
vote
1answer
3k views

Pagination on a custom page template

I have set up a custom post type called 'Events'. For reasons that I'm not going to get into, I chose not use archive-events.php as the archive template for my Events. Instead, I decided to create a ...
1
vote
1answer
738 views

Posts archive index pagination in a static page custom query

In WordPress, I have a page for News that is using a specific page template I created. This page is populated by news posts assigned to the news category. I need to show only two of the latest news ...
1
vote
1answer
1k views

Created custom post type but selected template not staying selected

I have registered a new post type called Resources. I specify 'page-attributes' as a supported feature. When I go to create a new Resource post I see under Template that I can pick from a number of ...
1
vote
1answer
2k views

WordPress custom post type Single.php?

I have a WordPress custom post-type setup. I've created single-[customposttype].php However instead of displaying only the requested custom-post-type it goes to the URL, then displays all of the ...
0
votes
1answer
25 views

CSS acting differently in and out of Wordpress [on hold]

I've created a from-scratch (non-Wordpress) responsive page that works exactly as expected, and now I'd like this to be the front page of my Wordpress site. The FS (from-scratch) site comprises an ...