I accidentally added a widget area called sidebar 1

There should be a line like this in your functions.php of the theme: “register_sidebar”… <?php // … some code before // register_sidebar(array( ‘name’ => __(‘unwanted widget’, ‘your-textdomain’), ‘description’ => __(‘Your new widget desciption’, ‘your-textdomain’), ‘id’ => ‘your-new-widget-name’ )); // …some code after ?> Search for that line and change it. Basically, simply rename your unwanted … Read more

How to prevent Widget from echoing to wrong position in DOM

dynamic_sidebar will output the sidebar when it is called. Try using it with buffering and store into a variable as below: <ul class=”menu”> <?php $locations = get_nav_menu_locations(); if ( isset( $locations[ ‘mega_menu’ ] ) ) { $menu = get_term( $locations[ ‘mega_menu’ ], ‘nav_menu’ ); if ( $items = wp_get_nav_menu_items( $menu->name ) ) { foreach ( … Read more

Custom archive widget drop down menu

The archives widget uses the wp_get_archives function to generate the dropdown list. As you can see from the source code, there is no native way to use other dropdowns than yearly/monthly/weekly/daily. Unfortunately, there also is no hook to insert your own quarterly dropdown. So, there is no easy way to do this. There is a … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)