Support » Plugin: Display Posts - Easy lists, grids, navigation, and more » Display nothing when user changes post category

  • Resolved martal

    (@martal)


    In the sidebar, I have a number of text widgets with a shortcut. For example:

    [display-posts category=”recent-news” include_author=”true” include_date=”true” date_format=”j F, Y” include_excerpt=”true” excerpt_more=”Read More” excerpt_more_link=”true” include_excerpt_dash=”false” excerpt_length=”15″ wrapper=”div”  wrapper_id=”recent-post” wrapper_class=”post-grid-layout”]

    If the user changes the category of the post from recent-news to ,say, archive-news, the post is not displayed, but what is left is an empty space and my background-color styling. (Widget titles are empty.)

    <aside id=”text-6” class=”widget widget_text”>
    <div class=”textwidget”> </div>
    </aside>

    How can I not display this? (I don’t want to break up the display with a ’no posts found’ type message.)

    There’s white space in the div so can’t use pseudo-selector empty.

Viewing 1 replies (of 1 total)
  • Plugin Author Bill Erickson

    (@billerickson)

    You could use a plugin like Widget Context or Widget Logic to only show the widget on certain pages.

Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.