WORDPRESS Loops

LOOP with pages

add_action( 'genesis_before_content', 'themen_liste' );

//* Retrieve our custom sidebar
function themen_liste() { ?>

<?php query_posts( 'post_type=page&posts_per_page=10' ); ?>

<?php while ( have_posts() ) : the_post(); ?>
  <!-- Do special_cat stuff... -->
<?php endwhile; ?>

<?php } // ende function

Tags WordPress Loop

<?php
// übergib die tags in einen array
$posttags = get_the_tags();
// zähle die tags
$tags_anzahl = count( $posttags );
if ($posttags) {
  foreach($posttags as $tag) {
    if ($tagcount == $tags_anzahl ) {
      echo  $tag->name;
      }
    else {
    echo $tag->name . ' | ';
    }
  $tagcount ++;
  }
}
?>

WordPress Loop mit More Teaser abschneiden

query_posts(  'cat=1' );
    // Declare global $more (before the loop).
    global $more;

    echo '<ul class="posts-frage-der-woche">';
    while ( have_posts() ) : the_post(); ?>

      <li>
        <div class="clearfix">
          <a href="<?php the_permalink(); ?>">

            <?php if ( has_post_thumbnail() ) {
              the_post_thumbnail( 'thumbnail', array( 'class' => 'alignleft frage-bild' ) );
            }
            else {
              echo '<img width="75" height="75" class="alignleft" src="' . get_stylesheet_directory_uri() . '/images/icons/frage.svg" alt="Frage der Woche: ' . get_the_title() . '" >';
            } ?>
            <h4><?php the_title(); ?></h4>
          </a>
        </div>

        <p>
          <?php
          // Set (inside the loop) to display content above the more tag.
          $more = 0;
          $teaser = strip_tags ( get_the_content( '' ) , '<br><strong><em>');
        ?>
        <span class="post-date"><?php the_date(); ?></span> | 
        <?php echo $teaser ?>
          </p>
      </li>

  <?php endwhile; ?>
    </ul>