• I am trying to get my most recent posts to show up on my home page, like a news feed. I have my “blog” page set for my posts, and my “home” page set for my home. I want the posts from my blog page to also show up on my home page. I downloaded a plugin, but it doesn’t seem to be what I am looking for. How can this be achieved?
    thecrisisfilm.com/wordpress

Viewing 7 replies - 1 through 7 (of 7 total)
  • <?php
    query_posts('showposts=1');
    while(have_posts()) : the_post();
    ?>
    <ul>
    <li><h3><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></h3>
    
    <ul><li><?php the_content_limit(520); ?></li>
    </ul>
    </li>
    </ul>
    <?php endwhile; ?>

    Try this.

    Thread Starter mtx212s

    (@mtx212s)

    I just get a syntax error. What do I need to be replacing with that?

    Thread Starter mtx212s

    (@mtx212s)

    That page is a “Not Found”. Is there another link?

    you just add my first given code. I am not getting any error from above code. check your end properly.

    Thread Starter mtx212s

    (@mtx212s)

    <div class="Layer-28 textcontent" >
             <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    
            <div <?php post_class() ?> id="post-<?php the_ID(); ?>">
                <h3 class="storytitle"><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></h3>
                <div class="meta"><?php _e("Filed under:"); ?> <?php the_category(',') ?> — <?php the_tags(__('Tags: '), ', ', ' — '); ?> <?php the_author() ?> @ <?php the_time() ?> <?php edit_post_link(__('Edit This')); ?></div>
    
                <div class="storycontent">
                        <?php the_excerpt(); ?>
                </div>
    
                <div class="feedback">
                    <?php wp_link_pages(); ?>
                    <?php comments_popup_link(__('Comments (0)'), __('Comments (1)'), __('Comments (%)')); ?>
                </div>
    
            </div>
    
            <?php comments_template(); // Get wp-comments.php template ?>
      <?php
    query_posts('showposts=1');
    while(have_posts()) : the_post();
    ?>
    <ul>
    <li><h3><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></h3>
    
    <ul><li><?php the_content_limit(520); ?></li>
    </ul>
    </li>
    </ul>
    <?php endwhile; ?>
                <p><?php _e('Sorry, no posts matched your criteria.'); ?></p>
            <?php endif; ?>
    
            <?php posts_nav_link(' — ', __('&laquo; Newer Posts'), __('Older Posts &raquo;')); ?>
    
            <?php wp_footer(); ?>
    
            </div>
          </div>

    That is my code, I’m still getting a syntax error

    <div class="Layer-28 textcontent" >
     <?php
    query_posts('showposts=1');
    while(have_posts()) : the_post();
    ?>
    <ul>
    <li><h3><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></h3>
    
    <ul><li><?php the_content_limit(520); ?></li>
    </ul>
    </li>
    </ul>
    <?php endwhile; ?>
             <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    
            <div <?php post_class() ?> id="post-<?php the_ID(); ?>">
                <h3 class="storytitle"><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></h3>
                <div class="meta"><?php _e("Filed under:"); ?> <?php the_category(',') ?> — <?php the_tags(__('Tags: '), ', ', ' — '); ?> <?php the_author() ?> @ <?php the_time() ?> <?php edit_post_link(__('Edit This')); ?></div>
    
                <div class="storycontent">
                        <?php the_excerpt(); ?>
                </div>
    
                <div class="feedback">
                    <?php wp_link_pages(); ?>
                    <?php comments_popup_link(__('Comments (0)'), __('Comments (1)'), __('Comments (%)')); ?>
                </div>
    
            </div>
            <?php endwhile; ?>
            <?php comments_template(); // Get wp-comments.php template ?>
    
                <p><?php _e('Sorry, no posts matched your criteria.'); ?></p>
            <?php endif; ?>
    
            <?php posts_nav_link(' — ', __('« Newer Posts'), __('Older Posts »')); ?>
    
            <?php wp_footer(); ?>
    
            </div>
          </div>

    Try this once.

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Recent Posts on Static Home Page’ is closed to new replies.