Viewing 4 replies - 1 through 4 (of 4 total)
  • Basically what you need to do is create a new Page template then assign your new page to use that template. Once you have uploaded your new template file to your theme’s folder, simply write a new page – for the sake of simplicity let’s call it Latest Entries – then assign the new page template to that page from the drop menu.

    You can easily build a new page template by using your theme’s current page.php as an example.

    Leave the actual content of the page blank. Publish the new page. It will be blank but that’s fine. In the new template file – once again for simplicity let’s call it latest.php – you can use this modified version of the loop …

    <?php $page = (get_query_var('paged')) ? get_query_var('paged') : 1; query_posts("showposts=x&paged=$page"); while ( have_posts() ) : the_post() ?>

    I used the showposts= argument so that you can show as many posts on that page as you want despite your settings in the admin interface – this will override it. Be sure to enter the number of posts you want shown in place of the x.

    If you’re not sure how to implement what I have shown you I have included a complete new page template to a pastebin service. All you need to do is download it then upload it to your theme’s folder.

    A caveat: I see your using Arthemia Pro. I used the free version of Arthemia as a working example but I doubt there is any difference in how its page templates are constructed.

    Thread Starter nathanmock

    (@nathanmock)

    Thank you for your help. I got it to work fine, however, I have a few questions. Everything displays fine, but here is how I would like it to be displayed…I want it to show entries as it does on the archive page (using the excerpts, example: https://nathanmock.com/category/art-and-design/), but not have the headline and category hover overs directly underneath it show (example: https://nathanmock.com/subscribe/feeds/).

    Here is the code for the archive.php, it may be of help to you.

    <?php get_header(); ?>
    
    	<div id="content" class="archive">
    
    	<?php if (have_posts()) : ?>
    
     	  <?php $post = $posts[0]; // Hack. Set $post so that the_date() works. ?>
    
     	  <?php /* If this is a category archive */ if (is_category()) { ?><span id="map"><a href="<?php echo get_option('home'); ?>/">Home</a> &raquo; Archive by Category</span>
    <h2 class="title">Articles in the <strong><?php single_cat_title(); ?></strong> Category</h2>
    
    	<?php /* If this is a tagged archive */ } elseif (is_tag()) { ?><span id="map"><a href="<?php echo get_option('home'); ?>/">Home</a> &raquo; Archive by Tags</span><h2 class="title">Articles tagged with: <strong><?php single_tag_title(); ?></strong></h2>
    
     	  <?php /* If this is a daily archive */ } elseif (is_day()) { ?><span id="map"><a href="<?php echo get_option('home'); ?>/">Home</a> &raquo; Archive by Day</span><h2 class="title">Articles Archive for <strong><?php the_time('j F Y'); ?></strong></h2>
    
     	  <?php /* If this is a monthly archive */ } elseif (is_month()) { ?><span id="map"><a href="<?php echo get_option('home'); ?>/">Home</a> &raquo; Archive by Month</span><h2 class="title">Articles Archive for <strong><?php the_time('F Y'); ?></strong></h2>
    
    	<?php /* If this is a yearly archive */ } elseif (is_year()) { ?><span id="map"><a href="<?php echo get_option('home'); ?>/">Home</a> &raquo; Archive by Year</span><h2 class="title">Articles Archive for <strong>Year <?php the_time('Y'); ?></strong></h2>
    
     	  <?php /* If this is a paged archive */ } elseif (isset($_GET['paged']) && !empty($_GET['paged'])) { ?>
    		<span id="map"><a href="<?php echo get_option('home'); ?>/">Home</a> &raquo; Archive</span>
    		<h2 class="title">The Archives</h2>
     	  <?php } ?>
    
    	<div class="clearfloat">
    
    	<?php while (have_posts()) : the_post(); ?>
    
    	<div class="tanbox left">
    		<span class="title"><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></span>
    		<div class="meta"><?php the_time('l, j M, Y') ?> – <?php the_time('G:i') ?> | <?php comments_popup_link('No Comment', 'One Comment', '% Comments');?></div>
    
    	<?php $width = get_settings ( "cp_thumbWidth_Archive" );
    		$height = get_settings ( "cp_thumbHeight_Archive" );
    		if ( $width == 0 ) { $width = 80; }
    		if ( $height == 0 ) { $height = 80; }
    	?>	
    
    	<?php $status = get_settings ( "cp_thumbAuto" );
    		if ( $status != "first" ) { ?>
    
    	<?php
    	//Check if custom field key "Image" has a value
    	$values = get_post_custom_values("Image");
    	if (isset($values[0])) {
    	?>
    		<a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><img src="<?php echo bloginfo('template_url'); ?>/scripts/timthumb.php?src=<?php echo get_option('home'); ?>/<?php
    $values = get_post_custom_values("Image"); echo $values[0]; ?>&amp;w=<?php echo $width; ?>&amp;h=<?php echo $height; ?>&amp;zc=1&amp;q=100"
    alt="<?php the_title(); ?>" class="left" width="<?php echo $width; ?>px" height="<?php echo $height; ?>px"  /></a>
    		<?php } ?>
    
    	<?php } else { ?>
    
    	<?php $id =$post->ID;
    $the_content =$wpdb->get_var("SELECT post_content FROM $wpdb->posts WHERE ID = $id");
    $pattern = '!<img.*?src="(.*?)"!';
    preg_match_all($pattern, $the_content, $matches);
    $image_src = $matches['1'][0]; ?>
    
    	<a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>">
    <img src="<?php echo bloginfo('template_url'); ?>/scripts/timthumb.php?src=<?php if($image_src != '') { echo $image_src; } ?>&amp;w=<?php echo $width; ?>&amp;h=<?php echo $height; ?>&amp;zc=1&amp;q=100"
    alt="<?php the_title(); ?>" class="left" width="<?php echo $width; ?>px" height="<?php echo $height; ?>px"  /></a>
    
    	<?php } ?>
    
    		<?php the_excerpt(); ?>
    	</div>
    
    	<?php endwhile; ?>
    	</div>	
    
    	<div id="navigation">
    	<?php if(function_exists('wp_pagenavi')) { wp_pagenavi(); } ?>
    	</div>
    
    	<?php else : ?>
    		<span id="map"><a href="<?php echo get_option('home'); ?>/">Home</a> &raquo; Archive</span>
    		<h2 class="title">Not Found</h2>
    
    		No posts found. Try a different search?
    
    	<?php endif; ?>
    
    	</div>
    
    <?php get_sidebar(); ?>
    <?php get_footer(); ?>

    Thread Starter nathanmock

    (@nathanmock)

    If possible, I would also like it to show 10 of the most recent posts, and then have a link that will update the page with the 10 succeeding most recent posts. So for example, the first page will show (1-10), second, (11-20), third (21-30), etc.

    I would like use archive.php to show all the recent posts from all categories.
    What is the correct argument for do that ?

    For instance, when I want show all posts from category 5, I call
    https://MySiteURL/?cat=5

    Where can I find the syntax to call all categories ?

    Thank you.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Show All Recent posts’ is closed to new replies.