Trusted WordPress tutorials, when you need them most.
Beginner’s Guide to WordPress
Copa WPB
25 Million+
Websites using our plugins
16+
Years of WordPress experience
3000+
WordPress tutorials
by experts

Cómo mostrar imágenes redondas de Gravatar en WordPress

Nota editorial: Ganamos una comisión de los enlaces de socios en WPBeginner. Las comisiones no afectan a las opiniones o evaluaciones de nuestros editores. Más información sobre Proceso editorial.

Hace poco te enseñamos cómo dar estilo a la estructura / disposición / diseño / plantilla de tus comentarios y cómo dar estilo al formulario de comentarios. Uno de nuestros usuarios nos envió un correo electrónico y nos preguntó: “¿Cómo conseguisteis que las imágenes de gravatar fueran redondas? ¿Guardáis las imágenes de gravatar localmente para que sean redondas?”. En este artículo, le mostraremos cómo mostrar imágenes gravatar redondas en WordPress. Utilizaremos la propiedad border-radius de CSS3 para crear imágenes gravatar circulares.

Lo primero que tienes que hacer es editar el archivo style.css de tu tema. Puedes hacerlo usando un programa FTP o yendo a Apariencia ” Editor en tu administrador de WordPress. A continuación, debe añadir el siguiente código en su archivo CSS:

.avatar {
border-radius: 50%;
-moz-border-radius: 50%;
-webkit-border-radius: 50%;
}

Esto debería funcionar en la mayoría de los temas de WordPress. Sin embargo, si esto no funciona en su tema, entonces es probable que haya algún plugin o la función de su tema jugando con las clases por defecto utilizadas para gravatar en WordPress. Para averiguar qué clase css están usando las imágenes gravatar en tu tema, necesitas abrir una entrada de blog que tenga comentarios. Desplázate hasta la sección de comentarios y haz clic con el botón derecho en la imagen de gravatar para seleccionar Inspeccionar elemento. Se le mostrará el código fuente de su gravatar, como este:

Finding css class used by gravatar icon

Si la imagen de gravatar tiene algo distinto de avatar, utilícelo en lugar de .avatar en el código css anterior.

Esperamos que este artículo te haya ayudado a mostrar imágenes gravatar redondas en tu blog de WordPress. Háganos saber si usted tiene alguna pregunta o comentario dejando un comentario a continuación.

Descargo: Nuestro contenido está apoyado por los lectores. Esto significa que si hace clic en algunos de nuestros enlaces, podemos ganar una comisión. Vea cómo se financia WPBeginner , por qué es importante, y cómo puede apoyarnos. Aquí está nuestro proceso editorial .

Avatar

Editorial Staff at WPBeginner is a team of WordPress experts led by Syed Balkhi with over 16 years of experience in WordPress, Web Hosting, eCommerce, SEO, and Marketing. Started in 2009, WPBeginner is now the largest free WordPress resource site in the industry and is often referred to as the Wikipedia for WordPress.

El último kit de herramientas de WordPress

Obtenga acceso GRATUITO a nuestro kit de herramientas - una colección de productos y recursos relacionados con WordPress que todo profesional debería tener!

Reader Interactions

21 comentariosDeja una respuesta

  1. Syed Balkhi says

    Hey WPBeginner readers,
    Did you know you can win exciting prizes by commenting on WPBeginner?
    Every month, our top blog commenters will win HUGE rewards, including premium WordPress plugin licenses and cash prizes.
    You can get more details about the contest from here.
    Start sharing your thoughts below to stand a chance to win!

  2. Nataly says

    hello, It worked, thank you, but, the description appear to high. over the pic, do you know to make it appear at the side of the pic?

  3. Therese says

    I can’t make it work. :(
    I can’t figure out where exactly to put it, nothing seams to change. I’ve looked at the source code and it’s got avatar just like the example source code.

  4. Abdul Samad says

    Bro Thanks For This Code I’m New In WP and I really Enjoying Your Blog Man Thanks For THis And All Tutorials ….

  5. Richie says

    I was going to pass along this tip and of course tried it first on one of my sites.

    Worked like a champ I simply changed my CSS from px to % for the border moz and webkit.

    Here’s where it got interesting.

    I went to another site, did the same tweak and it didn’t work. After a little head scratching I remembered that I had the plugin WP User Avatar installed on the site that it worked on and didn’t have it installed on the site it didn’t work on.

    I installed the plugin and whalah, works like a champ.

    For both sites I’m using a custom theme built on the Presswork framework.

    Bottom line, I got it to work but only with the plugin.

    Any ideas?

  6. RW says

    Great tip. Please note that IE8 doesn’t natively render round corners (border-radius). You’d need to use javascript, pie, etc… for this but not worth the trouble. Luckily IE9 recognizes current standards…

    Thanks.

    • Jim Burnett says

      I remember the days we were trying to keep IE6 support in the loop. Not it’s IE 8 for rounded corners. Lucky us, IE9 is picking up.

      Then again, FF 3.0 doesn’t support any HTML 5. *sad face*

      Cool CSS trick though!

Deja tu comentario

Gracias por elegir dejar un comentario. Tenga en cuenta que todos los comentarios son moderados de acuerdo con nuestros política de comentarios, y su dirección de correo electrónico NO será publicada. Por favor, NO utilice palabras clave en el campo de nombre. Tengamos una conversación personal y significativa.