Tagged: author, CSS, display, post slider
-
AuthorPosts
-
September 27, 2020 at 3:23 pm #1248790
Hi,
the post slider does not allow for a selection of displaying author names in a multi-author blog environment. This is unfortunate and should be implemented in one of the next updates.I tried all kind of css modifications to get the blog author into the header of a post slider UNDERNEATH the blog title.
I have already SUCCESSFULLY implemented this for post full view in loop.index.php using:
echo '<div class="blog-author-mn minor-meta">'.__('by','avia_framework')." "; the_author_posts_link(); echo "</div>";
The css for .blog-author-mn is also defined.
Could you please support me with a css suggestion to display also in the blog post preview in the slider under the title? I just don’t seem to find the right arguments.
Thank you and best
Michael- This topic was modified 4 years, 1 month ago by MichaelNickel.
September 27, 2020 at 7:10 pm #1248854Hey MichaelNickel,
Could you please attach a mockup of what you’re trying to achieve?
Could you please give us a link to your website, we need more context to be able to help you.
Best regards,
VictoriaSeptember 27, 2020 at 7:24 pm #1248862Hi Victoria,
thanks for your quick response, please find some private information below.
Best
MichaelSeptember 29, 2020 at 10:37 am #1249308Hi Enfold-team,
I’m still looking for a solution. If you could tell me which php file is controlling the layout of the post slider, I can probably tweak it myself in a way similar to what I have done for the general post layout through the code above which I added to loop-index.php.
So far, I have not found the right php file for the post slider and the documentation here does not give any specificity on the php file and/or path for the files which define the slider.
My suggestion is still that in a future update you add the option of “multi-author blog” -> “display title & author” AND “display title, author & excerpt” to the drop down menu of the layout setting within the avia layout builder.
Any hints are appreciated very much.
Thank you
MichaelSeptember 29, 2020 at 11:29 am #1249324Hi Michael,
The post slider file is
/config-templatebuilder/avia-shortcodes/postslider/postslider.phpYou can try the code shared here:
If you need further assistance please let us know.
Best regards,
VictoriaSeptember 29, 2020 at 12:42 pm #1249357Hi Victoria,
I followed the post you linked to and the secondary post inside there.
I found the relevant reference code in line 898 and added afterwards the following code:// Author in Post Slider MN BEGIN $author = get_the_author_meta( 'display_name', $entry->post_author ); $author_link = get_the_author_meta( 'user_url', $entry->post_author ); if(!empty($author)) { $meta .= '<div class="slide-meta-del">/</div><span class="blog-author minor-meta">'; $meta .= '<a href="'.$author_link.'">'.$author.'</a>'; $meta .= '</span>'; } $meta .= $author; // Author in Post Slider MN ENDE
I created the relevant php file in my enfold-child subfolder according to the original path, i.e. enfold-child/config-templatebuilder/avia-shortcodes/postslider
It does not work, anyway.
Since there are several if-cases in relation to blog style I have moved the code block around. It does not change a thing.
I also tried the code I used to display authors in the masonry (see code in initial post above), without any success.My blog styling is “elegant” if that helps to define the right position for the code.
Any suggestions on code changes how to display the author underneath the title?
September 29, 2020 at 2:19 pm #1249394Ok, I got it working.
However, only after I modified the php file in the enfold parent theme directories. It does not work if I copy these files to the enfold-child.
Any idea why that is? It works for the mansonry_gallery files to use modifications in the enfold-child …
I would love not to loose these changes with the next enfold updates …September 30, 2020 at 2:48 pm #1249661Hi MichaelNickel,
Here is the code you can put in your funtions.php
add_filter('avia_load_shortcodes', 'avia_include_shortcode_template', 15, 1); function avia_include_shortcode_template($paths){ $template_url = get_stylesheet_directory(); array_unshift($paths, $template_url.'/shortcodes/'); return $paths; }
And then you can make changes in the files that you added to the child theme.
If you need further assistance please let us know.
Best regards,
Victoria -
AuthorPosts
- You must be logged in to reply to this topic.