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

Viewing 10 replies - 1 through 10 (of 10 total)
  • Hi,

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

    Regards
    Adi

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

    Ah, I’ve discovered that you can use the wp_list_pages tag to do that:
    https://codex.www.ads-software.com/Template_Tags/wp_list_pages

    However, as you can see on my site (https://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?

    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

    Thread Starter 7milesdown

    (@7milesdown)

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

    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.

    Hi 7milesdown,

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

    Regards
    Adi

    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.

    Hi,

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

    Regards
    adsworth

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

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Instructions for creating static php page using 1.5’ is closed to new replies.