WordPress.org

Ready to get started?Download WordPress

Forums

Advanced Featured Post Widget
[resolved] Hide widget if no posts (7 posts)

  1. mintynz
    Member
    Posted 1 year ago #

    Hi,

    It'd be great if the widget had an option to hide itself if the post chosen is either missing or draft.

    That way I can have users without great skills just turn a post to draft to hide it for when it's not needed, and then publish again when it should show.

    Many thanks.

    http://wordpress.org/extend/plugins/advanced-featured-post-widget/

  2. tepelstreel
    Member
    Plugin Author

    Posted 1 year ago #

    Hi there,

    I have not much time at the moment. But I will give it a shot in the next couple of months.

    Cheers

  3. mintynz
    Member
    Posted 1 year ago #

    Awesomeosityness!

  4. tepelstreel
    Member
    Plugin Author

    Posted 11 months ago #

    Done! :)

  5. mintynz
    Member
    Posted 11 months ago #

    Ace! Thanks- will give this a crack soon!

  6. mintynz
    Member
    Posted 11 months ago #

    Hmm. Just did a test, and making the post draft makes it disappear from the dropdown menu of post options. Also, with no posts to show, any custom styling applied in the section at the very bottom of the widget options still shows. I was thinking that the widget would just change to display:none.

    So I appreciate what you've put into it, but I'm not seeing the results with version 2.9.1...

  7. tepelstreel
    Member
    Plugin Author

    Posted 11 months ago #

    Hi there,

    making the post draft will always make it disappear from the dropdown, in deed. That has always been part of the deal; it only gets posts that have the post_status 'publish'.

    In the widget there is a loop that gets a post by it's ID. So it would show the post no matter, what status it has. That is also the reason, why the widget cannot disappear completely. The loop is inside the widget and can only prevent the post from appearing in the widget.

    Regards

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic