-
AuthorPosts
-
July 14, 2014 at 9:37 pm #291255
Hi, how can I display read more links in the portfolio grid under the text excerpts?
Thanks, Richard
July 15, 2014 at 5:22 am #291388Hey Richard!
Thank you for using the theme.
Please edit config-templatebuilder > avia-shortcodes > portfolio.php, find this code on line 471:
$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."</div>" : '';
Replace it with this:
$readmore = '<br /><a href="'.get_permalink($the_id).'" class="more-link">'.__('Read more','avia_framework').'<span class="more-link-arrow"> →</span></a></div>'; $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>" : '';
Best regards,
IsmaelJuly 15, 2014 at 11:43 am #291510Thanks Ismael,
What would be the best way for me to make this change, as I’m using a child theme, and would like to do it so I don’t touch the underlying Enfold theme?
Thanks, Richard
July 15, 2014 at 7:15 pm #291767This reply has been marked as private.July 15, 2014 at 8:57 pm #291820This reply has been marked as private.July 17, 2014 at 12:06 pm #292408Please, is there a way to add ‘read more’ links under portfolio grid items without breaking the layout?
Thanks, Richard
July 17, 2014 at 2:40 pm #292489This is the modified section of portfolio.php with your suggested change to add the ‘read more’ link. Something is breaking the portfolio items in the portfolio grid when adding this modification:
if(!empty($title))
{
$markup = avia_markup_helper(array(‘context’ => ‘entry_title’,’echo’=>false, ‘id’=>$the_id, ‘custom_markup’=>$custom_markup));
$output .= ‘<header class=”entry-content-header”>’;
$output .= “<h3 class=’grid-entry-title entry-title’ $markup>“.$title.”</h3>”;
$output .= ‘</header>’;
}
$readmore = ‘<br />‘.__(‘Read more’,’avia_framework’).'<span class=”more-link-arrow”> →</span></div>’;
$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>” : ”;
$output .= !empty($title) || !empty($excerpt) ? “</div>” : ”;
$output .= ‘<footer class=”entry-footer”></footer>’;
$output .= “</article>”;
$output .= “</div>”;July 17, 2014 at 3:03 pm #292494Hey Richard!
Can we see how it looks when you add the code Ismael provided?
Cheers!
YigitJuly 17, 2014 at 3:11 pm #292501This reply has been marked as private.July 17, 2014 at 3:17 pm #292507This reply has been marked as private.July 17, 2014 at 3:34 pm #292511Hey!
Do you mind creating a temporary admin login and posting it here privately? I cannot reproduce the same issue on my local insallation and seems like custom CSS will not help.
Regards,
YigitJuly 17, 2014 at 3:54 pm #292518This reply has been marked as private.July 18, 2014 at 6:12 am #292833Hi!
Thank you for the update.
I made a mistake of adding a closing div. Please use this instead:
$readmore = '<br /><a href="'.get_permalink($the_id).'" class="more-link">'.__('Read more','avia_framework').'<span class="more-link-arrow"> →</span></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>" : '';
Best regards,
IsmaelJuly 18, 2014 at 11:23 am #292903This is great!
How can I add an additional line of space between the excerpt text and ‘Read more’?
Also, how can I change ‘Read more’ to ‘read more’ and remove the arrow?
Thanks, Richard
BTW, you guys rock! And I’m recommending Enfold to all my colleagues
July 18, 2014 at 12:21 pm #292916Hey!
Please change the code Ismael posted to following one
` $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>" : ''; `
Best regards,
YigitJuly 18, 2014 at 12:26 pm #292920That’s fantastic, thanks Yigit
July 18, 2014 at 12:29 pm #292922 -
AuthorPosts
- The topic ‘read more link in portfolio grid’ is closed to new replies.