-
AuthorPosts
-
August 30, 2014 at 8:52 pm #311377
Hey there,
I would like to add a “Read More” or “Continue Reading” link to the end of my magazine posts’ excerpts. Is this possible?
Thanks!
September 1, 2014 at 8:13 am #311683Hey Ti7V!
Thank you for using Enfold.
The excerpt for small magazine entries is hidden by default because there’s not enough space to accommodate them. If you really want to display it, you can edit config-templatebuilder > avia-shortcodes > magazine.php, find this code on line 558:
if(empty($this->atts['thumbnails'])) { $image = ""; $extraClass = "av-magazine-no-thumb"; }
Below, add this:
`$excerpt = !empty($entry->post_excerpt) ? $entry->post_excerpt : avia_backend_truncate($entry->post_content, apply_filters( ‘avf_magazine_excerpt_length’ , 10) , apply_filters( ‘avf_magazine_excerpt_delimiter’ , ” “), “…”, true, ”);
}`Regards,
IsmaelSeptember 2, 2014 at 11:25 pm #312550How would I successfully recreate this using a child theme?
Would I add magazine.php to ‘enfold-child’, then just add this new code below <?php?
Or must I use both of the codes you provided above? Or do I copy the entire magazine.php to ‘efnold-child’? I tried this with functions.php using the live preview and received a fatal error message.
Please excuse me, for I am new to this and just learning how to use the child theme.
Thanks!
September 2, 2014 at 11:29 pm #312552Also, is there any way to adjust the position of the ‘Read more’ link?
September 3, 2014 at 3:34 pm #312936Hey!
Please copy magazine.php file inside config-templatebuilder > avia-shortcodes in your child theme and then add following code to Functions.php file of your child theme in Appearance > Editor
require_once( 'config-templatebuilder/avia-shortcodes/magazine.php' );
Please add following code to Quick CSS in Enfold theme options under General Styling tab
.read-more-link { text-align: center; }
Cheers!
YigitSeptember 3, 2014 at 6:05 pm #313037Ok, Yigit.
Do I need to include:
global $avia_config; $avia_config[‘use_child_theme_functions_only’] = true;
? Or is that not recommended?
Cheers!
September 3, 2014 at 6:52 pm #313065When I use the config function in my child theme, I get a fatal error message.
Right now, I have nothing but <?php in my child functions.php. What do I need to have in there so that is corresponds with the parent?
September 3, 2014 at 9:50 pm #313108Also, is there a way to position the ‘Read more’ link immediately following the excerpt content?
September 6, 2014 at 1:42 am #314234Hi!
Try modifying the line 577 instead of adding another one below it, line should be like this 577:
if($excerpt)$output .= "<div class='av-magazine-content entry-content' {$markupContent}>{$excerpt}<a href='".get_permalink($entry->ID)."' class='more-link'>".__('Read more','avia_framework')."<span class='more-link-arrow'>→</span></a></div>";
Regarding putting modified shortcodes in your child theme, refer to this article:
http://kriesi.at/documentation/enfold/add-new-or-replace-advanced-layout-builder-elements-from-child-theme/Cheers!
JosueDecember 18, 2014 at 6:03 pm #370114Hi.
Your previous feedback was a big help to me.
I am using the magazine element, with the main story being the larger story above the others.
But the others still do not have an excerpt below them.
Any way I can get this?
Thanks in advance.Darran
December 18, 2014 at 11:18 pm #370279Hey!
@darranreadman: Can you please provide a link to the page with the magazine element? We would like to check it.Cheers!
IsmaelJanuary 13, 2015 at 9:37 pm #379131I’m having the same issue… I’ve done the things Ismael recomended, and all I’ve got is a “Read More” below every post… Still no Excerpt, except on the “first_big” one.
So, adding this:
$output .= "<div class='read-more-link'><a href='".get_permalink($entry->ID)."' class='more-link'>".__('Read more','avia_framework')."<span class='more-link-arrow'>→</span></a></div>";
After this:
if($excerpt)$output .= "<div class='av-magazine-content entry-content' {$markupContent}>{$excerpt}</div>";
Will only show us “Read More”, not excerpts.
January 14, 2015 at 6:05 pm #379608Hi @scaico,
Can you post the link to your website please? a temporary admin account would be helpful too.
Regards,
JosueJanuary 25, 2015 at 1:43 am #385031This addition to the Functions.php breaks the theme:
require_once( ‘config-templatebuilder/avia-shortcodes/magazine.php’ );
My complete Functions.php in child theme is (without the dividers):
——————————
<?phpfunction remove_avia_search(){
remove_filter( ‘wp_nav_menu_items’, ‘avia_append_search_nav’, 10, 2 );
}
add_action( ‘init’ , ‘remove_avia_search’ );add_theme_support(‘avia_template_builder_custom_css’);
add_filter(‘avf_logo_subtext’, ‘kriesi_logo_addition’);
function kriesi_logo_addition($sub) {
$sub .= “Celebrating 30 years of protection and conservation<br />of the majestic American Bald Eagle!”;
return $sub;
}require_once( ‘config-templatebuilder/avia-shortcodes/magazine.php’ );
——————————
I’m using enfold 3.0.5 and the edit to the magazine.php code is actually on line 587. Editing that line with your code does nothing.
- This reply was modified 9 years, 11 months ago by scarlettr8.
January 27, 2015 at 6:05 am #385997Hey!
Refer to this article on how to embed a modified ALB element via child theme:
http://kriesi.at/documentation/enfold/add-new-or-replace-advanced-layout-builder-elements-from-child-theme/Cheers!
JosueApril 6, 2015 at 7:16 pm #424148Hi!
same problem: changing / adding the code at line 577 still only shows “Read More”, but not the content of the excerpt itself.I think because above in the magazine.php the $excerpt is not defined
$excerpt = "";
and some lines below, if ($style == ‘small’) it will remain empty.Right? Any solution? (’cause I’m not the greatest coder and wont’t play domino… :-)
Cheers,
YetiApril 6, 2015 at 7:31 pm #424168Hey @Yeti!
Do you have an excerpt defined in each Post?
Best regards,
JosueApril 6, 2015 at 8:25 pm #424213Hi Josue!
Yes. And in my case it concerns to the portfolio entries. For the > Layout Builder > Content Elements > Magazine > Portfolio entries an option to show their excerpts would be more than nice. For all and not only for the first/top shown bigger. But for them, the ($style == ‘small’) will remain empty I think.
All the best,
YetiApril 6, 2015 at 8:51 pm #424232Can you please create us a WordPress administrator account? post it here as a private reply.
Regards,
JosueApril 15, 2015 at 10:46 am #428784This reply has been marked as private.April 15, 2015 at 6:09 pm #429120Hey!
I didn’t note a magazine.php in your child theme, have you already did this step?
Cheers!
JosueApril 16, 2015 at 1:42 pm #429584Hey,
for first I wanted to try it in the original magazin.php at
[wordpress-path]/ourcontent/themes/enfold/config-templatebuilder/avia-shortcodes
and only if it works, I wanted to put it in the child theme.And yes, I already tried that step, but it has no effect – no excerpts are pulled and shown.
Even when I change the “if($excerpt)$output” to “$output”, it shows only the Read more link but no excerpt.All the best
YetiApril 16, 2015 at 7:36 pm #429843Hi,
Can you please create me a temporary FTP account? post it here as a private reply.
Regards,
JosueApril 16, 2015 at 9:30 pm #429914This reply has been marked as private.April 16, 2015 at 9:37 pm #429920This reply has been marked as private.April 16, 2015 at 11:17 pm #429968Check it, i modified magazine.php on your child theme.
Best regards,
JosueApril 17, 2015 at 11:14 am #430231Hi Josue,
thanks for your work. But the new magazine.php doesn’t pull the excerpt out of the portfolio post – now there is only a standard text issued: “This is a Page excerpt. It will be displayed for search results”.This is more confusing, because in the footer in the first widget on the left under “Produkt-News”, there are the same three portfolio posts – with their excerpts.
Best regards,
YetiApril 17, 2015 at 10:44 pm #430645Yeah i noted that. Check it now please.
Cheers!
JosueApril 20, 2015 at 7:48 pm #431546Yeah! Thanx a lot, Josue. Works perfectly.
Greets,
YetiApril 21, 2015 at 12:07 am #431674You are welcome, glad to help :)
Regards,
Josue -
AuthorPosts
- You must be logged in to reply to this topic.