Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Esempio di WordPress Loop. Codice utilizzato in: https://skillsandmore.org/wordpress-loop-introduzione/
<?php query_posts( 'page_per_post=5&category_name=pippo' ); ?>
<?php if ( have_posts() ) : ?>
<?php while ( have_posts() ) : the_post(); ?>
/* Codice da eseguire in caso di contenuto trovato */
<div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<h2>
<a href="<?php the_permalink() ?>" title="<?php the_title(); ?>">
<?php the_title(); ?>
</a>
</h2>
<div class="meta">
<p>Scritto da: <?php the_author(); ?> - Commenti: <?php comments_popup_link('0', '1', '%'); ?></p>
<p>Tag: <?php the_tags(' ', ',', ' '); ?> - Categorie: <?php the_category(', '); ?></p>
</div>
<div class="entry-content">
<?php the_content('<p>Continua a Leggere &raquo;</p>'); ?>
</div>
</div>
<?php endwhile; else: ?>
/* Codice da eseguire in caso di contenuto non trovato */
<?php endif; ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.