Make WordPress Core

Opened 19 years ago

Closed 19 years ago

Last modified 8 years ago

#494 closed enhancement (wontfix)

PHP in Static Pages

Reported by: orangenormal's profile orangenormal Owned by: matt's profile 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 (7)

#2 @ryan
19 years ago

Plugins are available that interpret PHP in posts.

#3 @anonymousbugger
19 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
19 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
19 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
19 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/

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


8 years ago

Note: See TracTickets for help on using tickets.