• Resolved sschmitt

    (@sschmitt)


    Hello!

    I have created a static homepage and set that page to be my actual homepage. I created a page called “blog” with a default template and want that page to be my “blog ” page with the most recent posts.

    The static homepage is working BUT when I click on the “Blog” page it also shows the homepage for some reason. I have the “default template” selected as I thought that would display the most recent posts. Do I need to actually create a template for the “blog” page which runs the loop for the most recent posts?

    Thanks in advance for your time ??

    Sandra ??

Viewing 6 replies - 1 through 6 (of 6 total)
  • esmi

    (@esmi)

    Do I need to actually create a template for the “blog” page

    No – it should use your theme’s index.php template automatically. Does you theme also include a home.php file?

    Thread Starter sschmitt

    (@sschmitt)

    yes it does have a home.php. Should I name it something else?

    esmi

    (@esmi)

    Yes. Try template-home.php. You will also have to tweak it to turn it into a custom page template but that should only mean adding the comment block at the top.

    Thread Starter sschmitt

    (@sschmitt)

    I was able to change the homepage name and that worked for homepage page. But on the Blog page I have it set to default and I know ther are 2 posts in my blog that should show up but it says there are none.

    I started with a blank custom theme from a Lynda.com tutorial. I think I can figure out if I knew what page the”default” was. Is it index.php OR is it page.php?

    AND

    should that file call the “loop”?

    <?php
    			/* Run the loop to output the posts.
    			 * If you want to overload this in a child theme then include a file
    			 * called loop-index.php and that will be used instead.
    			 */
    			 get_template_part( 'loop', 'index' );
    			?>

    or should it have something like this:

    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    		<div class="post" id="post-<?php the_ID(); ?>">
    			<h2><?php the_title(); ?></h2>
    			<?php include (TEMPLATEPATH . '/inc/meta.php' ); ?>
    			<div class="entry">
    				<?php the_content(); ?>
    				<?php wp_link_pages(array('before' => 'Pages: ', 'next_or_number' => 'number')); ?>
    			</div>
    			<?php edit_post_link('Edit this entry.', '<p>', '</p>'); ?>
    		</div>
    		<?php // comments_template(); ?>
    	<?php endwhile; endif; ?>
    Thread Starter sschmitt

    (@sschmitt)

    sorry I couldn’t find the “backticks”

    Thread Starter sschmitt

    (@sschmitt)

    ok… I figured out that I had the wrong template and I it is fixed for the blog home. Thank you for your assistence on the homepage file ??

    thx!
    s ??

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Both Homepage and Blog Page direct to static homepage’ is closed to new replies.