Support » Fixing WordPress » Adapting WordPress to a CMS

  • Resolved sugar_man


    I’m trying to modify WordPress so I can use it as a CMS for my website At the moment I use Cutenews but its not very secure and user-friendly.

    Reading around Codex, it seems the most popular way to set up a CMS is to make the whole layout in WordPress, setting a page as ‘home’, editing templates, creating new themes and that sort of thing.

    I already have a layout designed using xHTML and CSS so I would prefer to just include the content from posts and pages that I make in WordPress. I have installed WordPress in a folder called /wp in the root directory, but I cannot find away of using a simple PHP include function to call content from published posts and pages into a file e.g. events.php in the root directory. Basically I do not know what page, file or function to include.

    Any help would be greatly appreciated. If this sort of thing isn’t possible in WordPress, can anyone recommend a more suitable CMS script?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hey Sugar_man,

    I use WP as a CMS all the time on customer sites and I always build a CSS/xHTML template and then connect it into WordPress, creating a custom ‘theme’ for the site.

    If you’re new at this, there’s a lot of info in the Codex Documentation on creating themes and templates – Google can help you find a lot too.

    A few weeks back, I picked up WordPress Theme Design by Tessa Blakely Silver and if you’re just starting out, it’s well worth the money (currently about $29 USD).

    She walks you through creating a design, and making it into a theme.

    I’m sure there are ways to ‘include’ info from the WordPress database into an exterior (to WordPress) page, but I’ve never done it and don’t see the point.

    Thanks for the advice sewmyheadon. I appreciate that creating themes and templates, and using the is_home() template tag to create a static homepage is the obvious way to use WordPress as a CMS. However I’m not interested in this as I have already done all the work of creating a layout in xHTML and CSS files and do not want to rework everything all over again.

    Thus the simplest solution for me is to ‘include’ info from the WordPress database into an exterior page as you said. I guess what I’m looking for is how WordPress generates a post or page from the database (being ‘dynamic‘), and the back-end stuff behind the the_content() template tag, which in Codex is described as “the meat and potatoes of each pass through The Loop”, so I have an idea of what I can ‘include’.

    I’ve RESOLVED it.

    Basically I found a function called query_posts(). What this does is directly query the database for particular posts or pages, and using The Loop and Template Tags, can retrieve specific records, in the example below the title and content. Full details of using this function, including the conditions you can place like ‘posts per page’ can be found on the User:JamesVL/query posts codex article.


    <?php query_posts('cat=4'); ?>
      <?php if (have_posts()) : while (have_posts()) : the_post();?>
      <p class="header">
      <?php the_title();?>
      <?php the_content() ?>
      <?php endwhile; else: ?>
       Sorry, there has been an error!
    Please report this to the webmaster by sending an email to
      <?php endif; ?>

    Actual web page is

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Adapting WordPress to a CMS’ is closed to new replies.