• Resolved peterspliid

    (@peterspliid)


    I have problems updating a theme to make it support widgets. I have read this, but I haven’t been able update successfully so it loaded the style in the stylesheet correctly.

    header.php

    <div id="sidebar">
    	<ul>
    		<li>
    			<h3>Search It!</h3>
    			<div class="sidebar_section">
    				<?php include (TEMPLATEPATH . '/searchform.php'); ?>
    			</div>
    		</li>
    		<li>
    			<h3>Calendar</h3>
    			<div class="sidebar_section">
    				<?php sidebarEventsCalendar();?>
    			</div>
    		</li>
    		<li>
    			<h3>Music</h3>
    			<div class="sidebar_section">
    				<center>
    				<embed src="theme.mp3" width="75" height="45" autostart="1" showcontrols="1" type="application/x-mplayer2" pluginspage="http://www.microsoft.com/windows/windowsmedia/download/"> </embed>
    				</center>
    			</div>
    		</li>
    		<li>
    			<h3>Links</h2>
    			<div class="sidebar_section">
    				<ul>
    					<?php get_links(-1, '<li>', '</li>', '', FALSE, 'id', FALSE, FALSE, -1, TRUE); ?>
    				</ul>
    			</div>
    		</li>
    	</ul>
    </div>

Viewing 6 replies - 1 through 6 (of 6 total)
  • First, do you mean sidebar.php instead of header.php?

    Try adding the dynamic_sidebar function to see if at something at least shows up.

    <div id="sidebar">
    <?php if ( !function_exists('dynamic_sidebar'): ?>
    <?php dynamic_sidebar(); ?>
    <?php endif; ?>
    ...

    Thread Starter peterspliid

    (@peterspliid)

    Yes I meant sidebar.php

    I have already tried to paste that code in different places. It loads the widgets correctly, but not the style in the stylesheet

    Can anyone put it in for me?

    Editing the sidebar.php template will not have any effect on your style.css file. You will need to edit the style sheet to make the sidebar appear the way you want it.

    Thread Starter peterspliid

    (@peterspliid)

    I’m asking you to change sidebar.php to make it support widgets! I know about html and css, and I have changed the css file a lot. The problem was that it doesn’t load ANYTHING from the stylesheet when I’m trying to add the code for widgets myself.

    I just don’t know how to update the sidebar.php. ‘All’ I’m asking is to make someone change the code I posted above so it supports widgets.

    You said that it loads the widgets correctly. That’s all it is supposed to do. The php template doesn’t LOAD anything from the stylesheet. If your theme did not support widgets, then your style.css file won’t contain any references to the appropriate divs and/or classes. You have to add them.

    I’ll recap to make sure I understand. The above code will load the HTML for the widgets but there is no styling for them.

    It sounds like the stylesheets for the widgets are not loading (as Chrisber points outs).

    Read the section “The HTML looks good but the page looks awful in the browser!” in Widgetizing Themes.

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘need help updating sidebar.php’ is closed to new replies.