PHP [WORDPRESS] einige template tags gehen in der loop nicht

asseskiller

Lt. Junior Grade
Registriert
Sep. 2005
Beiträge
447
Hi ich bin am Template bauen. Hab dazu folgenden Code:

PHP:
get_header(); ?>

<div id="container">
    <div id="content" role="main">
    
    <?php  $posts = get_posts('numberposts=5&category=4&orderby=date&order=DESC');
    foreach( $posts as $post ) :
    ?>
        <a href="<?php the_permalink(); ?>"><?php the_title(); ?></a><br />
        <?php joco_posted_on();?><br />
        Inhalt:<?php the_content(); ?>
        <br /><br />
    <?php endforeach; ?>
    
    </div><!-- #content -->
</div><!-- #container -->

<?php get_footer(); ?>

Jetzt habe ich das problem das the_title usw alles fehlerfrei angezeigt wird. Aber bei the_content() kommt rein garnix. Auch die Funktion the_excerpt und einige andere liefern nix. Was mache ich falsch?
 
ich hab die Form der Loop noch nie gesehen. Hat das mal funktioniert?

siehe http://codex.wordpress.org/The_Loop

dort heißt es:

Code:
[B]<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>[/B]
[COLOR="Gray"]<!-- hier den inhalt etc definieren -->[/COLOR]
 [B]<?php endwhile; else: ?>[/B]

 [COLOR="Gray"]<!-- The very first "if" tested to see if there were any Posts to -->
 <!-- display.  This "else" part tells what do if there weren't any. -->
 <p>Sorry, no posts matched your criteria.</p>[/COLOR]

[COLOR="Gray"] <!-- REALLY stop The Loop. -->[/COLOR]
 [B]<?php endif; ?>[/B]
 
Zurück
Oben