Tagged: ,

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #593565

    Hello,

    My customer has opted for the Grid Blog layout and would like to display Title + Excerpt + Read More text for each post.

    On the home page we are using the “blog post” component with the layout builder. It works fine.
    http://www.berangere-test.fr/ (see at the bottom of the page)

    On archive pages, the Read More text is not displayed. (with the standard blog layout, it is)
    http://www.berangere-test.fr/thematique/secourisme/

    Is there a way to have the Read More text there ? I have searched the forum and docs but have not found anything.

    Thanks,

    Bérangère

    • This topic was modified 8 years, 3 months ago by caudebert.
    #594298

    Hi caudebert!

    After you drag the “blog post” element from the content elements. please use the suitable “Read more” option in the define blog grid layout option.

    Regards,
    Vinay Kashyap

    #594416

    Hi Vinnie,

    This solution is unfortunately not applicable to archive pages which are the ones that concern me.

    Those pages are built by the theme depending on the blog style selected in the theme options.
    > If the selected blog layout is other than “grid”, the “read more” text is displayed at the bottom of the excerpt.
    > If the selection layout is “grid”, it is not.

    So I was wondering whether you have a solution to display “read more” with grid layout, like this page
    http://www.berangere-test.fr/thematique/secourisme/

    Thanks

    Bérangère

    • This reply was modified 8 years, 3 months ago by caudebert.
    #597509

    Hey!

    Try adding this at the very end of your theme / child theme functions.php file:

    function change_blog_archive_style() {	
    	global $avia_config;
    	if(!is_single()){ $avia_config['blog_content'] = "excerpt_read_more"; }
    }
    add_action('get_header', 'change_blog_archive_style');
    

    Cheers!
    Josue

    #599088

    Hi Josue,

    I have done it but it does not work.
    Read More still does not show on category pages http://www.berangere-test.fr/thematique/secourisme/.
    I provide you an admin code if you want to check.

    Thanks
    Bérangère

    #599297

    Check it now, i modified archive.php, this part:

    $atts   = array(
        'type' => 'grid',
        'items' => get_option('posts_per_page'),
        'columns' => 3,
        'class' => 'avia-builder-el-no-sibling',
        'paginate' => 'yes',
        'use_main_query_pagination' => 'yes',
        'custom_query' => array( 'post__in'=>$post_ids, 'post_type'=>get_post_types() )
    );

    To:

    $atts   = array(
        'type' => 'grid',
        'items' => get_option('posts_per_page'),
        'columns' => 3,
        'contents' => 'excerpt_read_more',
        'class' => 'avia-builder-el-no-sibling',
        'paginate' => 'yes',
        'use_main_query_pagination' => 'yes',
        'custom_query' => array( 'post__in'=>$post_ids, 'post_type'=>get_post_types() )
    );

    You can move archive.php to your child theme if you want this modification to survive updates.

    #599562

    OK thanks a lot !
    Bérangère

    #600108

    Hi,

    Glad we could help :-)

    Best regards,
    Rikard

    #732158

    Please close,
    Bérangère

    #732476

    Hi,

    Thanks for letting us know, please open a new thread if you should have any further questions or problems.

    Best regards,
    Rikard

Viewing 10 posts - 1 through 10 (of 10 total)
  • The topic ‘Add Read More text on Grid blog archive page ?’ is closed to new replies.