Tagged: blogpost, empty, Entry, postslider
-
AuthorPosts
-
July 16, 2018 at 12:57 pm #985918
Hi Guys
I use the postslider element as a news container. The last entry will be shown. If there are no entries the slider should be invisible, but it always leaves a blank.<div class="slide-entry-excerpt entry-content" itemprop="text"> </div>
The difficulty is I have set background-color and padding to class .entry-content. So if there are no entries, I have an empty coloured box.
CSS-Style element :empty does not work, because of the blank. :blank is not supported yet.
Then I looked at the php file found here: config-templatebuilder/avia-shortcodes/postslider/postslider.php (Line 640)$output .= !empty($excerpt) ? "<div class='slide-entry-excerpt entry-content' $markup>".$excerpt."</div>" : "";
The code is absolutely correct for me and would solve my problem: the whole div including .entry-content wouldn’t be displayed. But for some reason it’s always there. I tried to replace “!empty($excerpt)” with “!isset($excerpt)” with the same result.
That means $excerpt is never empty, right? Do you have any solution for this?Thank you very much in advance
Martin- This topic was modified 6 years, 4 months ago by neue-zeiten.
July 18, 2018 at 3:46 am #986737Hey neue-zeiten,
Thank you for using Enfold.
Are you using the advance layout builder for the posts content? The $excerpt will never be empty unless the content is set to only display the title or the post has no content. Where can we see the issue? Please provide a screenshot using imgur or dropbox.
Best regards,
IsmaelJuly 18, 2018 at 10:06 am #986862Hi Ismael,
Thanks for your reply.
Of course I use your great layout builder. The content was set to “show title & excerpt” and title is invisible by CSS. I tried “only excerpt” too, but nothing changed. Please see the screenshot:
I have only 1 blogpost which I will delete (or set to draft) if there are no news. In my understanding $excerpt should be empty if there are no blogposts. Am I doing something wrong?In private I provide you admin access. Backend language switched to english.
For your understanding: page is “Home”, blog posts element is inside a color section below the slider element. Via -margin color section is over the slider.Best
MartinJuly 19, 2018 at 12:26 pm #987353Hi,
In my understanding $excerpt should be empty if there are no blogposts.
The $excerpt is going to be empty when the posts has no content or excerpt and when the layout is set to display only the title. It is also empty when the advance layout builder is used because all shortcodes will be stripped from the $post->post_content. Add an excerpt manually if you’re using the advance layout builder.
line 466
$prepare_excerpt = !empty($entry->post_excerpt) ? $entry->post_excerpt : avia_backend_truncate($entry->post_content, apply_filters( 'avf_postgrid_excerpt_length' , $excerpt_length) , apply_filters( 'avf_postgrid_excerpt_delimiter' , " "), "…", true, '');
line 494
case "title": $excerpt = ''; $title = $entry->post_title; break;
Best regards,
IsmaelJuly 19, 2018 at 3:06 pm #987437Thank you so much Ismael!
Thread can be closed.Best
MartinJuly 20, 2018 at 2:05 pm #987833 -
AuthorPosts
- You must be logged in to reply to this topic.