Forums

Instructions for creating static php page using 1.5 (11 posts)

  1. 7milesdown
    Member
    Posted 7 years ago #

    I found the 1.2 instructions for changing the index.php to a static page by hollowing it out and adding content. anyone create some thing similar for 1.5? I've been searching but come up empty.

  2. adsworth
    Member
    Posted 7 years ago #

    Hi,

    in 1.5 you can just add new pages in the admin section Manage /Pages

    Regards
    Adi

  3. nicolelee
    Member
    Posted 7 years ago #

    Yes, but how do you make them appear on the site? I've been wondering this myself.

  4. nicolelee
    Member
    Posted 7 years ago #

    Ah, I've discovered that you can use the wp_list_pages tag to do that:
    http://codex.wordpress.org/Template_Tags/wp_list_pages

    However, as you can see on my site (http://neekole.com), the "test" link goes to neekole.com/test, which doesn't seem to exist. Is there something I need to do with my .htaccess file?

  5. adsworth
    Member
    Posted 7 years ago #

    Hi,

    you can always call a single post and a static page like this index.php?pagename=[POST_SLUG]. If you are using nice permalinks (activate under options /permalinks ) then you need to update your .htaccess or have WP update the .htaccess if it is writable.

    Regards
    adsworth

  6. 7milesdown
    Member
    Posted 7 years ago #

    yeah, I understand that. But I cant add php includes to the page files.

  7. Jack Tummers
    Member
    Posted 7 years ago #

    index.php?page_id=23 would be the way to call a single page.

    If you want to include php, look in the plugin section. There is a plugin that will allow you to include php-code in posts.

  8. adsworth
    Member
    Posted 7 years ago #

    Hi 7milesdown,

    you can solve that using this neat plugin: http://www.nosq.com/technology/2004/10/runphp-wordpress-plugin/

    Regards
    Adi

  9. Michael Adams (mdawaffe)
    Member
    Posted 7 years ago #

    Depending on what exactly you want to do (i.e. where you want to include php code), you can also do the following.

    1. Create a new file (or copy page.php or something similar to a new file) called snarfer.php.
    2. Insert the following at the top of the file.
      <?php
      /*
      Template Name: Snarfer
      */
      ?>
    3. Insert whatever php you need in your new snarfer.php.
    4. Write a new Page in Write->Page making sure to select "Snarfer" from the "Page Template" dropdown (below the content editing textbox).

    You now have a page which, instead of looking to page.php (or index.php if you don't have a page.php) for its template, looks to snarfer.php.

  10. adsworth
    Member
    Posted 7 years ago #

    Hi,

    now that's a neat trick. :)
    I presume the snarfer.php file belongs in the theme directory?

    Regards
    adsworth

  11. Michael Adams (mdawaffe)
    Member
    Posted 7 years ago #

    Yup. The same directory as whatever theme you're using for the rest of the site.

    (Not the "theme" directory but the theme's directory :) )

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.