Viewing 18 posts - 1 through 18 (of 18 total)
  • Author
    Posts
  • #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

    #842342

    Hey 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,
    Ismael

    #842544

    Hi! 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

    #842894

    Hi,

    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,
    Ismael

    #843473
    This reply has been marked as private.
    #843817

    Hi,

    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,
    Ismael

    #844261

    I replaced it, but no luck.

    #844292

    Hey!

    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,
    Ismael

    #844612

    Hi! I did try manually adding a excerpt. It doesn’t show up.

    #844692

    Hi,

    We added the modification. Remove browser cache or hard refresh before checking the page.

    Best regards,
    Ismael

    #844741

    Thanks it works, but can you explain what you did? And how can I shorten the length of the excerpt?

    #845202

    Hi!

    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!
    Ismael

    #851731

    Hello,

    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?

    #851912
    #989338

    I’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, 4 months ago by fusiontechinc.
    #989506

    Hi fusiontechinc,

    Thanks for the feedback. Please let us know if you should need any further help on the topic.

    Best regards,
    Rikard

    #989520

    Hi,

    Great! Glad it is fixed. :)

    Best regards,
    Ismael

    #989522

    Hi,

    Great! Glad it is fixed. :)

    Best regards,
    Ismael

Viewing 18 posts - 1 through 18 (of 18 total)
  • The topic ‘Date, author and excerpt in magazine element’ is closed to new replies.