Make WordPress Core

Opened 16 years ago

Closed 15 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:


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 (7)

#2 @ryan
16 years ago

Plugins are available that interpret PHP in posts.

#3 @anonymousbugger
15 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.

#4 @2fargon
15 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'.

#5 @orangenormal
15 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?)

#6 @matt
15 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:


This ticket was mentioned in Slack in #polyglots by petya. View the logs.

5 years ago

Note: See TracTickets for help on using tickets.