Tagged: 

Viewing 26 posts - 1 through 26 (of 26 total)
  • Author
    Posts
  • #1247062

    Hello

    How to add the author meta to the blog grid layout so the author’s name will appear.

    Now, I have check the setting to show author meta, but it can’t display in grid layout

    #1247122

    Hey yundian,

    Please have a look at the following thread:
    https://kriesi.at/support/topic/add-author-to-blog-grid-layout/

    If you need further assistance please let us know.

    Best regards,
    Victoria

    #1247217

    I have read the thread before this post, it is old Enfold, and can’t find the code as that thread said.

    Please give me a answer base on Enfold 4.5.

    #1247220

    That thread said: Edit the config-templatebuilder > avia-shortcodes > postslider.php file, look for this code around line 498:
    $meta .= “<time class=’slide-meta-time updated’ $markup>” .get_the_time(get_option(‘date_format’), $the_id).”</time>”;

    But I can’t find the code in postslider.php in Enfold 4.5

    #1247222

    please check

    #1247238

    Already find the code thread said in line 630, but it don’t work any more, author still can’t appear, have clear all cache…

    #1247333

    Hi yundian,

    We strongly recommend updating the theme to the latest versions and then making your changes in the child theme.

    If you need further assistance please let us know.
    Best regards,
    Victoria

    #1247504

    Hi, have update latest Enfold, and use the code as that thread said:

    $author = get_the_author_meta( ‘display_name’, $entry->post_author );

    but it still not working, please check the problem

    #1248074

    Hi,

    Thank you for the update.

    Did you add an excerpt to the post? It is possible that the author meta or the post meta info don’t display because the post has no excerpt or summary. The time info is located around line 898:

    $meta .= "<time class='slide-meta-time updated' $markup>" . get_the_time( get_option( 'date_format' ), $the_id ) . '</time>';
    

    Best regards,
    Ismael

    #1248292

    Yes, I have open the function of Enfold in Blog layout to show the author, and all posts have excerpt.

    I added the code:

    $author = get_the_author_meta( ‘display_name’, $entry->post_author );

    below the code:

    $meta .= “<time class=’slide-meta-time updated’ $markup>” .get_the_time(get_option(‘date_format’), $the_id).”</time>”;

    I didn’t change any original code of latest Enfold, but above code didn’t work, author still not display in blog grid layout

    • This reply was modified 1 year, 2 months ago by  yundian.
    #1248917

    Hi,

    Thank you for the update.

    To actually render the value of the $author, we have to add this code below it.

    
    $meta .= "<span class='slide-meta-author updated'>" .$author."</span>";
    

    Best regards,
    Ismael

    #1249304

    I have try add $meta .= “<span class=’slide-meta-author updated’>” .$author.”</span>”;

    below:

    $author = get_the_author_meta( ‘display_name’, $entry->post_author );

    but still not display author

    #1249427

    Hi yundian,

    Please make a screenshot of the file with code added.

    Best regards,
    Victoria

    #1249560

    please check

    #1249561
    #1250049

    Hi yundian,

    I added the code:
    Image 2020-10-02 at 14.19.07.png

    and the author name showed up
    Image 2020-10-02 at 14.19.24.png

    Please copy the code from here:

    
    	$author = get_the_author_meta( 'display_name', $entry->post_author );
    	$meta .= "<span class='slide-meta-author updated'>" . $author."</span>";
    

    Please pay attention to the quotes, they should be like this:

    '

    not what you have above

    Best regards,
    Victoria

    #1250231

    Thanks, the new code work as you said, but the author is too close to the data, how could it display as below:

    0 comments / May 11, 2015 / By Vic

    #1250416

    Hi yundian!

    Please use this line:
    $meta .= "<span class='slide-meta-author updated'> / " . $author."</span>";

    If you need further assistance please let us know.
    Best regards,
    Victoria

    #1328700

    I need to show the authors instead of the dates in the blog grid on my client’s site: https://newissue.wpengine.com/weekly-content/blog/, and I got this to work for me by replacing the time lines on 927-928 with:

    $author = get_the_author_meta( 'display_name', $entry->post_author );
    $meta .= "<span class='slide-meta-author updated'>" . $author."</span>";

    So, thank you, but is there any way this could be handled via the child theme?

    #1328896

    Hi,
    if you made the change to config-templatebuilder > avia-shortcodes > postslider > postslider.php
    then create a directory in your child theme shortcodes and copy your edited file there: postslider > postslider.php
    and ensure your child theme functions.php has this function

    function avia_include_shortcode_template( $paths )
    {
    	if( ! is_array( $paths ) )
    	{
    		$paths = array();
    	}
    	
    	$template_url = get_stylesheet_directory();
    	array_unshift( $paths, $template_url . '/shortcodes/' );
    
    	return $paths;
    }
    
    add_filter( 'avia_load_shortcodes', 'avia_include_shortcode_template', 15, 1 );

    per our documentation

    Best regards,
    Mike

    #1328909

    Thanks, Mike, but putting the whole edited file in the child theme doesn’t seem like such a great solution, to me — I wouldn’t want to miss out on other updates to that file, as the theme is updated — know what I mean?

    #1329490

    Hi,

    I am afraid it is currently only possible by modifying postslider.php file on your child theme. I have forwarded your request to our devs and asked if we could add a filter or option in upcoming versions and shared this thread as reference. We will update you here :)

    Best regards,
    Yigit

    #1329631

    Fair enough — thanks, Yigit!

    #1329726

    Hi,

    Our devs added “avf_post_slider_meta_content” filter and it will be available in upcoming version :)

    Best regards,
    Yigit

    #1329746

    Awesome! So, when the next version is released, I should look for the filter somewhere around here? https://kriesi.at/documentation/enfold/blog-post/#post-with-meta-data-below-title — is that the best way to find the new filter?

    #1330501

    Hi,

    Sorry for my late reply!

    I just added a snippet here – https://github.com/KriesiMedia/enfold-library/blob/master/actions%20and%20filters/ALB%20Elements/Blog%20Posts/avf_post_slider_meta_content.php so you can simply copy & paste it to the bottom of functions.php file of your child theme.

    If you would like to give it a try, please replace the content of /enfold/config-templatebuilder/avia-shortcodes/postslider/postslider.php file with – https://pastebin.com/tu8WN6z0 :)

    Best regards,
    Yigit

Viewing 26 posts - 1 through 26 (of 26 total)

You must be logged in to reply to this topic.