• I’m trying to implement a javascript to rotate banners on sidebar of the theme nightlife-idea that does not support widgets (the theme viewer site says it does, but they don’t work). I’ve been reading about using javascript on this site but everytime it talks about using a text widget to place code on the sidebar. Where can I place the script in this structure? I want to exchange the content of the default blogroll with a banner rotator (loop scroller) that link to other sites.

    <div id="sidebar">
    <div id="rss">
    <a href="<?php bloginfo('rss2_url'); ?>" title="RSS FEED"><img border="0" src="<?php bloginfo('stylesheet_directory'); ?>/images/rss.gif" width="150" alt="RSS FEED"height="28"></a>
    </div>
    <div id="searchbg">
    <form method="get" id="searchform" action="<?php bloginfo('home'); ?>/"><p align="center">
    <input type="text" value="search..." name="s" id="s"
    value="search..." onblur="if (this.value == '') {this.value = 'search...';}"
    onfocus="if (this.value == 'search...') {this.value = '';}"/>
    <input type="submit" value="&raquo;" id="go"></form>
    </div>
    		<ul>
    				<li>
    					<h2>Categories</h2>
    					<ul>
    						<?php wp_list_cats('sort_column=name&hierarchical=0'); ?>
    					</ul>
    				</li>
    
    				<li>
    					<h2>Archives</h2>
    					<ul>
    						<?php wp_get_archives('type=monthly'); ?>
    					</ul>
    				</li>
    
    			</li>
    			</ul>
    
    			<ul>
    
    				<li>
    				<li>
    					<h2>Blogroll</h2>
    					<ul>
    						<?php get_links(-1, '<li>', '</li>', '', FALSE, 'name', FALSE, FALSE, -1, FALSE); ?>
    					</ul>
    				</li>
    
    				<li>
    					<h2>Meta</h2>
    					<ul>
    						<?php wp_register(); ?>
    						<li><?php wp_loginout(); ?></li>
    						<?php wp_meta(); ?>
    					</ul>
    				</li>
    			</ul>
    		</div>
    		<!-- end #sidebar -->
Viewing 3 replies - 1 through 3 (of 3 total)
  • That’s the blogroll part:

    <li>
    <li>
       <h2>Blogroll</h2>
    	<ul>
    <?php get_links(-1, '<li>', '</li>', '', FALSE, 'name', FALSE, FALSE, -1, FALSE); ?>
    	</ul>
    </li>

    and you have “double” opening li!

    Thread Starter goregasm

    (@goregasm)

    Thanks for the fast reply, moshu!

    The code I posted is the default sidebar.php that comes with the theme. If that li is a mistake, it’s done by the author. Using my very limited coder skills, ( but still enough to identify the blogroll part of the code) i found an extra /li too, so i ended up deleting this part, hoping the widgets might work.

    </li>
    			</ul>
    
    			<ul>
    
    				<li>

    Nothing happened, the behavior is the same.

    The theme is not widgetized (unless you didn’t paste the entire sidebar.php up there). To learn how to widgetize it…

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

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Please help: Javascript in sidebar without widgets’ is closed to new replies.