• WordPress-CMSing

    WordPress by default is a blogging tool and works extremely well at it. After much debate the developers added the ability to create pages as well as posts, however WP isn’t built for advanced pages, it was only developed to say create an about page or contact page with simple text only.

    Conventional ways of creating advanced pages in WordPress was to create all your XHTML/PHP/CSS in a template file and then create a page and link the two, this works, but you end up with loads of template files and editing them is a pain and not very manageable. Wouldn’t it be cool to create and edit pages the same way you do posts?

    Well using this technique it is more than possible. First of all you need to add the following code to your Page Template file called “page.php”

    <?php get_header(); ?> <?php if (have_posts()) : while (have_posts()) : the_post(); ?> <?php edit_post_link('EDIT', '<p class="edit">', '</p>'); ?> <?php the_content(''); ?> <?php endwhile; endif; ?> <?php get_footer(); ?>

    Next you need to download two plugins:

    runPHP
    Text Control

    Activating both of these will then allow you to very easily add any code such as XHTML, CSS, PHP, JavaScript directly inside of the post box for your pages and will be executed as it should be.

    ENJOY. XXX

    Cameron “dRiZ” Drysdale
    Founder & Creative Director of simplecandy.com

    Post Revisions:

    Posted November 3, 2007

8 comments

  1. Chip said:

    I think that WordPress is very appropriate for a CMS. With all the existant plugins and themes, and the flexibility of WordPress, it is fit to be used as full-option content management system.

    on November 3, 2007 at 3:43 pm Reply

  2. David said:

    Hmm, I am quite new to wordpress but I have found a plugin called tinymce-advanced. What is the difference between that gadget and the ‘hack’ above?

    on November 4, 2007 at 3:00 am Reply

  3. Bram said:

    Now that’s handy!

    on November 4, 2007 at 7:27 am Reply

  4. dRiZ said:

    @ David

    That plugin just adds more advanced features to the WP-Admin interface, such as giving you more control over certain things. What I talk about above isn’t a hack per-say, it’s just a way to let you manage content the way WordPress was designed to rather than via the Theme system when working with PHP and more advanced XHTML/CSS. Hope this answers your question. x

    on November 4, 2007 at 8:05 am Reply

  5. Jenny said:

    I’ve known about this for a while and it’s a really good way to do it. That’s how I made my directory with WordPress. :)

    on November 5, 2007 at 2:01 pm Reply

  6. Johell said:

    I have an “edit” function at my site, and it’s very handy. I highly recommend this to anyone.

    on November 6, 2007 at 8:16 am Reply

  7. Julian said:

    I have a questions: what’s the difference between runPHP and PHPExec?

    on November 6, 2007 at 5:14 pm Reply

  8. dRiZ said:

    @Julian

    As far as I can tell nothing much, I personally prefer runPHP as it has the best options IMO and has a good support.

    on November 6, 2007 at 7:52 pm Reply


RSS feed for comments on this post.

Leave a comment

Trackbacks on this post

  1. links for 2007-11-11 | MY Vast Right Wing Conspiracy

    [...] WordPress-CMSing Conventional ways of creating advanced pages in WordPress was to create all your XHTML/PHP/CSS in a template file and then create a page and link the two, this works, but you end up with loads of template files and editing them is a pain and not very mana (tags: wordpress CMS design webdesign plugins php) [...]

  2. A Whole Lotta Yadda » Blog Archive » link-o-licious for 11.12.07

TrackBack URL