• I have some theme sidebars, that are not intented for the dropdowns in the custom sidebars. Can I prevent them from appearing there? In my case I have 4 x footer sidebars – and it really “pollutes” the UI ??

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi @mouret,

    Sorry to keep you waiting for so long, we missed this thread somehow ??

    Are you looking to remove footer sections from page sidebar selector?

    You can go to Widget panel and expand your footer sections, at the bottom you should see “Allow this sidebar to be replaced” option, disable this and that should do the trick ??

    Cheers,
    Predrag

    Thread Starter Thor Sarup

    (@mouret)

    No problem.

    No its a bit the other way around – I don’t want the footer area to appear in the drop down list.
    (I have no interest in putting footers and other “default” sidebars into my own sidebar areas.)

    I ended up styling it away ??

    Like this:

    add_action('admin_head', 'style_admin');
    function style_admin() {
    	$screen = get_current_screen();
    	$cur_php = basename($_SERVER['PHP_SELF']);
    	if ($cur_php == "post.php") {
    		if ( $screen->post_type == 'page' && isset($_GET['post'] ) ) { 
    			// page edit
    		}
    		echo '<style>
    		.wp-admin .cs-replacement-field option[value|=footer],
    		.wp-admin .cs-replacement-field option[value=sidebar-left],
    		.wp-admin .cs-replacement-field option[value=sidebar-right] {
    			display: none;
    		}
    		</style>';
    	}
    }

    But if there are other ways I’m all ears.

    Hello mouret,

    Let me check that with developer is there is another way to do that.

    kind regards,
    Kasia

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Disable some sidebars from appearing in the dropdown’ is closed to new replies.