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
Read more
No Comments
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.
Google Adsense WordPress Plugins
Listed below are 10 best Adsense plugins which help you work smarter with wordpress.
- Adsense Deluxe – offers advanced options for managing the automatic insertion of Google AdSense or Yahoo Publisher Network (YPN) ads to your WordPress posts. Easily switch all Adsense ads to a new color scheme across the entire site.
- Adsense Injection – inserts Adsense code randomly into a pre-existing blog. Takes a random paragraph (or br tag) break in your article and inserts adsense code. It does one per story on multi-post pages (home, archive, category) and let’s you pick how many to show on single post pages.
- Adsense Inline – inserts Google adsense in blog posts.
- Shylock Adsense WordPress plugin – allows you to insert Adsense ads on your blog without modifying the template. Set it up to show different Adsense ads for articles older then ‘n’ days. E.g. insert a 468×60 ad at the bottom of a new article for regular readers, and replace with higher paying 336×280 ad after 7 days for the search engine visitors.
- Adsense Beautifier – makes your Adsense look beautiful by placing images beside them to increase your clicks (CTR) and subsequent Adsense earnings. (May not be compliant with Adsense TOS now)
- AdSense Widget for WordPress Sidebar – Google AdSense widget designed for the new WordPress Sidebar Widgets plug-in.
- AdRotator WordPress Plugin – rotates your adsense ads with other affiliate programs like Chitika Eminimalls wherever you want. Helps to reduce ad blindness and test different ad formats and affiliate programs.
- Adsense Earnings WordPress Plugin – displays your adsense earning details within wordpress admin panel.
- AdSense Manager – is a WordPress plugin for managing AdSense ads on your blogIt generates code automatically and allows positioning with Widgets.
- AdSense Sharing Revenue and Earnings System – allows you to view your adsense earnings and share your adsense impressions with your friends and co-authors.
- Author Adsense WordPress Plugin – allows blog authors to enter their Google Adsense Publisher ID and have ads displayed on their own posts generating revenue. Admin can set the ratio of author’s ads to admin ads.
- Author Adsense MU Plugin – Webmasters of WordPress MU sites can generate adsense revenue from hosted blogs as this script allows you to set an admin ID and the ratio of admin ad’s to blogger’s ads.
- Google Ad Wrap – wraps posts and comments inside Section Targeting tags for better targeted ads.
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
Read more
No Comments