• This may be really simple and noob like.

    I am using a Static Home page (homepage_tpl.php) for my home page. All my blog or news info is being posted to the news section which is simply a page I created in the UI called “Newsletters” and it uses a template page I created called (newsletters_tpl.php). When I created that page in the WP UI, there is a title and post body content I wrote and can still see it in the UI under “Pages.” But when I view the page, it uses the correct template, but only posts show up. I was under the assumption the content I wrote on that “page” would also show up.

    Did I need to tag this properly to show both? I am currently just using “Blank Slate” as I am making my own theme.

    Thanks.

Viewing 9 replies - 1 through 9 (of 9 total)
  • try adding the_content(); above your post loop.

    the code of your page template determines what is shown on that page;
    if you don’t add code to the template to show the original page content, it wil not be shown.
    i.e. you will need to have a basic ‘normal’ loop to show the actual page content (and title if you want), and then follow that with what you had in your page template so far.

    It depends upon how you coded your newsletters_tpl.php page template. From what you have said, it sounds as if you modified the main query rather than leaving it alone and then creating a secondary query for your posts using get_posts or WP_Query.

    Thread Starter danmerk

    (@danmerk)

    So you are all saying that the index.php will always be the page that any posts is written to? If so, then I have to place:

    <?php the_content();?>

    On a generic default template in order to show what gets shown on the page template? Seems odd since my other pages all seem to be using the index.php file even when I specify which template to use.

    Thread Starter danmerk

    (@danmerk)

    For edification:

    To make my “newsletter_tpl.php” template, I just copied the file called “page.php” and renamed to another file with the above name.

    So you are all saying that the index.php will always be the page that any posts is written to?

    Bingo!

    To make my “newsletter_tpl.php” template, I just copied the file called “page.php” and renamed to another file with the above name.

    Did you review Creating_Your_Own_Page_Templates?

    Thread Starter danmerk

    (@danmerk)

    I remedied this by creating a child page under “Newsletters” for each category. Once I did that, I pointed my posts to that page and now the parent page content shows up and the posts are populating the child page. This may be an issue in the future when I may want to categorize news content and make posts to other child pages.

    For now, I’ll keep digging into making my own templates. Thanks!

    Thread Starter danmerk

    (@danmerk)

    Is there any way to tell WP not to use the index.php template for a category post main page? I only see one location in the UI where you tell it to use a specified Page you’ve created under “Pages.”
    Am I having this issue because I’ve selected sort by category?

    I just want to create a few templates with my own code and not have WP use one index.php for every category page.

    Is there any way to tell WP not to use the index.php template for a category post main page?

    Yes – create a category template file. You might also want to have a look at Theme_Development – specifically the template hierarchy. Once you understand how the hierarchy works, you may begin to find this kind of customisation a lot easier.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Page content overridden by Posts’ is closed to new replies.