WordPress.org

Support

Support » Themes and Templates » True Static Pages

True Static Pages

  • With the new themes in 1.5 its very easy to have true static pages like http://domain.com/static.php (and theme independent assuming your theme has a header and a footer), you can also edit them through the admin interface Manage – Files -> :

    <?php
    require(‘./wp-blog-header.php’);
    $themes = get_themes();
    $current_theme = get_current_theme();
    $current_template_dir = $themes[$current_theme][‘Template Dir’];
    include($current_template_dir . “/header.php”);
    ?>

    PUT YOUR STATIC CONTENT HERE

    <?php include($current_template_dir . “/footer.php”); ?>

Viewing 15 replies - 1 through 15 (of 19 total)
  • worked perfectly with wp-advanced-stats…thanks!

    metacom, it’s even easier than that:

    <?php
    require('./wp-blog-header.php');
    get_header();
    ?>

    PUT YOUR STATIC CONTENT HERE

    <?php get_footer(); ?>

    okay this is what I want, but please explain my how to safe the .php file (under what name) and where (in which folder).
    Also explain me how to place my content in there from the admin menu. I know it must be very simple but I cannot grasp /reproduce this…

    for some reason my static “pages” won’t show up in my manage part of my admin. I create them, they’re in my create a page folder in the drop menu, but i can’t edit them.
    anyone else having this problem?

    Just what I needed thanks! I needed something to keep hold of my other pages.

    You have just made me the happiest girl on the ENTIRE planet…

    no, in the ENTIRE universe!

    I cannot do it. How does this work I mean in what folder under what name do yousave this .php file
    Help me, someone!!!

    You would save/upload it to your main blog directory, i.e. where wp-blog-header.php resides.

    okay I’ll try again, now it works.
    kafkaequi, When I use your example the sidebar loads as well. I don’t see it in the code… It must be triggered by the blog-header then… EDIT only in the Classic theme

    EDIT 2 after reading this http://www.tamba2.org.uk/wordpress/static/

    Which template file needs to be altered in 1.5?

    Use
    Open this file – template.php – in your editor of choice.
    Type your desired words <div id=”content”> inside this div </div>
    Save the file – for instance ‘aboutme.php’
    Upload to your WP directory”

    fa la la la la! Im so happy with 1.5

    george71:

    The sidebar loads in the Classic theme because footer.php for that theme actually loads sibebar.php. I guess the devs assume anyone wanting to use Classic want the menu as well.

    What we’re describing in this thread is how to create a “static” page while using the Themes functionality in 1.5. podz’s static document (which you’ve linked to) is aimed more at 1.2.x, or for setting up templates independent of theme. So he’s describing how to section off and create your own template files. Using Themes in 1.5, the correlation would be to edit the various template files for a particular theme.

    @kafkaesque, After fiddling around with themes and static pages I’m beginnng to understand all this and I can reproduce it. Now knowing why this makes people so happy. I’m thinking of a redesign of my site that can be hooked to the WP CMS. 🙂

    Ok what I did was create a test.php and follow the indications of this thread but I can’t see all the links on the sidebar <div id=”sidebar”> how can put all the others links?

    Until now I couldn’t find a step by step manual/tutorial on how we can create static pages and put links to this on the sidebar menu. 🙁
    And I think is the BEST feature on this last version of WP.

    ///////////////////
    TEST.PHP
    ///////////////////
    <style type=”text/css”>

    .titulo{
    font-family: ‘Trebuchet MS’, ‘Lucida Grande’, Verdana, Arial, Sans-Serif;
    font-weight: bold;
    font-size: 1.6em;
    }

    </style>

    <?php
    require(‘./wp-blog-header.php’);
    get_header();
    ?>

    <br><br>

    <div id=”content” class=”narrowcolumn”>
    <div class=”post”>

    <span class=”titulo”>

    Spanish </span>

    TESt TESt TESt TESt TESt TESt TESt TESt TESt TESt TESt TESt TESt TESt TESt TESt TESt TESt TESt TESt

    </div>
    </div>

    <div id=”sidebar”>
    <?php wp_list_pages(‘sort_column=menu_order’); ?>
    </div>

    <?php get_footer(); ?>
    ///////////////////

    @lobo, You say your ‘sidebar’ is not showing up when you try and create static pages as outlined above by Kafkaesqui.

    If I understand your question, You would need to include one line:

    <?php
    require('./wp-blog-header.php');
    get_header();
    ?>

    PUT YOUR STATIC CONTENT HERE

    <?php get_sidebar(); ?>

    <?php get_footer(); ?>

    If that wasn’t clear, I mean the ‘one line’ you need to add is:

    <?php get_sidebar(); ?>

Viewing 15 replies - 1 through 15 (of 19 total)
  • The topic ‘True Static Pages’ is closed to new replies.
Skip to toolbar