display most popular tags in two columns

In my opinion you are doing it so complicated. I would rather do a classic query and then through css it made into 2-column. function top_tags() { $tags = get_the_tags(); if($tags) { $output=”<h4>Top tags</h4> <ul class=”top_tags”>”; foreach($tags as $tag) $output .= ‘<li><a href=”‘.get_tag_link($tag->term_id).'” title=”‘.$tag->name.'”>’.$tag->name.'</a></li>’; $output .= ‘</ul>’; echo $output; } } and your css .top_tags … Read more

Sidebar Generator? :)

The code for this plugin is actually pretty simple. The init function loops through all the sidebars (stored in the wp_options table) and registers them in wordpress: <?php function init(){ //go through each sidebar and register it $sidebars = sidebar_generator::get_sidebars(); if(is_array($sidebars)){ foreach($sidebars as $sidebar){ $sidebar_class = sidebar_generator::name_to_class($sidebar); register_sidebar(array( ‘name’=>$sidebar, ‘before_widget’ => ‘<li id=”%1$s” class=”widget sbg_widget … Read more

Categories and Tags returning 404 on the sidebar when using ugly permalinks

Instead of: home_url() . “/tag/” . $i->slug Use get_term_link() function. It will return the link for the term according with the current configuration: // Assuming $i is a term object get_term_link( $i->term_id ) For example, your printTags() function would be: function printTags($tags){ //Check to see if tags are provided if ($tags!=false) { $return = ”; … Read more

Sidebar random author spotlight

You can cut a lot of steps out of this if you use get_users() instead of your custom SQL query. You can then select a random user out of that array using array_rand() (native PHP function, not a wordpress function) and it will return the key you should be using. Here’s an example: $users = … Read more

Sidebar Generator issue [closed]

the best option here if you want to use a plugin is to use the woo sidebars plugin which is from from woo themes, its also packaged in their free plugin woo dojo which has several free plugins, if your good with options framework by devin or smof and don’t mind using cmb meta boxes … Read more

Change a sidebar name?

Hook into register_sidebar and change the name after the sidebar was registered. Example: add_action( ‘register_sidebar’, function( $sidebar ) { global $wp_registered_sidebars; if ( ‘Main Sidebar’ !== $sidebar[ ‘name’ ] ) return; $id = $sidebar[ ‘id’ ]; $sidebar[ ‘name’ ] = ‘Master’; $wp_registered_sidebars[ $id ] = $sidebar; }); There is no need to unregister the original … Read more

Create variable from widget instance

Where are the widgets settings stored? The widget settings are stored in the wp_options table. You can retrieve it with print_r( get_option( ‘widget_x’ ) ); where x is the $id_base input parameter of the WP_Widget class constructor. If $id_base is empty, then it uses the widget class name in lower case letters, without the prefixes: … Read more

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