Forums

Widgets -- No Sidebars Defined (2 posts)

  1. suzan.diselva
    Member
    Posted 2 weeks ago #

    I am working on http://wifiphone.net/blog where i have used PlayMaker 3 theme & i want to install some plugin which needs widget.
    In admin Appearance->Widgets shows

    -- No Sidebars Defined
    The theme you are currently using isn’t widget-aware, meaning that it has no sidebars that you are able to change. For information on making your theme widget-aware, please follow these instructions.

    As per this article http://codex.wordpress.org/Widgetizing_Themes
    have to edit function.php in my theme their is function.php but donsn't have sidebar.php as this theme have hardcoded on home.php

    This is inside home.php

    <?php get_header(); ?><!-- Get Header -->
    
    <div id="wrapper"><!-- Begin Main Body Wrapper -->
    
    <div id="column-setup"><!-- Begin Column Setup -->
    
    <div class="column-402"><!-- Begin Left Column -->
    
    <div id="module-01"><!-- Begin Module #01 -->
    
    <h1 class="blocktitle"><?php if ( $mod1title = get_option('stylewp_mod1title') ) { ?><?php $mod1title = get_option('stylewp_mod1title'); echo stripslashes($mod1title); ?><?php } else { ?>Top Story<?php } ?></h1>
    
    <?php $my_query = new WP_Query('showposts=1&offset=0'); ?>
    
    <?php while ($my_query->have_posts()) : $my_query->the_post(); ?>
    
    <a href="<?php the_permalink(); ?>"><img src="<?php viva(402,'');?>" alt="<?php the_title(); ?> <?php _e('thumbnail'); ?>" align="top" style="border: 0px; padding: 0px; margin: 5px 0px 0px 0px; width: 402px; height: 210px;"/>
    
    </a>
    
    <?php endwhile; ?>
    
    <div class="main-highlight">
    
    <?php $my_query = new WP_Query('showposts=1&offset=0'); ?>
    
    <?php while ($my_query->have_posts()) : $my_query->the_post(); ?>
    
    <h1 class="main-news-item"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h1>
    
    <?php wswwpx_content_extract ( ' ', 25, 25 ); ?> 
    
    <?php endwhile; ?>
    
    </div>
    
    </div><!-- End Module #01 -->
    
    <div id="module-02"><!-- Begin Module #02 -->
    
    <h1 class="blocktitle-underline"><?php if ( $mod2title = get_option('stylewp_mod2title') ) { ?><?php $mod2title = get_option('stylewp_mod2title'); echo stripslashes($mod2title); ?><?php } else { ?>Breaking News<?php } ?></h1>
    
    <div class="module-02-left">
    
    <?php $my_query = new WP_Query('showposts=1&offset=1'); ?>
    
    <?php while ($my_query->have_posts()) : $my_query->the_post(); ?>
    
    <a href="<?php the_permalink(); ?>"><img src="<?php viva(128,'');?>" alt="<?php the_title(); ?> <?php _e('thumbnail'); ?>" align="top" style="border: 0px; padding: 0px; margin: 8px 0px 5px 0px; width: 128px; height: 67px;"/>
    
    </a>
    
    <h1 class="other-news-item"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h1>
    
    <?php wswwpx_content_extract ( ' ', 9, 9 ); ?> 
    
    <?php endwhile; ?>
    
    </div>
    
    <div class="module-02-middle">
    
    <?php $my_query = new WP_Query('showposts=1&offset=2'); ?>
    
    <?php while ($my_query->have_posts()) : $my_query->the_post(); ?>
    
    <a href="<?php the_permalink(); ?>"><img src="<?php viva(128,'');?>" alt="<?php the_title(); ?> <?php _e('thumbnail'); ?>" align="top" style="border: 0px; padding: 0px; margin: 8px 0px 5px 0px; width: 128px; height: 67px;"/>
    
    </a>
    
    <h1 class="other-news-item"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h1>
    
    <?php wswwpx_content_extract ( ' ', 9, 9 ); ?> 
    
    <?php endwhile; ?>
    
    </div>
    
    <div class="module-02-right">
    
    <?php $my_query = new WP_Query('showposts=1&offset=3'); ?>
    
    <?php while ($my_query->have_posts()) : $my_query->the_post(); ?>
    
    <a href="<?php the_permalink(); ?>"><img src="<?php viva(128,'');?>" alt="<?php the_title(); ?> <?php _e('thumbnail'); ?>" align="top" style="border: 0px; padding: 0px; margin: 8px 0px 5px 0px; width: 128px; height: 67px;"/>
    
    </a>
    
    <h1 class="other-news-item"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h1>
    
    <?php wswwpx_content_extract ( ' ', 9, 9 ); ?> 
    
    <?php endwhile; ?>
    
    </div>
    
    </div><!-- End Module #02 -->
    
    <div id="module-03"><!-- Begin Module #03 -->
    
    <h1 class="blocktitle-red"><?php if ( $mod3title = get_option('stylewp_mod3title') ) { ?><?php $mod3title = get_option('stylewp_mod3title'); echo stripslashes($mod3title); ?><?php } else { ?>More News<?php } ?></h1>
    
    <div class="module-03-left">
    
    <?php $my_query = new WP_Query('showposts=1&offset=4'); ?>
    
    <?php while ($my_query->have_posts()) : $my_query->the_post(); ?>
    
    <a href="<?php the_permalink(); ?>"><img src="<?php viva(128,'');?>" alt="<?php the_title(); ?> <?php _e('thumbnail'); ?>" align="top" style="border: 0px; padding: 0px; margin: 8px 0px 5px 0px; width: 128px; height: 67px;"/>
    
    </a>
    
    <h1 class="other-news-item"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h1>
    
    <?php wswwpx_content_extract ( ' ', 9, 9 ); ?> 
    
    <?php endwhile; ?>
    
    </div>
    
    <div class="module-03-middle">
    
    <?php $my_query = new WP_Query('showposts=1&offset=5'); ?>
    
    <?php while ($my_query->have_posts()) : $my_query->the_post(); ?>
    
    <a href="<?php the_permalink(); ?>"><img src="<?php viva(128,'');?>" alt="<?php the_title(); ?> <?php _e('thumbnail'); ?>" align="top" style="border: 0px; padding: 0px; margin: 8px 0px 5px 0px; width: 128px; height: 67px;"/>
    
    </a>
    
    <h1 class="other-news-item"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h1>
    
    <?php wswwpx_content_extract ( ' ', 9, 9 ); ?> 
    
    <?php endwhile; ?>
    
    </div>
    
    <div class="module-03-right">
    
    <?php $my_query = new WP_Query('showposts=1&offset=6'); ?>
    
    <?php while ($my_query->have_posts()) : $my_query->the_post(); ?>
    
    <a href="<?php the_permalink(); ?>"><img src="<?php viva(128,'');?>" alt="<?php the_title(); ?> <?php _e('thumbnail'); ?>" align="top" style="border: 0px; padding: 0px; margin: 8px 0px 5px 0px; width: 128px; height: 67px;"/>
    
    </a>
    
    <h1 class="other-news-item"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h1>
    
    <?php wswwpx_content_extract ( ' ', 9, 9 ); ?> 
    
    <?php endwhile; ?>
    
    </div>
    
    </div><!-- End Module #03 -->
    
    <div id="module-04"><!-- Begin Module #04 -->
    
    <h1 class="blocktitle-blue"><?php if ( $mod4title = get_option('stylewp_mod4title') ) { ?><?php $mod4title = get_option('stylewp_mod4title'); echo stripslashes($mod4title); ?><?php } else { ?>Have You Read?<?php } ?></h1>
    
    <div class="module-04-left">
    
    <?php $my_query = new WP_Query('showposts=1&offset=7'); ?>
    
    <?php while ($my_query->have_posts()) : $my_query->the_post(); ?>
    
    <a href="<?php the_permalink(); ?>"><img src="<?php viva(128,'');?>" alt="<?php the_title(); ?> <?php _e('thumbnail'); ?>" align="top" style="border: 0px; padding: 0px; margin: 8px 0px 5px 0px; width: 128px; height: 67px;"/>
    
    </a>
    
    <h1 class="other-news-item"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h1>
    
    <?php wswwpx_content_extract ( ' ', 9, 9 ); ?> 
    
    <?php endwhile; ?>
    
    </div>
    
    <div class="module-04-middle">
    
    <?php $my_query = new WP_Query('showposts=1&offset=8'); ?>
    
    <?php while ($my_query->have_posts()) : $my_query->the_post(); ?>
    
    <a href="<?php the_permalink(); ?>"><img src="<?php viva(128,'');?>" alt="<?php the_title(); ?> <?php _e('thumbnail'); ?>" align="top" style="border: 0px; padding: 0px; margin: 8px 0px 5px 0px; width: 128px; height: 67px;"/>
    
    </a>
    
    <h1 class="other-news-item"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h1>
    
    <?php wswwpx_content_extract ( ' ', 9, 9 ); ?> 
    
    <?php endwhile; ?>
    
    </div>
    
    <div class="module-04-right">
    
    <?php $my_query = new WP_Query('showposts=1&offset=9'); ?>
    
    <?php while ($my_query->have_posts()) : $my_query->the_post(); ?>
    
    <a href="<?php the_permalink(); ?>"><img src="<?php viva(128,'');?>" alt="<?php the_title(); ?> <?php _e('thumbnail'); ?>" align="top" style="border: 0px; padding: 0px; margin: 8px 0px 5px 0px; width: 128px; height: 67px;"/>
    
    </a>
    
    <h1 class="other-news-item"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h1>
    
    <?php wswwpx_content_extract ( ' ', 9, 9 ); ?> 
    
    <?php endwhile; ?>
    
    </div>
    
    </div><!-- End Module #04 -->
    
    </div><!-- End Left Column -->
    
    <div class="column-254"><!-- Begin Middle Column -->
    
    <h1 class="blocktitle-underline"><?php if ( $mod5title = get_option('stylewp_mod5title') ) { ?><?php $mod5title = get_option('stylewp_mod5title'); echo stripslashes($mod5title); ?><?php } else { ?>Headlines<?php } ?></h1><!-- Begin Module #05 -->
    
    <ul>
    
    <?php 	
    
    	$the_query = new WP_Query('showposts=20&offset=10');	
    
    	$counter = 0;	
    
    	while ($the_query->have_posts()) : $the_query->the_post(); $do_not_duplicate = $post->ID;
    
    ?>
    
    <li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li>
    
    <?php endwhile; ?>
    
    </ul><!-- End Module #05 -->
    
    <h1 class="blocktitle-underline"><?php if ( $mod6title = get_option('stylewp_mod6title') ) { ?><?php $mod6title = get_option('stylewp_mod6title'); echo stripslashes($mod6title); ?><?php } else { ?>Photo of the Day<?php } ?></h1><!-- Begin Module #06 -->
    
    <?php 	
    
            $photoday = get_option('stylewp_photoday');	
    
    	$the_query = new WP_Query('showposts=1&offset=' . $photoday . '');	
    
    	$counter = 0;	
    
    	while ($the_query->have_posts()) : $the_query->the_post(); $do_not_duplicate = $post->ID;
    
    ?>
    
    <a href="<?php the_permalink(); ?>"><img src="<?php viva(254,'');?>" alt="<?php the_title(); ?> <?php _e('thumbnail'); ?>" align="top" style="border: 0px; padding: 0px; margin: 5px 0px 13px 0px; width: 254px; height: 150px;"/></a>
    
    <?php endwhile; ?><!-- End Module #06 -->
    
    <h1 class="blocktitle-underline-padding"><?php if ( $mod7title = get_option('stylewp_mod7title') ) { ?><?php $mod7title = get_option('stylewp_mod7title'); echo stripslashes($mod7title); ?><?php } else { ?>Archived News<?php } ?></h1><!-- Begin Module #07 -->
    
    <?php $my_query = new WP_Query('showposts=4&offset=30'); ?>
    
    <?php while ($my_query->have_posts()) : $my_query->the_post(); ?>
    
    <a href="<?php the_permalink(); ?>"><img src="<?php viva(68,'');?>" alt="<?php the_title(); ?> <?php _e('thumbnail'); ?>" align="left" style="border: 0px; padding: 0px; margin: 2px 10px 10px 0px; width: 68px; height: 60px;"/>
    
    </a>
    
    <h1 class="other-news-item"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h1>
    
    <?php wswwpx_content_extract ( ' ', 6, 6 ); ?> 
    
    <div style="clear: both;"></div>
    
    <?php endwhile; ?><!-- End Module #07 -->
    
    </div><!-- End Middle Column -->
    
    <div class="column-300"><!-- Begin Right Column -->
    
    <div id="sidebar-block"><!-- Begin Module #08 -->
    
    <h1 class="blocktitle"><?php if ( $mod8title = get_option('stylewp_mod8title') ) { ?><?php $mod8title = get_option('stylewp_mod8title'); echo stripslashes($mod8title); ?><?php } else { ?>Featured Video<?php } ?></h1>
    
    <div style="padding-bottom: 8px;"></div>
    
    <?php if ( $videocode = get_option('stylewp_videocode') ) { ?>
    
    <?php $videocode = get_option('stylewp_videocode'); echo stripslashes($videocode); ?>
    
    <?php } else { ?>
    
    <?php if ( $videocodedefault = get_option('stylewp_videocodedefault') ) { ?>
    
    <?php $videocodedefault = get_option('stylewp_videocodedefault'); echo stripslashes($videocodedefault); ?>
    
    <?php } else { ?>
    
    No video added - <a href="<?php echo get_settings('home'); ?>/wp-admin/admin.php?page=mt-agi-module-settings-page">click here to add one</a> now
    
    <?php } ?>
    
    <?php } ?>
    
    </div><!-- End Module #08 -->
    
    <div id="sidebar-block"><!-- Begin Module #09 -->
    
    <h1 class="blocktitle"><?php if ( $mod9title = get_option('stylewp_mod9title') ) { ?><?php $mod9title = get_option('stylewp_mod9title'); echo stripslashes($mod9title); ?><?php } else { ?>Popular Topics<?php } ?></h1>
    
    <div style="padding-bottom: 8px;"></div>
    
    <?php wp_tag_cloud('smallest=8&largest=20&number=30&orderby=name'); ?>
    
    </div><!-- End Module #09 -->
    
    <?php if ( $banner4 = get_option('stylewp_banner4') ) { ?> 
    
    <?php $banner4 = get_option('stylewp_banner4'); echo stripslashes($banner4); ?>
    
    <div style="padding: 0px 0px 13px 0px;"></div>
    
    <?php } else { ?>
    
    <?php } ?>
    
    <div id="sidebar-block-bottom"><!-- Begin Module #10 -->
    
    <h1 class="blocktitle"><?php if ( $mod10title = get_option('stylewp_mod10title') ) { ?><?php $mod10title = get_option('stylewp_mod10title'); echo stripslashes($mod10title); ?><?php } else { ?>Readers Views<?php } ?></h1>
    
    <?php
    
      global $wpdb;
    
      $sql = "SELECT DISTINCT ID, post_title, post_password, comment_ID, comment_post_ID, comment_author, comment_date_gmt, comment_approved, comment_type,comment_author_url, SUBSTRING(comment_content,3,93) AS com_excerpt FROM $wpdb->comments LEFT OUTER JOIN $wpdb->posts ON ($wpdb->comments.comment_post_ID = $wpdb->posts.ID) WHERE comment_approved = '1' AND comment_type = '' AND post_password = '' ORDER BY comment_date_gmt DESC LIMIT 4";
    
      $comments = $wpdb->get_results($sql);
    
      $output = $pre_HTML;
    
      $output .= "\n<ul>";
    
      foreach ($comments as $comment) {
    
        $output .= "\n<li><b>".strip_tags($comment->comment_author) .":</b>" . "<a href=\"" . get_permalink($comment->ID)."#comment-" . $comment->comment_ID . "\" title=\"on ".$comment->post_title . "\">" . strip_tags($comment->com_excerpt)."</a></li>";
    
      }
    
      $output .= "\n</ul>";
    
      $output .= $post_HTML;
    
      echo $output;
    
    ?>
    
    </div><!-- End Module #10 -->
    
    </div><!-- End Right Column -->
    
    </div><!-- End Column Setup -->
    
    </div><!-- End Main Body Wrapper -->
    
    <?php get_footer(); ?><!-- Get Footer -->

    Help me to make this theme Widgetize.

  2. esmi
    Member
    Posted 2 weeks ago #

    Please don't post huge chunks of code here. For larger blocks of code, use the WordPress pastebin and post the pastebin url here. It makes life easier for everyone.

Reply

You must log in to post.

About this Topic