• I’m trying to figure out how to have a latest post blog loop on every page in my footer. This is my theme: https://lwebdesigns.net/blog/. How do you make a loop for the blog content on every page?

    This is the code I am using:

    Footer:

    <div class="fourcolumn">
    	<h2>Latest Post</h2>
    	<?php if ( ! have_posts() ) : ?>
            <h1>Not Found</h1>
                <p>Apologies, but no results were found for the requested archive. Perhaps searching will help find a related post</p>
    <?php endif; ?>  
    
    <?php while ( have_posts() ) : the_post(); ?>  
    
           <div class="lp-dates"><?php the_time('M <br /> j') ?></div>
    
                    <div class="latest-post"><a href="<?php the_permalink(); ?>"><?php wpe_excerpt('wpe_excerptlength_teaser', 'wpe_excerptmore'); ?></a><div class="dash-divider"></div></div>  
    
    <?php endwhile; ?>
    </div>

    Functions:
    `
    <?php function wpe_excerptlength_teaser($length) {
    return 8;
    }
    function wpe_excerptlength_index($length) {
    return 30;
    }
    function wpe_excerptmore($more) {
    return ‘…’;
    } ?>

  • The topic ‘Blog Loop In Footer on Every Page’ is closed to new replies.