Come creare un tema per wordpress 3.0 – author.php

La pagina author contiene le informazioni sull’autore, vediamo il codice.

<?php get_header(); ?>

<?php
if(isset($_GET[‘author_name’])) :
$curauth = get_user_by(‘slug’, $author_name);
else :
$curauth = get_userdata(intval($author));
endif;
?>

About: <?php echo $curauth->nickname; ?>
<dl>
<dt>Website</dt>
<dd><a href=”<?php echo $curauth->user_url; ?>”><?php echo $curauth->user_url; ?></a></dd>
<dt>Profilo</dt>
<dd><?php echo $curauth->user_description; ?></dd>
</dl>

Post di <?php echo $curauth->nickname; ?>:

<ul>

<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<li>
<a href=”<?php the_permalink() ?>” rel=”bookmark” title=”Permanent Link: <?php the_title(); ?>”>
<?php the_title(); ?></a>,
<?php the_time(‘d M Y’); ?> in <?php the_category(‘&’);?>
</li>

<?php endwhile; else: ?>
<p><?php _e(‘Nessun post da questo autore.’); ?></p>

<?php endif; ?>
</ul>

<?php get_sidebar(); ?>
<?php get_footer(); ?> <?php get_header(); ?>

<?php
if(isset($_GET[‘author_name’])) :
$curauth = get_user_by(‘slug’, $author_name);
else :
$curauth = get_userdata(intval($author));
endif;
?>

About: <?php echo $curauth->nickname; ?>
<dl>
<dt>Website</dt>
<dd><a href=”<?php echo $curauth->user_url; ?>”><?php echo $curauth->user_url; ?></a></dd>
<dt>Profilo</dt>
<dd><?php echo $curauth->user_description; ?></dd>
</dl>

Post di <?php echo $curauth->nickname; ?>:

<ul>

<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<li>
<a href=”<?php the_permalink() ?>” rel=”bookmark” title=”Permanent Link: <?php the_title(); ?>”>
<?php the_title(); ?></a>,
<?php the_time(‘d M Y’); ?> in <?php the_category(‘&’);?>
</li>

<?php endwhile; else: ?>
<?php _e(‘Nessun post da questo autore.’); ?>

<?php endif; ?>
</ul>

<?php get_sidebar(); ?>
<?php get_footer(); ?>

Ho usato il codice php per recuperare le informazioni utili, i nomi sono intuitivi

Lascia un commento

Il tuo indirizzo email non sarĂ  pubblicato. I campi obbligatori sono contrassegnati *