This topic is: not resolved

This topic contains 7 replies, has 3 voices, and was last updated by  Eleonorebridge 2 years, 4 months ago.

Problem with article meta description & shortcode

  • Post count: 17

    hi

    I’m using a shortcode on this page http://www.leblogdelamechante.fr/organiser-sa-vie/
    to display all articles from a category

    They all display an image, title, meta & description or beggining of the article + a “read more” button.

    I have a problem with articles with a description filled, they don’t display the “read more” button

    How can I fix this ?

    Thorgan
    Post count: 4526

    hi, yes the button wont appear if you use custom excerpt (description) in your post. if you want to enable it, im afraid for now you will need to delete your custom description from the excerpt metabox.

    let me know how it goes.

    Post count: 17

    Why is it like that ? It makes no sense..
    Description is used for seo purpose so I won’t remove it

    Is there a way to change it in functions.php file ?

    Cakra
    Post count: 4337

    Hi,

    Please try add these custom code into yout functions.php to make the read more button keep displaying even if you use custom excerpt.

    function new_excerpt_more($more) {
        return '';
    }
    add_filter('excerpt_more', 'new_excerpt_more', 21 );
    
    function the_excerpt_more_link( $excerpt ){
        $post = get_post();
        $excerpt .= '<a class="df-link-excerpt" href="'. get_permalink($post->ID) . '">Lire la suite</a>.';
        return $excerpt;
    }
    add_filter( 'the_excerpt', 'the_excerpt_more_link', 21 );
    

    Let me know how it goes.

    Post count: 17

    It works fine thanks !

    Post count: 17

    Do you have any idea of how I could make images clickable through functions.php on those shortcodes (http://www.leblogdelamechante.fr/organiser-sa-vie/#content) or in the “you may also like” ?

    Cakra
    Post count: 4337

    Hi,

    Please try use these custom css to make the images clickable:

    .df-port-image .mask-table-cell a {
    width: 92%;
    height: 40%;
    display: block;
    position: absolute;
    top: 0;
    }
    

    Let me know how it goes.

    Post count: 17

    This is awesome thank you so much !

The forum ‘Loma’ is closed to new topics and replies.