• I wan’t to make it where it will show the posts I updated on the front page and still have my new posts on these too. How can I do this?

Viewing 10 replies - 1 through 10 (of 10 total)
  • Thread Starter cyberknight8610

    (@cyberknight8610)

    Bump

    This works for me.

    <?php
    $modposts = get_posts('numberposts=6&orderby=modified');
    foreach($modposts as $post) :
    ?>
    <li<a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li>
    <?php endforeach; ?>
    Thread Starter cyberknight8610

    (@cyberknight8610)

    Where do I put the code?

    Mine’s in the sidebar. Put it where you want the list of recently modified posts to appear. I’ve noticed I deleted a > when posting the code. It should read:

    <?php
    $modposts = get_posts('numberposts=6&orderby=modified');
    foreach($modposts as $post) :
    ?>
    <li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li>
    <?php endforeach; ?>
    Thread Starter cyberknight8610

    (@cyberknight8610)

    Sorry I don’t understand, where do I place the code so the updated and new posts appear on the main part of the home page.

    Thread Starter cyberknight8610

    (@cyberknight8610)

    Where do I place this code?

    Within your theme’s index.php template file.

    Thread Starter cyberknight8610

    (@cyberknight8610)

    where do I put it in this code?-

    <?php get_header(); ?>
    	<div id="wrap">
    	<!-- Main Content-->
    		<img src="<?php bloginfo('template_directory');?>/images/content-top.gif" alt="content top" class="content-wrap" />
    		<div id="content">
    			<!-- Start Main Window -->
    			<div id="main">
    
    				<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    
    					<?php include(TEMPLATEPATH . '/includes/entry.php'); ?>
    
    				<?php endwhile; ?>
    
    					<?php if(function_exists('wp_pagenavi')) { wp_pagenavi(); }
    					else { ?>
    						<?php include(TEMPLATEPATH . '/includes/navigation.php'); ?>
    					<?php } ?>
    
    				<?php else : ?>
    					<?php include(TEMPLATEPATH . '/includes/no-results.php'); ?>
    				<?php endif; ?>
    			</div>
    			<!-- End Main -->
    <?php get_sidebar(); ?>
    <?php get_footer(); ?>

    Try adding the code just before <?php if (have_posts()).

    Thread Starter cyberknight8610

    (@cyberknight8610)

    it didn’t work

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Show Updated Post of Front Page’ is closed to new replies.