Forums

Widgetizing Themes not working (4 posts)

  1. Anonymous
    Unregistered
    Posted 3 years ago #

    Although I have this code in my template, and I'm using wordpress 2.5

    <?php 	/* Widgetized sidebar, if you have the plugin installed. */\
    				if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar() ) : ?>

    It's still not publishing anything automaticly in the sidebar, I have a plugin called Events Calendar who is soposed to be displayed in the sidebar but it's not, I tried replacind all my sidebar php file with this code from Automattic:

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

    But it's still not working, what should I do?

  2. chaoskaizer
    Member
    Posted 3 years ago #

    you need to register the "dynamic_sidebar" before its available inside the template.

    something like ↓ inside your theme functions.php

    if ( function_exists('register_sidebar') )
        register_sidebar(array(
            'before_widget' => '<li id="%1$s" class="widget %2$s">',
            'after_widget' => '</li>',
            'before_title' => '<h2 class="widget-title">',
            'after_title' => '</h2>',
        ));

    I have a plugin called Events Calendar who is supposed to be displayed in the sidebar but it's not

    plugin and widgets is two diff things. If the plugin has a widget for sidebar. You might want to check the widgets page (admin dashboard > design > widgets) and activate the custom widgets.

  3. Anonymous
    Unregistered
    Posted 3 years ago #

    I added functions.php from the default template in my template folder and it works... thanks a lot.

  4. chaoskaizer
    Member
    Posted 3 years ago #

    cheers, [resolved]

Topic Closed

This topic has been closed to new replies.

About this Topic