Hide widget if no posts
-
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://ww.wp.xz.cn/extend/plugins/advanced-featured-post-widget/
-
Hi there,
I have not much time at the moment. But I will give it a shot in the next couple of months.
Cheers
Awesomeosityness!
Done! 🙂
Ace! Thanks- will give this a crack soon!
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…
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
The topic ‘Hide widget if no posts’ is closed to new replies.