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
Hey 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,
Ismael
Thank 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
Hi,
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,
Rikard
Thanks Rikard, you can close the the topic.