Forums

[resolved] How to Add Widgets to Aalglatt??? (9 posts)

  1. threedogmoon
    Member
    Posted 3 years ago #

    Hi all, my site is http://www.threedogmoon.com The code as it stands in the sidebar is as follows:

    <!-- begin sidebar -->
    <div id="right">
    	<!--
    		<div id="author">
    			Here is a section you can use to briefly talk about yourself or your site. Uncomment and delete this line to use.
    			<h3><?php _e('The Author'); ?></h3>
    			<p>Your description here.</p>
    		</div>
    
    		<div class="line"></div>
    	-->
    		<div id="links">
    
    		<div id="pages">
    			<h3><?php _e('Pages'); ?></h3>
    				<ul>
    					<?php wp_list_pages('title_li='); ?>
    				</ul>
    		</div>
    
    		<div class="line"></div>
    
    		<h3><?php _e('Categories'); ?></h3>
    				<ul>
    					<?php wp_list_cats(); ?>
    				</ul>	
    
    		<div class="line"></div>
    
    		<h3><?php _e('Archives'); ?></h3>
    			<ul>
    		 		<?php wp_get_archives('type=monthly'); ?>
     			</ul>
    
    		<div class="line"></div>
    
    		<h3><?php _e('Friends'); ?></h3>
    			<ul>
    				<?php wp_list_bookmarks('title_before=&title_after='); ?>
    			</ul>
    
    		<div class="line"></div>
    
    		<h3>Search</h3>
    			<p class="searchinfo">search site archives</p>
    			<div id="search">
    				<div id="search_area">
    					<form id="searchform" method="get" action="<?php echo $_SERVER['PHP_SELF']; ?>">
    						<input class="searchfield" type="text" name="s" id="s" value="" title="Enter keyword to search" />
    						<input class="submit" type="submit" name="submit" value="" title="Click to search archives" />
    					</form>
    				</div>
    			</div>
    
    		<div class="line"></div>
    
    			<h3><?php _e('Meta'); ?></h3>
    				<ul>
    					<!-- <li><?php // wp_register(); ?></li> -->
    					<li><?php wp_loginout(); ?></li>
    					<li><a href="feed:<?php bloginfo('rss2_url'); ?>" title="<?php _e('Syndicate this site using RSS'); ?>"><?php _e('<abbr title="Really Simple Syndication">RSS</abbr>'); ?></a></li>
    					<li><a href="feed:<?php bloginfo('comments_rss2_url'); ?>" title="<?php _e('The latest comments to all posts in RSS'); ?>"><?php _e('Comments <abbr title="Really Simple Syndication">RSS</abbr>'); ?></a></li>
    					<li><a href="#content" title="back to top">Back to top</a></li>
    					<?php wp_meta(); ?>
    				</ul>
    
    		<div class="line"></div>
    
    			<?php if (function_exists('wp_theme_switcher')) { ?>
    			<h3><?php _e('The Themes' ); ?></h3>
    			<div class="themes">
    				<?php wp_theme_switcher(); ?>
    			</div>
    			<?php } ?>
    		</div>
    </div>
    
    <!-- end sidebar -->

    Any help would be appreciated!!!

  2. threedogmoon
    Member
    Posted 3 years ago #

    Oh, its based on the Aalglatt Theme.

  3. moshu
    Member
    Posted 3 years ago #

  4. threedogmoon
    Member
    Posted 3 years ago #

    I looked at that, but I want to be able to keep my sidebar the way it looks now and add widgets. I'm not sure what to keep or delete in my sidebar to do that. Can I add just the code:

    <?php if ( !function_exists('dynamic_sidebar')
            || !dynamic_sidebar() ) : ?>
  5. moshu
    Member
    Posted 3 years ago #

    That's only half of it. It has to be closed (endif)

    Then use the widget code OUTSIDE of the existing elements of your sidebar.

  6. threedogmoon
    Member
    Posted 3 years ago #

    Thanks...so if my small brain gets it then this code here used outside of my other stuff (or maybe in beteew as well??) should work?

    <?php if ( !function_exists('dynamic_sidebar')
            || !dynamic_sidebar() ) : ?>
    <?php endif; ?>
  7. moshu
    Member
    Posted 3 years ago #

    Outside yes, although I would add a ul /ul around it - most widgets will start with a li tag, so make sure you have ul /ul around.

    In between? Maybe, if it displays strangely, check the nested lists in the source code.

    Oh, and you need a functions.php file in your theme folder, too. Copy it form the classic theme.

  8. threedogmoon
    Member
    Posted 3 years ago #

    Wow, thanks a ton, that worked! For anyone else with the prob: I replaced the functions.php in Aalglatt with the one from the classic theme, and then I added this code in between my categories and archives section:

    <ul>
    		<?php if ( !function_exists('dynamic_sidebar')
            || !dynamic_sidebar() ) : ?>
    		<?php endif; ?>
    	</ul>
  9. moshu
    Member
    Posted 3 years ago #

    Not sure that replacing it was a wise idea... there might be other functionality and code that is need for the theme to work properly, but you can always add the widget code to the existing functions.php if it is not there.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.