Esempio di WordPress Loop. Codice utilizzato in: https://skillsandmore.org/wordpress-loop-introduzione/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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 »</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