For many different reasons I was forced to deactivate the sticky posts function on WordPress. Still I need this function. This means that I need a workaround. I need to show a post on the top of the feed and I need it to be made as easily as possible for the user that is writing the post.
NOTE: I am using Visual Composer.
I thought that a workaround for this would be to add a new container via Visual Composer or a sidebar and call for a category. This new sidebar/container would then only be visible if there were any posts on that category. I have been searching for a function, query, plugin, etc to do this, but with no success.
I have found Featured Post Widget and Featured Category Widget but I don’t think that they are what I need.
Hook with
get_terms
will display a terms/category only when it has postsAdd this code in WP theme’s
functions.php
E.g (domain.com/wp-content/themes/yourThemeName/functions.php )
For ignore sticky posts on frontend set
ignore_sticky_posts
totrue
in main query