[Resolved] Crear widget artículos destacados

Home Forums Support [Resolved] Crear widget artículos destacados

Home Forums Support Crear widget artículos destacados

Viewing 15 posts - 1 through 15 (of 16 total)
  • Author
    Posts
  • #1325737
    Pedro

    Hola! Estoy usando WP Show Post para crear un widget de artículos destacados.

    Sin embargo, no sé por que razón el título de cada artículo aparece en negrita, cuando he especificado que es “p”

    Además, hay mucho espacio entre cada título.

    Me gustaría que se viera como Woorkup: https://mega.nz/file/X0lnVa6T#vu0IEZq0CLzuUG53JsaEoEimgvwyHlMlLtmRuR1E5oQ

    ¿Pueden ayudarme con esto?

    ¡Gracias!

    #1325846
    Leo
    Staff
    Customer Support

    Hi there,

    I believe you have this CSS added:

    .wp-show-posts-entry-title {
        font-weight: 600;
    }
    #1326429
    Pedro

    Hola Leo! Ese CSS lo agregué hace poco para la sección de artículos relacionados.

    Sin embargo el problema del espaciado y grosor de la sección de artículos destacados ya lo tenía hace tiempo (antes de añadir el CSS)

    ¿Puedes ayudarme por favor?

    #1326553
    Leo
    Staff
    Customer Support

    Can you remove that CSS and let me have a look?

    #1326603
    Pedro

    Hola Leo! Ya he eliminado ese CSS.

    #1326656
    Leo
    Staff
    Customer Support

    And the issue is fixed?
    https://www.screencast.com/t/qCCyPKj1lZ

    #1326676
    Pedro

    Hola Leo! Efectivamente el texto del widget ahora ya no aparece con negrita, pero sigue teniendo mucho espacio entre cada título.

    Además, se pierde la personalización que había hecho en la zona de artículos relacionados.

    #1326761
    Leo
    Staff
    Customer Support

    Try this CSS for the margin:

    .sidebar .wp-show-posts:not(.wp-show-posts-columns) .wp-show-posts-single:not(:last-child) {
        margin-bottom: 0.5em;
    }

    You will need to target the WPSP list in the related article you’ve added separately.

    #1327499
    Pedro

    Hola Leo! El código arregló el problema del espaciado.

    Sin embargo perdí la personalización que había hecho para los títulos de los artículos relacionados al final de la entrada.

    Quisiera que estos títulos tuvieran un grosor de 700.

    ¿Podrías ayudarme con esto?

    #1327557
    Leo
    Staff
    Customer Support

    There is no unique class in the related post WPSP list for me to target.

    Can you add class to the related post section?

    Then you can just target that class with the previous CSS.

    #1327575
    Pedro

    Hola Leo! El hook que estoy usando fue el que tomé del sitio:

    <h2>Te puede interesar...</h2>
    <?php
    if ( is_single() ) {
        $cats =  get_the_category();
        $cat = $cats[0];
    } else {
        $cat = get_category( get_query_var( 'cat' ) );
    }
    
    $cat_slug = $cat->slug;
    $list = get_page_by_title( 'articulos-relacionados', 'OBJECT', 'wp_show_posts' );
    wpsp_display( $list->ID, 'tax_term="' . $cat_slug . '"' );
    ?>

    ¿Podrías ayudarme a añadirle ese estilo CSS?

    #1327709
    Leo
    Staff
    Customer Support

    Can you change the code to this instead?

    <div class="wpsp-related">
    <h2>Te puede interesar...</h2>
    <?php
    if ( is_single() ) {
        $cats =  get_the_category();
        $cat = $cats[0];
    } else {
        $cat = get_category( get_query_var( 'cat' ) );
    }
    
    $cat_slug = $cat->slug;
    $list = get_page_by_title( 'articulos-relacionados', 'OBJECT', 'wp_show_posts' );
    wpsp_display( $list->ID, 'tax_term="' . $cat_slug . '"' );
    ?>
    </div>
    #1328934
    Pedro

    Hola Leo! Ya he modificado el hook.

    Ahora podrías contarme que CSS debería usar para la personalización?

    Quiero que tenga font-weight: 600 y text-decoration: underline (a:hover).

    ¡Muchas gracias!

    #1328937
    Leo
    Staff
    Customer Support

    Now you just have to make your previous CSS more specific like this:

    .wpsp-related .wp-show-posts-entry-title {
        font-weight: 600;
    }
    #1328956
    Pedro

    Hola Leo! Funcionó perfecto, muchas gracias!

    Una última cosa, que CSS podría usar para añadirle un margen superior a esa sección?

    Es que está demasiado cerca a la sección de compartir.

Viewing 15 posts - 1 through 15 (of 16 total)
  • You must be logged in to reply to this topic.