Wie man die Sondermeldungen erstellt - How to use the featured articles

In diesem Tutorial zeige ich, wie man den Bereich der Sondermeldungen - der Featured Articles - auf der Homepage von BranfordMagazine verwendet. The english version of this tutorial can be found further down the page.

Die Featured Articles - Sondermeldungen

Die Idee hinter den Featured Articles ist es, einen Bereich für Teaser von speziellen Meldungen oder was auch immer Du in einer besoderen Weise darstellen willst, zu haben.

Lege eine Kategorie an und benenne sie beispielsweise “Sondermeldungen”. Stelle sicher, dass die ID dieser Kategorie im entsprechenden Bereich der index.php aufgerufen wird.

Code Beispiel für die Featured Articles
Code Beispiel für die Featured Articles

Der betreffende Bereich im Code ist “leftcol”. Du musst die Kategorie im Aufruf query_posts festlegen. Wobei “showposts=3″ bedeutet, dass die drei letzten Beiträge dieser Katagorie hier angezeigt werden. “cat=7″ bedeutet, dass es sich um die Kategorie mit der ID 7 handelt. Die ID musst Du noch einmal im Template Tag wp_list_catagories festlegen, damit oberhalb der drei Artikel auch die Kategorie Bezeichnung als Überschrift erscheint.

Featured Articles Headline
Featured Articles Headline

Erneut werden hier benutzerdefinierte Felder zur Anzeige des jeweiligen Bildes verwendet. Der Schlüssel für das Bild lautet “featuredarticleimage”.

Wenn Du diese Kategorie nicht zusätzlich in der Sidebar anzeigen willst, musst Du sie dort ausschließen.


The featured articles

The idea behind the featured articles is to have a category for teasers, specials and whatever you like to show in a featured way.

Create a category and name it e.g. “Featured Articles”. Make sure the ID of this category is called in the relevant area in the index.php file.

Code example of the featured article
Code example of the featured article

The relevant area is called “leftcol”. You have to define the Featured Article category in the query_posts call. While “showposts=3″ means the three most recent posts from the category are displayed and “cat=7″ means the category with ID 7. You have to define the ID once again in the wp_list_catagories template tag to make the category title appear as the headline.

Featured Articles Headline
Featured Articles Headline

You have to use custom fields again to display the image here and the key for that field is “featuredarticleimage”.

If you don´t want to display the Featured Articles category in the Sidebar you have to exclude it.




About this entry