General WordPress.org

Foro WordPress » WordPress » General WordPress.org

Thumbnail en sidebar (3 mensajes)

Acerca de este hilo

Tags

  1. enviado

    3.0
    Antiguedad: Nov 2009
    Mensajes: 29

    offline

    Publicado hace 2 años
    #

    Hola!

    Me gustaría mostrar un listado de post en mi sidebar y acompañarlos con un thumbnail. En mi index ya vienen acompañados de thumbnail redimensinado con el CSS de mi theme. Mi problema es que en el sidebar no se me redimensiona. Os pego el código:

    <a>" >< ?php dp_attachment_image($post- >ID, 'thumbnail', 'alt="' . $post- >post_title . '"'); ? ></a>
    <a>"
    >< ?php the_title(); ? ></a>

    Se refiere a esta función:

    # Displays post image attachment (sizes: thumbnail, medium, full)
    function dp_attachment_image($postid=0, $size='thumbnail', $attributes='') {
        if ($postid< 1) $postid = get_the_ID();
        if ($images = get_children(array(
            'post_parent' = > $postid,
            'post_type' = > 'attachment',
            'numberposts' = > 1,
            'post_mime_type' = > 'image',)))
            foreach($images as $image) {
                $attachment=wp_get_attachment_image_src($image- >ID, $size);
                ? ><img />" < ?php echo $attributes; ? > / >< ?php
            }
    }

    Y en el index tiene este CSS:

    #content .post img {
    border:3px solid #EFEFEF;
    float:left;
    margin:2px 8px 4px 0;
    width:94px;
    }

    Pensé que la solución pasaría por poner #sidebar .post img y esos u otros valores en el css, pero los omite y me muestra directamente un thumbnail de 150x150.

    ¿Cómo puedo solucionarlo? Gracias!

  2. José Conti

    5.0
    Antiguedad: Sep 2009
    Mensajes: 1.020

    offline

    Publicado hace 2 años
    #

    Como no sueles volver o responder y ya no se si leerás este.

    Solo te dire: Mira el css, implemetalo. Ahí esta el secreto.

    Me gustaría cambiar el mundo, pero no encuentro el código fuente.
  3. enviado

    3.0
    Antiguedad: Nov 2009
    Mensajes: 29

    offline

    Publicado hace 2 años
    #

    Muchas gracias por la respuesta. Siempre intento si consigo una solución autorresponderme por si le puede servir a algún forero, salvo en un par de ocasiones. Seguiré trabajando en el css.

Responder

Debes Identificarte para publicar.

Foro WordPress » WordPress » General WordPress.org