Support » Themes and Templates » Having a two documents that show recent posts in one site

  • Resolved bradyjfrey


    My apologies, I may not be asking this right, and that’s why I’m not finding a previous answer.

    However, I have a Build I’m working on (not near done), and the intent is to have the home page custom as is, perfect, then to have the News page just have a list of recent posts that’s dynamic.

    This is where my newbie comes in — at first I attempted to make a ‘page’ and write code in the loop similar to the index.php page to accomplish this — apparently not, as the ‘page’ content will always override.

    Next I figured I’d make a duplicate of the index.php and remove all the extras, customize it like I would a standar issue html/php page to just have the recent posts and the sidebar, etc. as needed… but how would I do that and place it in the theme folder… it wouldn’t give me a direct URL then.

    So I pretty much want a dynamic page that isn’t a customizable ‘page’, but I have no idea how to call it’s URL if it’s in the theme’s folder. I can’t very well make an ‘news.php’ and all of a sudden have, it wouldn’t work — unless I’m missing something? Please enlighten:) Thank you!

Viewing 1 replies (of 1 total)
  • Figured it out:
    So I placed the new file in the root folder, out of the theme folder, and gave it:

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

    Which called the header to make it think it was in the theme folder, or so it seems, and then I could give it the same values as index.php, minus the junk. This gave it the same look/feel as the index all post blog page, and gives me multiple main blog pages of the same type. Since this page doesn’t need editing, it’s irrelevant to have a ‘page’ editable, no problem.

Viewing 1 replies (of 1 total)
  • The topic ‘Having a two documents that show recent posts in one site’ is closed to new replies.