<?php while ( have_posts() ) : the_post(); ?>
<section class="panel panel-white">
<div class="row single-post-content">
<?php if ($category_name !== 'Jobs') { ?>
<h5 class="author-post__title"><?php the_author() ?></h5>
<p><?php echo get_the_date(); ?></p>
<?php }
the_content();
if ($category_name !== 'Jobs') { ?>
<div class="row author-post">
<div class="small-12 medium-4 column">
<img src="https://stackoverflow.com/questions/40751664/<?php echo get_avatar(); ?>" alt="" />
</div>
<div class="small-12 medium-8 column">
<h5 class="author-post__title"><?php the_author() ?></h5>
<p>
Lorem Ipsum has been the industry's standard dummy text
ever since the 1500s, when an unknown printer took a
galley of type and scrambled it to make a type specimen
book. It has survived not only five centuries, but
also the leap into electronic typesetting, remaining
essentially unchanged. It was popularised in the 1960s
with the release of Letraset sheets containing.
</p>
</div>
</div>
<?php } ?>
</div>
</section>
<?php endwhile;?>
Estoy tratando de ver el avatar del autor que ha escrito la publicación. Pensé que eso haría que esto funcionara, pero no parece generar la URL correcta y me da un 404 en la imagen.
¿Qué métodos han hecho otras personas para extraer la imagen del avatar?
Estoy buscando una respuesta que me diga cómo hacer eso y si no hay una imagen para no mostrarla.
ACTUALIZAR:
He intentado hacer que esto funcione usando el siguiente código: Debo mencionar que también estoy tratando de hacer que esto funcione en mi máquina local.
echo get_avatar($authorId, 100);
(la variable utiliza get_the_author_id()
)
He agregado una actualización a mi pregunta.
–Max Lynn
22 de noviembre de 2016 a las 21:29