Link to home
Start Free TrialLog in
Avatar of trimaxs
trimaxs

asked on

How can i make my wordpress template..... widget aware?

I had a HemingwayEx wordpress skin installed on my blog at www.trimaxs.com/blog

i used to be able to edit the "presentation" widgets ( moving widget back and forth ), but not anymore

Now it's saying:

No Sidebars Defined

You are seeing this message because the theme you are currently using isnt 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.

I've gone to the website but i can't figure it out myself ( i'm just basic html user )

as i understand it, i need to add a code somewhere

can someone help? do i need to copy paste the template's css? here's my index.php for the blog
<?php get_header(); ?>
 
 
	<div id="primary" class="twocol-stories">
		<div class="inside">
			<?php
				// Here is the call to only make two posts show up on the homepage REGARDLESS of your options in the control panel
				$category_id = $hemingwayEx->get_asides_category_id();
				is_null($category_id) ? query_posts('showposts=2') : query_posts('showposts=2&cat=-' . $category_id);
			?>
			<?php if (have_posts()) : ?>
				<?php $first = true; ?>
				<?php while (have_posts()) : the_post(); ?>
					<div class="story<?php if($first == true) echo " first" ?>">
						<h3><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></h3>
						<?php $hemingwayEx->excerpt() ?><span class="read-on"><a href="<?php the_permalink() ?>">read on</a></span>
						<div class="details">
							<?php echo _('Posted at') ?> <?php the_time('ga \o\n ' . $hemingwayEx->date_format(true) . '/y') ?> | <?php comments_popup_link('no comments', '1 comment', '% comments'); ?> | Filed Under: <?php the_category(', ') ?>
						</div>
					</div>
					<?php $first = false; ?>
				<?php endwhile; ?>
		</div>
				
			<?php else : ?>
		
				<h2 class="center">Not Found</h2>
				<p class="center">Sorry, but you are looking for something that isn't here.</p>
				<?php include (TEMPLATEPATH . "/searchform.php"); ?>
		
			<?php endif; ?>
				
			<div class="clear"></div>
	</div>
	<!-- [END] #primary -->
 
 
 
<?php get_sidebar(); ?>
 
<?php get_footer(); ?>

Open in new window

Avatar of andrewmilo
andrewmilo
Flag of United States of America image

Actually, you want to do this in your sidebar.php file, not the main file.

You can read more here:

http://automattic.com/code/widgets/themes/

Essentially, you need to need to add something like this:

<ul id="sidebar">
<?php if ( !function_exists('dynamic_sidebar')
        || !dynamic_sidebar() ) : ?>
 <li id="about">
  <h2>About</h2>
  <p>This is my blog.</p>
 </li>
 <li id="links">
  <h2>Links</h2>
  <ul>
   <li><a href="http://example.com">Example</a></li>
  </ul>
 </li>
<?php endif; ?>
</ul>

Open in new window

SOLUTION
Avatar of andrewmilo
andrewmilo
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of trimaxs
trimaxs

ASKER

hi there, i've opened the sidebar.php and it only has the following code
<?php
include (TEMPLATEPATH . '/dynamic_bottombar.php'); 
 
// If you want to ignore the Theme Options handling of the sidebar and just do it yourself
// Use this one instead of the above
// include (TEMPLATEPATH . '/static_sidebar.php'); 
?>

Open in new window

Avatar of trimaxs

ASKER

i've read the blog you mentioned and is aware that the following line:

<?php if ( !function_exists('dynamic_sidebar')
       || !dynamic_sidebar() ) : ?>

should be used. But i'm just not sure where to put it.

I think i've edited the blog, but only to add google analytics code.

Currently in the process of downloading the latest hemingwayex template and will try to replace the existing one
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial