Sziasztok fórumozók!
Egy kis segítségre lenne szükségem!
Szeretnék létrehozni a WP főoldalon egy olyan linket, ami a korábbi bejegyzéseket mutatja.
Abban az elrendezésben szeretném kilistázni az archív bejegyzéseket, ahogy a sablonom kilistázza az egyes kategóriákban található cikkeket.
Van valakinek ötlete, hogy hogyan tudnám ezt a dolgot kivitelezni?
Az esetleges válaszokat előre is köszönöm!
Ha minden igaz ez a kategóriákat kilistázó php fájl tartalma:
Kód:
<?php global $bnews_options, $blognews; ?>
<?php get_header(); ?>
<!-- CONTAINER -->
<div id="container2">
<?php if(!is_category($bnews_options["blogID"])) { ?>
<?php $post = $posts[0]; // Hack. Set $post so that the_date() works. ?>
<?php /* If this is a category archive */ if (is_category()) { ?>
<h3 class="bcrum"><?php echo $blognews["catarc"]; ?> ‘<?php single_cat_title(); ?>’</h3>
<?php /* If this is a tag archive */ } elseif( is_tag() ) { ?>
<h3 class="bcrum"><?php echo $blognews["tagarc"]; ?> ‘<?php single_tag_title(); ?>’</h3>
<?php /* If this is a daily archive */ } elseif (is_day()) { ?>
<h3 class="bcrum"><?php echo $blognews["datearc"]; ?> ‘<?php the_time('F jS, Y'); ?>’</h3>
<?php /* If this is a monthly archive */ } elseif (is_month()) { ?>
<h3 class="bcrum"><?php echo $blognews["datearc"]; ?> ‘<?php the_time('F, Y'); ?>’</h3>
<?php /* If this is a yearly archive */ } elseif (is_year()) { ?>
<h3 class="bcrum"><?php echo $blognews["datearc"]; ?> ‘<?php the_time('Y'); ?>’</h3>
<?php /* If this is an author archive */ } elseif (is_author()) { ?>
<h3 class="bcrum"><?php echo $blognews["autharc"]; ?></h3>
<?php /* If this is a paged archive */ } elseif (isset($_GET['paged']) && !empty($_GET['paged'])) { ?>
<h3 class="bcrum"><?php echo $blognews["blogarc"]; ?></h3>
<?php } ?>
<?php } ?>
<!-- POST STARTS -->
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<h2 class="archiveTitle"><a href="<?php the_permalink(); ?>" rel="bookmark"><?php the_title(); ?></a></h2>
<span class="postinfo">
<span class="author"><?php echo $blognews["writtenby"]; ?> <?php the_author_posts_link(); ?></span>
<span class="folder"><?php the_category(', '); ?></span>
<span class="date"><?php the_time('M j, Y'); ?></span>
<span class="clear"></span>
</span>
<div class="post">
<?php if($bnews_options['enVideos'] == 1) { ?>
<?php if ( in_category($bnews_options["videoCatID"]) ): ?>
<div class="video">
<object type="application/x-shockwave-flash" style="width:200px; height:280px;" data="<?php echo get_post_meta($post->ID, 'video', true); ?>">
<param name="wmode" value="opaque" /><param name="movie" value="<?php echo get_post_meta($post->ID, 'video', true); ?>" /></object>
</div>
<?php endif; ?>
<?php } ?>
<?php if ( is_category($bnews_options["blogID"]) ) { the_content(); } else { ?>
<a class="highslide" onclick="return vz.expand(this)" href="<?php viva('BnHover','1'); ?>"><img src="<?php viva('Bn140x87','5'); ?>" class="alignleft" alt="<?php the_title(); ?>" /></a>
<?php the_excerpt(); ?>
<?php } ?>
<div class="clear"></div>
</div>
<?php endwhile; else : endif; ?>
<div class="navigation">
<?php posts_nav_link(); ?>
</div>
</div>
<!-- END OF CONTAINER -->
<!-- RIGHT SIDEBAR -->
<div id="rightSidebar">
<?php get_sidebar(); ?>
</div>
<!-- END OF RIGHT SIDEBAR -->
<div class="clear"></div>
<?php // if($bnews_options['enSubNewsSingle'] == 1 and !is_category($bnews_options["blogID"])) { /*If you want to display subnews section on archive pages, remove // after < ?php on this and following two lines */ ?>
<?php // include (TEMPLATEPATH . '/subnews.php'); /* 4 entries above the footer */ ?>
<?php // } ?>
</div><!-- end of wrapper -->
<?php get_footer(); ?>
</body>
</html>
Üdv.: Andris
Könyvjelzők