go41

the info you need to know


von Joern
Keine Kommentare

Another piece of code to get 4 random old post listed in your sidebar.php of wordpress is this:Code:<h3>Oldies but Goodies</h3><ul><?php global $wp_query; $rndposts = get_posts('numberposts=4&offset=15&orderby=rand()'); foreach($rndposts as $post) : setup_postdata($post); ?><li><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></li><?php endforeach; ?></ul>put…


von Joern
Keine Kommentare

@cat:to get the posts of the current month and current year you find this code in WordPress Codex:Code:<?php $current_month = date('m'); ?><?php $current_year = date('Y'); ?><?php query_posts("cat=22&year=$current_year&monthnum=$current_month&order=ASC"); ?><!-- put your loop here -->With this code and a modified current_year variable…