-
AuthorPosts
-
July 3, 2018 at 10:08 am #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>" : '';
July 4, 2018 at 3:43 am #980882Hey 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,
IsmaelJuly 4, 2018 at 4:42 am #980899Hi Ismael,
It worked well. Thanks for the help!
July 4, 2018 at 12:26 pm #981127Hi,
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,
RikardNovember 27, 2018 at 9:24 pm #1038207Hello – is it possible to add this script to a child theme?
December 2, 2018 at 10:22 pm #1040053Hi,
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-albBest regards,
BasilisDecember 3, 2018 at 5:07 pm #1040396thanks!
December 4, 2018 at 1:36 am #1040525Hey kristenangel,
If you need additional help, please let us know here in the forums.
Best regards,
Jordan ShannonMarch 19, 2020 at 7:24 pm #1194549hello
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
March 24, 2020 at 7:06 am #1195653Hi,
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 -
AuthorPosts
- The topic ‘Portfolio Grid Add Read More Button’ is closed to new replies.