WordPress.org

Make WordPress Core

Opened 9 years ago

Closed 9 years ago

Last modified 5 years ago

#494 closed enhancement (wontfix)

PHP in Static Pages

Reported by: orangenormal Owned by: matt
Milestone: Priority: normal
Severity: normal Version: 1.5
Component: General Keywords:
Focuses: Cc:

Description

It should be possible for advanced users to include PHP and WordPress functions in their static pages.

Currently, it's impossible to easily create a separate "Archives" page, for example, which lists all the available posts under monthly headings.

Creating a specialized (and separate) PHP page is inappropriate, since it doesn't integrate with WordPress' Theme and Template support.

Change History (6)

comment:2 ryan9 years ago

Plugins are available that interpret PHP in posts.

comment:3 anonymousbugger9 years ago

Might be worth including one of the plugins with WP or rolling it into core. Setting up a "contact" page or "archives" page is a fairly common thing, and right now you have to go hunting for a plugin.

comment:4 2fargon9 years ago

  • Patch set to No
  • Resolution changed from 10 to 70

The current support for themes includes support for such pages, such as archives pages. Advanced users can also make use of wp's authentication functions.
Please verify this.

Also, including dynamic php code in a page would mean the page is no longer 'static'.

comment:5 orangenormal9 years ago

The problem with using Theme templates to create such pages is that it then becomes theme-specific. If WordPress and other PHP functions were allowed to be inserted into pages easily, you could make an archives page that would be Theme-independent (the page would still display properly if you switch themes).

2fargon, I think you know full well that "static" pages aren't termed as such because they're forbidden from having any dynamic properties. ;)

The fact is this sort of functionality is commonly desired. WP should support it out of the box. (A simple checkbox perhaps?)

comment:6 matt9 years ago

  • Owner changed from anonymous to matt
  • Resolution changed from 70 to 90
  • Status changed from new to closed

I would recommend either creating a special template for that page (every page can have its own template if you want) or using a plugin like RunPHP:

http://www.nosq.com/technology/2004/10/runphp-wordpress-plugin/

Note: See TracTickets for help on using tickets.