-
AuthorPosts
-
August 18, 2017 at 11:41 pm #841081
Hi i’m trying to get the date, author and excerpt in the magazine element, but I can’t find out how. I’ve seen some posts, but the codes that you guys have provided in those posts are outdated.
The magazine shows the date by default, but I want to add the author to that part. Also I want to show the excerpt under the title. Like 60 characters or something. (i’m sure I can modify that after you guys gave me the code)
Thanks!! I know my abi @Yigit can do this. hahah
Yours Faithfully, Abos
August 22, 2017 at 7:47 am #842342Hey Abosict,
Thank you for using Enfold.
Please add this code to display the author.
.av-magazine-text-sep, .av-magazine-author { display: inline; }
For the excerpt, edit the config-templatebuilder > avia-shortcodes > magazine.php file, look for this code around line 647:
if(empty($this->atts['thumbnails'])) { $image = ""; $extraClass = "av-magazine-no-thumb"; }
Below, add this code:
$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, '');
Best regards,
IsmaelAugust 22, 2017 at 1:55 pm #842544Hi! Thanks Ismael! The css did the work, but the PHP did not. I don’t know If I’ve put it in the good position. Check the screenshot
August 23, 2017 at 7:50 am #842894Hi,
It looks correct. Could you please provide a link to the page where you’re testing this? Provide the login details as well.
Best regards,
IsmaelAugust 24, 2017 at 1:32 pm #843473This reply has been marked as private.August 25, 2017 at 9:45 am #843817Hi,
Thank you for the info.
Please look for this code.
if($excerpt)$output .= "<div class='av-magazine-content entry-content' {$markupContent}>{$excerpt}</div>"; $output .= "</div>";
Replace it with:
$output .= "<div class='av-magazine-content entry-content' {$markupContent}>{$excerpt}</div>"; $output .= "</div>";
Best regards,
IsmaelAugust 26, 2017 at 3:00 am #844261I replaced it, but no luck.
August 26, 2017 at 6:14 am #844292Hey!
Are you using the advance layout builder for the posts content? If you are, edit the posts then specify the excerpt manually. Please post the FTP details here and we’ll check it.
Best regards,
IsmaelAugust 28, 2017 at 3:37 am #844612Hi! I did try manually adding a excerpt. It doesn’t show up.
August 28, 2017 at 7:15 am #844692Hi,
We added the modification. Remove browser cache or hard refresh before checking the page.
Best regards,
IsmaelAugust 28, 2017 at 10:02 am #844741Thanks it works, but can you explain what you did? And how can I shorten the length of the excerpt?
August 29, 2017 at 6:28 am #845202Hi!
I did the suggestions above. For the excerpt, use the “excerpt_length” filter.
function custom_excerpt_length( $length ) { return 20; } add_filter( 'excerpt_length', 'custom_excerpt_length', 999 );
Cheers!
IsmaelSeptember 13, 2017 at 9:45 pm #851731Hello,
I am having a similar issue to Abosict. I’ve added the code to magazine.php and the excerpts aren’t displaying on my magazine layout. Ideally we would like to have magazine.php in our child them, but I’m trying to get the excerpt to appear first and then I’ll follow your recommendations in http://kriesi.at/documentation/enfold/add-new-or-replace-advanced-layout-builder-elements-from-child-theme/.
Would you be able to take a look?
September 14, 2017 at 8:57 am #851912Hi!
We have provided the necessary modification in the following replies.
// https://kriesi.at/support/topic/date-author-and-excerpt-in-magazine-element/#post-842342
// https://kriesi.at/support/topic/date-author-and-excerpt-in-magazine-element/#post-843817Related thread: https://kriesi.at/support/topic/magazine-excerpt-2
Regards,
IsmaelJuly 24, 2018 at 8:12 pm #989338I’m following this advice and I have everything working, but where do I place the excerpt length function to make it work?Every place I’ve pasted it in the php file just causes the page that the magazine element is on to be stuck with the loading circle – and never loads.Any help would be appreciated!NEVERMIND. It was only showing a little because I didn’t have the excerpt in the blog post.
- This reply was modified 6 years, 5 months ago by fusiontechinc.
July 25, 2018 at 7:06 am #989506Hi fusiontechinc,
Thanks for the feedback. Please let us know if you should need any further help on the topic.
Best regards,
RikardJuly 25, 2018 at 7:34 am #989520July 25, 2018 at 7:34 am #989522 -
AuthorPosts
- The topic ‘Date, author and excerpt in magazine element’ is closed to new replies.