show posts names and links in the sidebar list as categories child

Well the simplest way I can think of is something like this… <ul class=”categories”> <?php $categories = get_categories(); //can add parameters here to swtich the order, etc; if(!empty(categories)): foreach($categories as $i => $category): ?> <li class=”category”> <span><?php echo $category->name ?></span> <?php query_posts(‘posts_per_page=-1&cat=” . $category->term_id); if ( have_posts() ) : ?> <ul class=”posts”> <?php while ( … Read more

the_widget() and widget’s ID

I believe @One Trick Pony was right. Shortcode widgets have no ID, so I’ve found a way around. Firstly I used PHP rand function: $var = rand(); And then added the “var” to the ID, so it doesn’t collide with other shortcodes calling the same widget (each one has different random number at the end … Read more

How to check if searchform.php is being included as widget?

Check if searchform is included? The get_search_form() function (that should be used) uses locate_template(‘searchform.php’); to display the search form. The later returns (as you can see from its source) the template filename if one is located So if you’re just wanting to catch the default way, then you should simply test ‘searchform.php’ === locate_template( ‘searchform.php’ … Read more

duplicate sidebar

Try giving a unique ID to each dynamic sidebar, via the id parameter passed to register_sidebar(): register_sidebar( array( ‘id’ => ‘essential’, ‘name’ => __(‘Essential Plan’), ‘before_widget’ => ”, ‘after_widget’ => ”, ‘before_title’ => ”, ‘after_title’ => ” ) ); register_sidebar( array( ‘id’ => ‘premier’, ‘name’ => __(‘Premier Plan’), ‘before_widget’ => ”, ‘after_widget’ => ”, ‘before_title’ … Read more

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