Hallo zusammen,
ich möchte in meinem Blog den jeweils aktuellsten Beitrag aus einer bestimmten Kategorie auf einer Seite anzeigen. Ich habe daher das Plugin Category Magic installiert.
Das funktioniert auch soweit, nur leider zeigt das Plugin nicht den Inhalt des Beitrags an, sondern nur den Link auf diesen Beitrag.
Die Funktion des Plugins lautet wie folgt:
PHP
function glmcatpost() {
$arg_list = func_get_args();
$cat_ID1 = $arg_list[0];
$numposts = $arg_list[1];
$catquery1 = 'numberposts=1000&category='.$cat_ID1; //sets up the query for id1
$catposts1 = get_posts($catquery1); //gets the posts from category id1
$count=0; //sets the count to zero
$glmpostarray= array();
$i = 1;
if (empty($numposts))
$numposts='5';
foreach($catposts1 as $post1) : //starts looping from the posts from query1
$glmpostarray[$count] = '<ul><li><a href="'.get_permalink($post1).'">'.$post1->the_category.'</a></li></ul>';
$count++; //increments the counter
endforeach;
if ($numposts > $count)
$numposts = $count;
for ($i=0; $i<$numposts; $i++) {
echo $glmpostarray[$i]; }
}
Alles anzeigen
Diese Zeile steuert die Ausgabe, also den Link, den die Funktion ausgibt:
PHP
$glmpostarray[$count] = '<ul><li><a href="'.get_permalink($post1).'">'.$post1->the_category.'</a></li></ul>';
Kann mir jemand helfen, wie ich anstelle des Links den Beitrag selbst (Inhalt) ausgeben kann?
Viele Dank,
usr2009