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

    Hi,

    I’m trying to add a read more button under the portfolio gird’s title. I’ve browsed through the forum & found one thread below:-
    https://kriesi.at/support/topic/read-more-link-in-portfolio-grid/

    Unfortunately, the answers in the thread looks like not working under my version. Here’s the code I’ve inserted on config-templatebuilder/avia-shortcodes/portfolio.php line 638

    $readmore = '<br /><br /><a href="'.get_permalink($the_id).'" class="more-link">'.__('read more','avia_framework').'</a>';
    					$output .= !empty($excerpt) ? "<div class='grid-entry-excerpt entry-content' ".avia_markup_helper(array('context'=>'entry_content','echo'=>false, 'id'=>$the_id, 'custom_markup'=>$custom_markup)).">".$excerpt.$readmore."</div>" : '';
    #980882

    Hey myproduct,

    Thank you for using Enfold.

    That file has been updated, so the previous modification may not work properly. Please replace the modification with this one.

    $readmore = '<a href="'.get_permalink($the_id).'" class="more-link">'.__('read more','avia_framework').'</a>';
                            $output .= "<div class='grid-entry-excerpt entry-content' $markup>".$readmore."<br /><br />".$excerpt."</div>";
    

    Best regards,
    Ismael

    #980899

    Hi Ismael,

    It worked well. Thanks for the help!

    #981127

    Hi,

    Great, glad you got it working. Please let us know if you should need any further help on the topic or if we can close it.

    Best regards,
    Rikard

    #1038207

    Hello – is it possible to add this script to a child theme?

    #1040053

    Hi,

    Yes, you need to load the file from a child theme and then modify it from there.
    Here how to load ALB elements from child theme:
    https://kriesi.at/documentation/enfold/intro-to-advanced-layout-builder/#add-elements-to-alb

    Best regards,
    Basilis

    #1040396

    thanks!

    #1040525

    Hey kristenangel,

    If you need additional help, please let us know here in the forums.

    Best regards,
    Jordan Shannon

    #1194549

    hello

    I have a similar problem as the posters related and read several topics on this issue but none seem to work.

    I have a portfolio grid and have disabled the click to a related grid item’s entry page (the portfolio entry page) as I do not need that since 90% of my grid items have no other content than the excerpt. I used this code in the child functions.php file::

    add_filter(‘avf_portfolio_cpt_args’, ‘avf_portfolio_cpt_args_mod’);
    function avf_portfolio_cpt_args_mod($args) {
    $args[‘exclude_from_search’] = true;
    return $args;
    }

    However, a few have do have other content, so for those I’d like to add an actual Read more link after the grid item’s excerpt that opens the portfolio entry page for that item. I can’t get it to work. Can you please help?

    Thank you

    #1195653

    Hi,

    You should be able to check if the $excerpt contains anything or if it’s empty. Try to replace the code above with this one:

    $readmore = $excerpt ? '<a href="'.get_permalink($the_id).'" class="more-link">'.__('read more','avia_framework').'</a>' : '';
     $output .= "
    <div class='grid-entry-excerpt entry-content' $markup>".$readmore."
    
    ".$excerpt."</div>
    ";
    

    If it doesn’t work, please open a new thread and post the necessary details in the private field. We’ll close this one for now.

    Best regards,
    Ismael

Viewing 10 posts - 1 through 10 (of 10 total)
  • The topic ‘Portfolio Grid Add Read More Button’ is closed to new replies.