Jump to content
Sign in to follow this  

Making your wordpress theme sidebar accept widget's

Recommended Posts



I have found a great theme I like for wordpress but the sidebar will not accept widets, does anyone know how to alter the sidebar to accept widgets?




Here is the sidebar code

<div class="main_right">


<div class="link_projects">


<div class="lbl">

<form method="get" id="searchform" action="<?php bloginfo('home'); ?>/">

<div><input type="text" value="<?php echo wp_specialchars($s, 1); ?>" name="s" id="s" />

<input type="submit" id="searchsubmit" value="Search" />





<span class="left">

<a href="<?php bloginfo('rss2_url'); ?>" class="g1"><span>RSS</span><br />RSS Feed</a>


<span class="right">

<a href="http://on-tech.net/?page_id=2" class="g2"><span>US!</span><br />About Us</a>





<div class="link_updates">


<div class="lbl">Categories</div>



global $wpdb;

$cats = $wpdb->get_results("SELECT cat_ID, cat_name, category_nicename FROM $wpdb->categories WHERE category_count > 0 AND category_parent = 0");


$salida = "";


foreach ($cats as $cat) {

$p =$wpdb->get_row("SELECT * FROM $wpdb->posts AS p, $wpdb->post2cat AS p2c WHERE p2c.post_id = p.ID AND p2c.category_id = ".$cat->cat_ID." ORDER BY p.post_date DESC LIMIT 0 , 1");

$salida .= '<a href="'.get_category_link($cat->cat_ID).'" title="'.wp_specialchars($cat->cat_name).'"><span>'.wp_specialchars($cat->category_nicename).'</span>';

$salida .= $p->post_title.'<br />'.$p->post_date.'<br /></a>';


echo $salida;


<!--?php wp_list_cats('sort_column=name&optioncount=0&hierarchical=0&list=0'); ?-->

<div class="clearer"><span></span></div>






Thankyou very much for any help



Edited by tom203

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing

    No registered users viewing this page.

  • Who's Online (See full list)

    There are no registered users currently online