Skip to content
Advertisement

Need script to not run if user is logged in

Goal: To hide specific categories from showing in the post meta area

The below code achieves that (which is in the theme’s functions.php file):

JavaScript

However, it then hides all categories when editing, not just the specific categories mentioned above: missing categories screenshot

I need a solution so that the above code won’t run if someone is logged in; or add to the code so that the categories show up while editing.

Advertisement

Answer

I think u should run the filter only if it’s not on admin page:

JavaScript
User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement