Custom random quote widget breaks when used in multiple sidebars

No parent necessary: the difference between a not-working widget and a working widget was this: $text1 = apply_filters( ‘widget_text1’, $instance[‘text1’], $instance ); vs: $text1 = apply_filters( ‘widget_text1’, empty($instance[‘text1’]) ? ” : $instance[‘text1’], $instance, $this->id_base); I realized putting multiple Random Text widgets on the same page, their titles worked, but their text content did not. So … Read more

Sidebar loop – Thematic Framework

I think the problem is that you’re calling get_post() (note: singular) instead of get_posts() (note: plural). EDIT Other problems: The get_posts() function uses the category array key, rather than category_name. The category array key expects category ID, rather than category slug. You’re not wrapping your looped list items (<li>…</li>) properly (i.e. within <ul></ul> tags)

How to create my own sidebar in Twenty Eleven child theme?

I think I understand what looking for. I’ve put together some code I’ve taken from parts of my themes to give you an example. For the functions.php: <?php add_action( ‘after_setup_theme’, ‘ideatree_init’ ); if ( ! function_exists( ‘ideatree_init’ ) ): function ideatree_init() { // REGISTER THE NAV MENUS (3 in this case) add_action( ‘init’, ‘register_my_menus’ ); … Read more

How to show different widgets on different pages in a user friendly way

You can create your own sidebar if you want. add the following to your functions.php register_sidebar(array(‘name’=>’Sidebar ‘, ‘before_widget’ => ‘<div class=”widget”>’, ‘after_widget’ => ‘</div>’, ‘before_title’ => ‘<p>’, ‘after_title’ => ‘</p>’, )); and you can use this widget by using the following code <?php dynamic_sidebar(‘sidebar’)?> Hope this helps

Creating a different side bar for single posts than for main page.

I would consider the following … Register a new sidebar: function your_new_widget() { register_sidebar( array( ‘name’ => __( ‘Single View Sidebar’, ‘your_textdomain’ ), ‘id’ => ‘sidebar-single’, ‘description’ => __( ‘This widget area is found only on the single post view.’, ‘your_textdomain’ ), ) ); } add_action( ‘widgets_init’, ‘your_new_widget’ ); Create a new sidebar template: /** … Read more

Display category-specific comments in sidebar

Try this function: function get_category_comments($category_id, $limit = 5) { global $wpdb; $sql = ” SELECT {$wpdb->comments}.comment_ID FROM {$wpdb->comments}, {$wpdb->posts}, {$wpdb->term_taxonomy}, {$wpdb->term_relationships} WHERE 1=1 AND {$wpdb->comments}.comment_post_ID = {$wpdb->posts}.ID AND {$wpdb->term_relationships}.object_id = {$wpdb->posts}.ID AND {$wpdb->term_relationships}.term_taxonomy_id = {$wpdb->term_taxonomy}.term_taxonomy_id AND {$wpdb->comments}.comment_approved = ‘1’ AND {$wpdb->term_taxonomy}.term_id = ‘{$category_id}’ ORDER BY {$wpdb->comments}.comment_date DESC LIMIT 0, {$limit} “; $comments = array(); foreach … Read more

Register/Get sidebar?

http://codex.wordpress.org/Function_Reference/get_sidebar <?php get_sidebar(‘other’); ?> for instance will call the template sidebar-other.php you would add the dynamic_sidebar() code in that sidebar-other.php template; see also http://codex.wordpress.org/Widgetizing_Themes

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