Tagged: grid layout
-
AuthorPosts
-
September 20, 2020 at 5:55 am #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
September 20, 2020 at 2:00 pm #1247122Hey 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,
VictoriaSeptember 21, 2020 at 3:31 am #1247217I 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.
September 21, 2020 at 3:39 am #1247220That 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
September 21, 2020 at 3:40 am #1247222please check
September 21, 2020 at 4:03 am #1247238Already find the code thread said in line 630, but it don’t work any more, author still can’t appear, have clear all cache…
September 21, 2020 at 1:45 pm #1247333Hi 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,
VictoriaSeptember 22, 2020 at 4:35 am #1247504Hi, 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
September 24, 2020 at 8:29 am #1248074Hi,
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,
IsmaelSeptember 25, 2020 at 4:25 am #1248292Yes, 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 4 years, 1 month ago by yundian.
September 28, 2020 at 5:40 am #1248917Hi,
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,
IsmaelSeptember 29, 2020 at 10:17 am #1249304I 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
September 29, 2020 at 4:54 pm #1249427Hi yundian,
Please make a screenshot of the file with code added.
Best regards,
VictoriaSeptember 30, 2020 at 5:22 am #1249560September 30, 2020 at 5:22 am #1249561October 2, 2020 at 1:21 pm #1250049Hi yundian,
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,
VictoriaOctober 3, 2020 at 4:45 am #1250231Thanks, 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
October 4, 2020 at 4:21 pm #1250416Hi 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,
VictoriaNovember 11, 2021 at 9:08 pm #1328700I 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?
November 13, 2021 at 10:23 pm #1328896Hi,
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 functionfunction 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 );
Best regards,
MikeNovember 14, 2021 at 7:41 am #1328909Thanks, 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?
November 18, 2021 at 12:16 pm #1329490Hi,
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,
YigitNovember 19, 2021 at 8:40 am #1329631Fair enough — thanks, Yigit!
November 19, 2021 at 5:26 pm #1329726Hi,
Our devs added “avf_post_slider_meta_content” filter and it will be available in upcoming version :)
Best regards,
YigitNovember 19, 2021 at 10:19 pm #1329746Awesome! 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?
November 25, 2021 at 4:35 pm #1330501Hi,
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,
YigitNovember 28, 2021 at 9:03 am #1330726Beautiful, Yigit — it works — thanks so much!! Now, any chance there might be something like that coming for the Magazine element? I just need to move the author line below the titles there (see https://prnt.sc/20xu1cl ). Thanks again!!
December 1, 2021 at 4:40 pm #1331183Hey,
You are welcome!
I have forwarded this request to our devs as well and shared this thread as reference. We will update you here :)
As a temporary solution, you can copy magazine.php file to your child theme and find following line
$output .= "<time class='av-magazine-time updated' {$markupTime}>".$time."</time>"; $output .= $author; $output .= $cats; $output .= $tags; $output .= "<{$titleTag} class='av-magazine-title entry-title {$titleCss}' {$markupTitle}>{$title}</{$titleTag}>";
and change it to following
$output .= "<{$titleTag} class='av-magazine-title entry-title {$titleCss}' {$markupTitle}>{$title}</{$titleTag}>"; $output .= "<time class='av-magazine-time updated' {$markupTime}>".$time."</time>"; $output .= $author; $output .= $cats; $output .= $tags;
Best regards,
YigitDecember 1, 2021 at 9:48 pm #1331229OK, thanks so much — I’ll keep that in mind.
December 2, 2021 at 4:58 pm #1331338Hey,
Our devs added “avf_magazine_header_content” filter which will be available in upcoming version.
If you would like to try it, please replace /enfold/config-templatebuilder/avia-shortcodes/magazine/magazine.php file with this one – https://pastebin.com/JWrCeQ1M and then add this code snippet to the bottom of Functions.php file of your child theme – https://github.com/KriesiMedia/enfold-library/blob/master/actions%20and%20filters/ALB%20Elements/Magazine/avf_magazine_header_content.php
Regards,
Yigit -
AuthorPosts
- The topic ‘Add author to blog grid layout / Enfold 4.5’ is closed to new replies.