Plugin Author
Brecht
(@brechtvds)
Hi Claudia,
If you make the “None found” text empty, nothing should show up if nothing is found. You can change that text in the sidebar when editing the block.
Great that works.
I implemented the shortcode by PHP (because the widgets were not working) and wrapped a div around it for styling reasons (as there is none from the plugin..)
function iw_related_posts() {
echo '<div class="related-posts">' . do_shortcode( '[custom-related-posts title="Beiträge aus dem Projekt" none_text=""]' ) . '</div>';
}
add_action('generate_before_right_sidebar_content','iw_related_posts', 10);
It would be perfect to set this into an if query, so that the div-wrap also doesn’t show up.
Any hint for that?
As a workaround, I remove the element by jquery if it’s empty.
Plugin Author
Brecht
(@brechtvds)
You could put the output of the do_shortcode function in a variable first and check if that’s empty before outputting the surrounding div.
Sure 😀
that’s the better solution, thanks for the tip