Tag Info

New answers tagged

0

Looking at your site, it seems that the broken image on the top left side is your logo. I suspect there might be a logo upload for the theme but we won't be able to direct you to where that logo upload form is because it can vary depending on the theme. You'll want to check for the theme options area often located under the Appearance menu in the admin ...


0

the use of function_exists is like that function_exists("register_sidebar")


0

i was using get_sidebar() instead of dynamic_sidebar('name')....


0

From the Wordpress Codex: is_active_sidebar() This Conditional Tag checks if a given sidebar is active (in use). This is a boolean function, meaning it returns either TRUE or FALSE. Any sidebar that contains widgets will return TRUE, whereas any sidebar that does not contain any widgets will return FALSE. So you should be able to do something ...


1

Use the array_filter() function, which will remove every array element that has false as the value. Then you can count the array length. So your example would look like this: $sidebars = array( is_active_sidebar( 'footer-4' ), is_active_sidebar( 'footer-3' ), is_active_sidebar( 'footer-2' ), is_active_sidebar( 'footer-1' ), ...


2

You could add this function to your functions.php file. add_filter( 'sidebars_widgets', 'disable_all_widgets' ); function disable_all_widgets( $sidebars_widgets ) { $sidebars_widgets = array( false ); return $sidebars_widgets; } You could also use the Wordpress conditional tags to disable widgets only on certain pages. For example; this would only ...


0

The solution I've wanted looks like this: <?php // Allow HTML descriptions in WordPress Menu remove_filter( 'nav_menu_description', 'strip_tags' ); function my_plugin_wp_setup_nav_menu_item( $menu_item ) { if ( isset( $menu_item->post_type ) && 'nav_menu_item' == $menu_item->post_type) { $menu_item->description = ...


-2

add_filter( 'wp_nav_menu_items', 'add_sidebar_output_to_menu998722', 10, 2 ); function add_sidebar_output_to_menu998722( $items, $args ) { if ($args->theme_location == 'nav-location') { $items .= dynamic_sidebar($sidebar['id']); } }


0

I did not realize the page had a machine name of contact_us and not just simply contact. When I do !is_page('contact_us') it works.


0

might it can help you for your query : Basically I need a way to display widgets in menu, without using any extra plugins. place the code in your theme’s functions.php <?php register_sidebar( array( 'name' => 'Page Menu', 'id' => 'page-menu', 'before_widget' => '<div id="page-nav">', 'after_widget' => ...


1

This is how the sidebar works in Twenty Twelve There's 2 parts: Register the sidebar in your functions file using register_sidebar function your_widgets_init() { register_sidebar( array( 'name' => __( 'Main Sidebar', 'twentytwelve' ), 'id' => 'sidebar-1', 'before_widget' => '<aside id="%1$s" class="widget %2$s">', ...


1

The two functions at your disposal are register_sidebar and dynamic_sidebar - despite the name, they don't need to have anything to do with a "sidebar" in the traditional sense. As for the term "widget", this is nothing more than a chunk of code that takes some settings and outputs some content. A user can assign widgets to a registered "sidebar" area in ...


1

I heard about registering a sidebar that shows some content other than the main content(which I think sounds to me very similar to mine). Is this sidebar a functionality provided by wordpress itself or it has to do something with my theme's sidebar(which was created by me)? Nothing about this is provided by Core except for the basic sidebar ...



Top 50 recent answers are included