-
AuthorPosts
-
August 27, 2022 at 6:10 pm #1362947
Hi there
A couple of years ago, you very kindly supplied me with a code amendment that enabled Excerpts to display along with Titles for the Magazine element. It was a one-line code change to the file …
config-template-builder/avia-shortcodes/magazine/magazine.php
… and it worked a treat for v4.7.6.3
The site has now been upgraded to v5.1.1
I have made the same code change, but the page isn’t displaying the excerpts. Could you advise the amendment I’d need to make for it to work again?The change is at line 1284
…. unaltered code is — $style = ( $loop == 1 && ! empty( $this->config[‘first_big’] ) ) ? ‘big’ : ‘small’;
…. amended code is — $style = (!empty($this->atts[‘first_big’])) ? “big” : “small”;I was advised at the time that for this to work on the page the tick box in admin marked “Should the first entry be displayed bigger?” must ticked, and yes it is!
Many thanks
August 30, 2022 at 1:38 am #1363118Hey JaneJoyce,
Thank you for the inquiry.
In the magazine.php file, try to add this code around line 1503.
$excerpt = ! empty( $entry->post_excerpt ) ? $entry->post_excerpt : avia_backend_truncate( $entry->post_content, apply_filters( 'avf_magazine_excerpt_length', 60 ), apply_filters( 'avf_magazine_excerpt_delimiter', ' ' ), '…', true, '' );The excerpt only displays in the large entry because of this condition around line 1478.
if( $style == 'small' )Best regards,
IsmaelAugust 31, 2022 at 4:34 pm #1363381Thank you Ismael!
That line of code is already in magazine.php, so I moved down to line 1478 and changed ‘small’ to ‘big’ … and it worked!
So, a big thank once again.Jane
August 31, 2022 at 7:11 pm #1363398Hi,
Great, I’m glad that Ismael could help you out. Please let us know if you should need any further help on the topic, or if we can close it.
Best regards,
RikardSeptember 2, 2022 at 11:35 am #1363606Thanks Rikard, you can close the the topic.
September 2, 2022 at 2:15 pm #1363641 -
AuthorPosts
- The topic ‘Enabling excerpts for Magazine elements’ is closed to new replies.
