WordPress.org

Ready to get started?Download WordPress

Forums

True Static Pages (20 posts)

  1. metac0m
    Member
    Posted 9 years ago #

    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"); ?>

  2. philpeeps
    Member
    Posted 9 years ago #

    worked perfectly with wp-advanced-stats...thanks!

  3. Kafkaesqui

    Posted 9 years ago #

    metacom, it's even easier than that:

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

    PUT YOUR STATIC CONTENT HERE

    <?php get_footer(); ?>

  4. George
    Member
    Posted 9 years ago #

    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...

  5. mi327
    Member
    Posted 9 years ago #

    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?

  6. maesterkinoc
    Member
    Posted 9 years ago #

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

  7. Roar
    Member
    Posted 9 years ago #

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

    no, in the ENTIRE universe!

  8. George
    Member
    Posted 9 years ago #

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

  9. Kafkaesqui

    Posted 9 years ago #

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

  10. George
    Member
    Posted 9 years ago #

    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"

  11. 7milesdown
    Member
    Posted 9 years ago #

    fa la la la la! Im so happy with 1.5

  12. Kafkaesqui

    Posted 9 years ago #

    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.

  13. George
    Member
    Posted 9 years ago #

    @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. :-)

  14. Lobo
    Member
    Posted 9 years ago #

    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(); ?>
    ///////////////////

  15. nearlythere
    Member
    Posted 9 years ago #

    @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(); ?>

  16. nearlythere
    Member
    Posted 9 years ago #

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

    <?php get_sidebar(); ?>

  17. ongakukaku
    Member
    Posted 8 years ago #

    i tried that code above and it didn't show the entire theme, and the sidebar is not where its suppose to be is there additional coding necessary ?

  18. ongakukaku
    Member
    Posted 8 years ago #

    is it possible to create pages using wp-admin that will not show up in the page list on the sidebar ?

    to clarify, if i already have a page list of 3 pages and i want to make page 4 and 5 without showing them in the list

    is this possible ?

  19. Karel
    Member
    Posted 8 years ago #

    Sure! Exclude the pages you don't want in the call to wp_list_pages (in the sidebar), like wp_list_pages('exclude=17,38'), where 17 and 38 are the IDs of the pages you want to exclude.

    See http://codex.wordpress.org/Template_Tags/wp_list_pages

    Regards

  20. ongakukaku
    Member
    Posted 8 years ago #

    Here's a rather odd request, not sure if its possible,

    I understand how the code above works for static pages, it pulls in the header/footer works great

    How would it work if i only wanted to pull in only some of the header/footer ?

    I'm assuming i would need header2.php, footer2.php I think and then like the code above how could i make a static page that would pull only the header/footer from this set ?

    this reason i ask this is because i'll be making an additional set of static pages that share some of the regular layout but not all

    if i can do it all form the wordpress that would be most excellent :)

    revised: just answered my own question, the above thought actually works

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags