I ended up adding the class ‘ab-ads’ to all my widget areas.
if ( !is_super_admin() ) {
add_action('admin_print_styles-widgets.php', function() {
echo '<style type="text/css">div.sidebar-widgets-ab-ads { display:none; }</style>';
});
}
That way I just hide them for everyone that isn’t administrators.
Related Posts:
- Switching themes without losing widgets?
- can require “themefolder/includes/widgets.php” in “themefolder/functions.php” yet widgets.php doesn’t run
- Moving WordPress.com theme and widget settings to self-hosted site?
- Why are my widgets not saving when being added to a sidebar?
- Duplicate and change a Theme Widget
- Current theme broken – after server and domain migration
- Changing $before_widget for certain widgets
- adding multiple sidebars on pages
- Embedded Videos (PB) – Not Available
- Hide default “Recent Comments” Widget if there are no comments yet
- Widgets menu does not appear under “Appearance” in dashboard
- Calling widget via function in themes files (hard code)
- Inject widgets from one sidebar into another with PHP
- How to conditionally display widgetized areas in theme customizer?
- Add more widget areas to a theme
- Displaying a widget in sidebar only when no other widgets rendered?
- Style the archives/category sidebar widget via theme
- Modifying the markup in the Tag Cloud widget?
- How to override / customize existing Widgets?
- Widgets not showing on sidebars
- Using filter in the widget causes fatal error
- disable default widgets in Responsive theme
- What happened to my Inactive Widgets?
- In a specific blog, the K2 theme does not have a Text Widget
- Removing a widget via theme editor
- sidebar in 2020 theme as a widget
- How to customize a section of a widget only on certain pages or page
- Changing theme folder name disrupts widgets
- No “available widgets” (wordpress 3.2.1 multisite)
- How can I allow the Editor Role to change Theme Settings?
- How to Link External jQuery/Javascript files with WordPress
- Undefined offset: 0 in > […] /wp-includes/capabilities.php on line 1067
- Best practices for a Style/CSS based theme options page?
- How to license my commercial WordPress theme? [closed]
- How to Use WordPress as Static CMS Without Blog Posts
- How do I create my own admin button and theme settings page?
- Editing Links in the Footer of WordPress Themes with Base64 Encrypted Code?
- How to set two different themes on one WordPress? (Desktop vs. Mobile)
- How can I add a set featured image function to a theme that doesn’t already have it built in?
- Jquery in Child Theme
- Changing the visible url path to css & js files
- Display custom_background outside wp_head()
- Widgets vs. Theme Mods
- Retaining old HTML archives and displaying themes conditionally
- Theme Activation, Create Database Tables
- Can we create a child theme for a premium child theme built on Genesis framework?
- WordPress ignoring specified template for front page. Why?
- Alternate header image
- How to start learning CSS and theme development?
- How do I make the category template display full posts instead of partial posts?
- Does uninstalling a WordPress theme delete its database values?
- PHP Parse error: syntax error, unexpected end of file, expecting elseif (T_ELSEIF) or else (T_ELSE) or endif (T_ENDIF) on line 230 [closed]
- Child theme not using parent theme css/styles/formatting?
- Problem after renaming wordpress template file
- Make it possible to pick a color theme for specific pages
- wp_add_inline_style() not working?
- X-Axis of Site is Messed Up Because it is in Hebrew
- How to create my own sidebar in Twenty Eleven child theme?
- How to find out if page_for_posts is showing (in order to style menu item)
- WP can’t create new directory
- Full page (no WP admin menus and options) admin theme options
- Make multiple pages and set template/content on theme activation?
- My new WordPress theme based on the TwentyEleven theme doesn’t display the front page OR the blog page
- How to add logo in Thematic
- Translate a site based on different themes
- Problems to disable the comments for my statics pages
- Any Good WordPress Themes Compatible With The BBPress Plugin? [closed]
- Template messed up on viewing posts
- Issue with theme mod options during domain migration
- Show hyperlinks only when user is loggedin
- I don’t know how to put a placeholder [closed]
- What data does WordPress theme update pull If there is an update?
- how to stop a gallery slideshow
- How can i set default pages to a word press theme? it shouldn’t be changed even if i install the theme in different host
- WordPress 2022 template, how to see the blocks added in post template on post edit?
- Two themes using a Multiple Themes plugin
- Broken theme, stylesheet is missing after uploading the right theme via FTP
- how to notify users about new theme updates?
- I cannot get an Advanced Custom Field code snippet to work – and ACF support say it should work
- WordPress thinks my custom theme is a theme in the public theme repository
- WP Customize API Checkbox change value
- Updating a theme
- Warning: call_user_func() expects parameter 1 to be a valid callback
- Phone numbers showing same color as header [closed]
- Baskerville Theme – How to use the masonry grid layout on other pages
- Background image not showing up
- Line break no working on theme
- QA/Staging envirnoment for wordpress sites
- Will this js code work in a page template?
- Create /archive page in WordPress Theme
- Fatal error: Call to undefined function get_header() and BuddyPress [closed]
- How can I allow a client to edit certain parts of a static site?
- How can I either move the nav bar down or create more space for the header? Theme – Ajaira
- To create a theme or use an existing one? [closed]
- Overwrite functions.php of a theme – What if the theme is updated?
- How to add/edit content Custom Content item in theme
- Is there a WordPress theme for twittstrap? [closed]
- Why does WP theme not look like promoted? [closed]
- Remove image next to header image on WellExpo theme [closed]
- Adding PHP code to single template in 2023 edition of WordPress theme