I am new to wordpress. I have been given a site to customise.

I want to modify just one of the pages to include a php calendar which links to a mysql database, so I will want to run my own PHP code on one of the pages.

The majority of the template is fine but it uses 1 third of the main window ( below the menu etc.. ) to show a scrolling window of pictures. I want to remove that but just for one page not the whole template ?

Sorry if it sounds a bit simplistic but once I've done this I can address the calendar issue


  • This is too broad/vague to answer. We need more details on the template (slug/name), the page (ID/slug/title), the code etc. Please edit your question and include all relevant information. Then it will be easier to help you.
    – tfrommen
    Feb 21, 2014 at 13:20
  • 1
    Why not create a template just for that one page? For example: wordpress.stackexchange.com/q/90241/21376
    – s_ha_dum
    Feb 21, 2014 at 14:28

1 Answer 1


You should create a new page template based on your current page template. Without any example code it is hard to give you a specific example, but here's an approach:

Copy page.php to a new file and name it page-wide.php. The prefix page- is significant because it triggers WordPress' template hierarchy.

At the top of this copied page's source code, make sure the PHP tag begins with something like this:

Template Name: Custom Page Example

Then, inside WordPress admin, when editing a page, you will have a dropdown box that lets your specify which page template this page should use. It will show up as "Custom Page Example" in the dropdown (in this example).

The point here is that you can create, for example, a page-wide.php, that is almost exactly like your normal page.php but without a sidebar or an extra wide body class which you've designed with CSS.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.