New answers tagged

0

I added after get_header(); ?> <aside id="secondary" class="left-sidebar widget-area" role="complementary"> <?php dynamic_sidebar( 'sleft' ); ?> </aside><!-- .sidebar .widget-area --> Then aside#secondary { width: 20%; float: left; margin-right: 15px; } Now... if you're going to have both ...


0

Sorry to post this as an answer when it should be a comment. After struggling for a while with calling a sidebar in a hook problem, I'd like to mention that sidebar ID should be all lower case. I you use a capital letter in sidebar ID (ex: 'Secondary'), the registered sidebar will appear in wp-admin, you may add widgets to it, but if you don't register the ...


1

To append text to the end of the titles in that widget and nothing more i.e. does not matter the URL, you can just use some CSS. <li> <a class="my-folder-categories">Category 1</a> </li> a.my-folder-categories-folder:after {content:" folder"; This will effectivly make the text appear as so: category 1 folder Be sure to add ...


0

I've found the exact solution to my question here: http://wordpress.stackexchange.com/a/17687/92505 Here's the exact code I used after some modification to make it work on my situation. Add the following code to functions.php where 'sidebar-1' is your sidebar ID. 'recent-posts' is the name of the widget your want yo hide. 12 is the length of the string ...


-1

function wpbootstrap_checksidebars_widgets($sidebars_widgets) { return $sidebars_widgets; } add_filter('sidebars_widgets','wpbootstrap_checksidebars_widgets' ); //Now user can add custom widget areas function custom_widget_areas_init() { register_sidebar( array( 'name' => 'Front Page Widget Area', 'id' => 'frontpage-widgets', ...


0

You haven't actually said what the problem is. But I can see one for starters - dynamic_sidebar in your if conditions will echo out the widgets immediately. If you want to check a sidebar has widgets, use is_active_sidebar: is_active_sidebar( 'sidebar-1' ); // True/false


0

If anyone is still looking for this option, I've totally recommend using this plugin instead : https://wordpress.org/plugins/widget-options/ but if you want to use custom code. You can try this one below. Thanks! add_filter( 'widget_display_callback', 'hide_widget', 50, 3 ); function hide_widget( $instance, $widget, $args ){ if ( is_page( 28 ) ) { ...



Top 50 recent answers are included