Feb 09
Feb 09
Das Template-Tag get_archives( ) wird normalerweise dazu benutzt, um Posts zu einer bestimmten Kategorie anzuzeigen. Anwendung z.B. für die Sidebar wie folgt:
<h2>Recent Posts</h2>
<ul>
<?php get_archives( 'postbypost', 6 ); ?>
</ul>
Hat man nun viele Kategorien und möchte Artikel zu einer ganz bestimmten Kategorie herausfischen, so muß man eine eigene kleine Datenbankabfrage hinzufügen, was in Wordpress aber reletiv einfach ist:
<ul>
<?php
$recent = new WP_Query( "cat=1&showposts=10" );
while( $recent->have_posts( )): $recent->the_post( );
?>
<li><a href="<?php the_permalink( ); ?>" rel="bookmark">
<?php the_title( ); ?></a>
</li>
<?php endwhile; ?>
</ul>
Das ist also noch recht übersichtlich. Die gewünschte Kategorie-ID holt man sich aus dem Backend (der Adminoberfläche) von Wordpress, unter “Verwalten” / “Kategorien” steht die ID zu jeder Kategorie in der ersten Spalte.
Viel Spaß damit
Tags: datenbank, kategorien, Right sidebar, tabellen, widget, Wordpress
Feb 05
Wordpress allows bloggers to easily integrate Google Adsense inside wordpress using plugins. Google Adsense has become the most popular online contextual advertising program and proper custom integration with Wordpress can help to increase Adsense earnings.
Listed below are 10 best Adsense plugins which help you work smarter with wordpress.
Tags: 468 60, ad formats, adsense, affiliate programs, automatic insertion, beautifier, blogit, Bot, google, google yahoo, Plugins, posts, rating, search engine visitors, sidebar, widget, widgets