• in the left sidebaR of the homepage, I would like to show the latest post in order. :
    1_ podcast /
    LATEST POST
    2_ news /
    LATEST POST
    3 _ release
    LATEST POST

    Instead of the latest post of all categories
    Thanks

    my blog

Viewing 5 replies - 1 through 5 (of 5 total)
  • <?php
    $cats = get_categories();
    asort($cats);
    reset($cats);
    $count=1;
    foreach($cats as $cat){
      echo "<h5>{$count}_ " . $cat->name ."</h5>";
      query_post('cat='.$cat->term_id.'&order=DESC');
      while(have_posts()): the_post();
    ?>
       <h6><a href="<?php the_permalink() ?>" rel="bookmark" title="Permalink to <?php the_title() ?>"><?php the_title() ?></a></h6>
    <?php
      endwhile;
      $count++;
    }
    ?>

    Try this once.

    Thanks
    C

    Thread Starter Maka

    (@vovotte)

    Hej, thanks,
    Where do i insert this code ?
    This is my defautindex :

    <?php if (is_category()) { ?>
    	<span class="current-category">
    		<?php single_cat_title(__('Currently Browsing: ','Influx'), 'display'); ?>
    	</span>
    <?php }; ?>
    
    <?php if (is_archive()) $post_number = get_option('influx_archivenum_posts');
    	if (is_search()) $post_number = get_option('influx_searchnum_posts');
    	if (is_tag()) $post_number = get_option('influx_tagnum_posts');
    	if (is_category()) $post_number = get_option('influx_catnum_posts');
    	global $query_string; query_posts($query_string . "&showposts=$post_number&paged=$paged"); ?>
    
    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    	<?php $thumb = '';
    		  $width = 60;
    		  $height = 60;
    		  $classtext = 'no_border';
    		  $titletext = get_the_title();
    
    		  $thumbnail = get_thumbnail($width,$height,$classtext,$titletext,$titletext);
    		  $thumb = $thumbnail["thumb"]; ?>
    
    	<div class="home-post-wrap2">
    		<div style="clear: both;"></div>
    		<div class="single-entry">
    			<?php include(TEMPLATEPATH . '/includes/postinfo.php'); ?>
    			<h2 class="titles2"><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php printf(__('Permanent Link to %s','Influx'), get_the_title()) ?>">
    				<?php the_title() ?>
    				</a></h2>
    			<div style="clear: both;"></div>
    
    			<!--Display thumbnail if found-->
    			<?php if($thumb != '') { ?>
    				<div class="thumbnail-div-3">
    					<a href="<?php the_permalink() ?>" title="<?php printf(__('Permanent Link to %s','Influx'), get_the_title()) ?>">
    						<?php print_thumbnail($thumb, $thumbnail["use_timthumb"], $titletext, $width, $height, $classtext); ?>
    					</a>
    				</div>
    			<?php }; ?>
    
    			<?php truncate_post(310) ?>
    			<div style="clear: both;"></div>
    
    			<div class="readmore">
    				<a href="<?php the_permalink() ?>" rel="bookmark" title="<?php printf(__('Permanent Link to %s','Influx'), get_the_title()) ?>"><?php _e('Read More','Influx'); ?></a>
    			</div>
    		</div>
    	</div>
    <?php endwhile; ?>
    	<div style="clear: both;"></div>
    	<?php if(function_exists('wp_pagenavi')) { wp_pagenavi(); }
    			  else include(TEMPLATEPATH . '/includes/navigation.php'); ?>
    <?php else : ?>
    	<?php include(TEMPLATEPATH . '/includes/no-results.php'); ?>
    <?php endif; wp_reset_query(); ?>

    or in my defaut.php

    <?php if (get_option('influx_show_rcenter_column') == 'on') include(TEMPLATEPATH . '/includes/rightcolumn.php'); ?>
    
    <?php if (get_option('influx_duplicate') == 'on') $ids = ''; ?>
    <?php $args=array(
    		'showposts'=>get_option('influx_homepage_posts'),
    		'post__not_in' => $ids,
    		'paged'=>$paged,
    		'category__not_in' => get_option('influx_exlcats_recent'),
    ); ?>
    
    <?php query_posts($args);?>
    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    
    		<?php $thumb = '';
    			  $width = 281;
    			  $height = 130;
    			  $classtext = 'no_border';
    			  $titletext = get_the_title();
    
    			  $thumbnail = get_thumbnail($width,$height,$classtext,$titletext,$titletext);
    			  $thumb = $thumbnail["thumb"]; ?>
    
    		<div class="home-post-wrap">
    			<div class="thumbnail-div">
    				<?php if($thumb != '') { ?>
    					<a href="<?php the_permalink() ?>" title="<?php printf(__('Permanent Link to %s','Influx'), get_the_title()) ?>">
    						<?php print_thumbnail($thumb, $thumbnail["use_timthumb"], $titletext, $width, $height, $classtext); ?>
    					</a>
    				<?php } ?>
    			</div>
    			<h2 class="titles"><a href="<?php the_permalink() ?>" title="<?php printf(__('Permanent Link to %s','Influx'), get_the_title()) ?>">
    				<?php truncate_title(26) ?>
    				</a></h2>
    			<?php truncate_post(410) ?>
    			<div style="clear: both;"></div>
    			<div class="readmore"><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php printf(__('Permanent Link to %s','Influx'), get_the_title()) ?>"><?php _e('Read More','Influx'); ?></a></div>
    		</div>
    
    <?php endwhile; ?>
    
    	<div style="clear: both;"></div>
    	<div style="clear: both; margin-bottom: 10px;">
    		<?php if(function_exists('wp_pagenavi')) { wp_pagenavi(); }
    		else { ?>
    			<?php include(TEMPLATEPATH . '/includes/navigation.php'); ?>
    		<?php } ?>
    	</div>
    
    <?php else : ?>
    	<?php include(TEMPLATEPATH . '/includes/no-results.php'); ?>
    <?php endif; ?>

    put it on your home page sidebar file.

    Thread Starter Maka

    (@vovotte)

    It’s not in the sidebar, it’s in my defaultindex/
    I tried your code, but it didn’t work
    this is the code, i have to change

    <div class="home-post-wrap">
    
    			<div class="thumbnail-div">
    				<?php if($thumb != '') { ?>
    					<a href="<?php the_permalink() ?>" title="<?php printf(__('Permanent Link to %s','Influx'), get_the_title()) ?>">
    						<?php print_thumbnail($thumb, $thumbnail["use_timthumb"], $titletext, $width, $height, $classtext); ?>
    					</a>
    				<?php } ?>
    			</div>
    			<h2 class="titles"><a href="<?php the_permalink() ?>" title="<?php printf(__('Permanent Link to %s','Influx'), get_the_title()) ?>">
    				<?php truncate_title(26) ?>
    				</a></h2>
    			<?php truncate_post(410) ?>
    			<div style="clear: both;"></div>
    			<div class="readmore"><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php printf(__('Permanent Link to %s','Influx'), get_the_title()) ?>"><?php _e('Read More','Influx'); ?></a></div>
    		</div>
    
    <?php endwhile; ?>

    Thread Starter Maka

    (@vovotte)

    Does someoone has a idea ?

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Order the post’ is closed to new replies.