• AyeAaron

    (@ayeaaron)


    I have a registration box in my sidebar and the spacing between the top box and the top of the side bar is too much and the space between the bottom box and the Registration button is too much too. Do I adjust it in the sidebar.php?

    <div class="fr span-10 side">
    					<div class="side-line">
    						<div class="fr span-5-6">
    							<div class="paddings">
    								<?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar(1) ) : ?>
    
        <!--sidebox start -->
    						        <div class="widget_categories">
    						            <h3 class="block title-1"><?php _e('Knifelike DEPTS.'); ?></h3>
    						            <ul>
    						                <?php wp_list_cats('sort_column=name&optioncount=1&hierarchical=0'); ?>
    						            </ul>
    						        </div>
    						        <!--sidebox end -->
    
    								<?php endif; ?>
    							</div>
    						</div>
    						<div class="fl span-5-6">
    							<div class="paddings">
    								<?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar(2) ) : ?>
    
    								<!--sidebox start -->
    								<div class="widget_meta">
    									<h3 class="block title-1">SIGN IN / REGISTER</h3>
    									<ul>
    
    						                <li class="login"><?php wp_loginout(); ?></li>
    									</ul>
    								</div>
    								<!--sidebox end -->
    
    								<?php endif; ?>
    							</div>
    						</div>
    						<div class="clr side-line">&nbsp;</div>
    					</div>
    					<div class="paddings border-top">
    						<?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar(3) ) : ?>
    
    				        <!--sidebox start -->
    						<div class="widget_recent_entries">
    							<h3 class="block title-1"><?php _e('Recent Products'); ?></h3>
    							<ul>
    								<?php $side_posts = get_posts('numberposts=10'); foreach($side_posts as $post) : ?>
    								<li><a href= "<?php the_permalink(); ?>"><?php the_title(); ?></a></li>
    								<?php endforeach; ?>
    							</ul>
    						</div>
    				        <!--sidebox end -->
    
    						<?php endif; ?>
    					</div>
    				</div>
Viewing 1 replies (of 1 total)
  • Thread Starter AyeAaron

    (@ayeaaron)

    Wait. here is the plug-in code:

    <?php
    /*
    Plugin Name: Registration Form Widget
    Plugin URI:  http://www.wordpressmania.it/registration-widget/
    Description: Add a registration form to your sidebar
    Author: Stefano Garuti
    Version: 1.0
    Author URI: http://www.wordpressmania.it/
    */
    
    /**
     * Display Registration widget.
     *
     * Displays Registration Form.
     *
     * @param array $args Widget arguments.
     */
    function registration_widget($args) {
    	global $pagenow;
    
    	if ($_GET['action'] != 'register'){ // we don't want to display this form in the Registration Page
    	//mydebug($args);
    	extract($args);
    	$options = get_option('widget_registration');
    	$title = empty($options['title']) ? __('') : apply_filters('widget_title', $options['title']);
    ?>
    		<?php echo $before_widget; ?>
    			<?php echo $before_title . $title . $after_title; ?>
    
    		<?php the_registration_form($args);	?>
    		<?php echo $after_widget; ?>
    <?php
    }
    }
    function the_registration_form($args=null) {
    	$register_button=__('Register');
    	if(isset($args['register_button'])) $register_button = $args['register_button'];
    		?>
    		<form class="registerform" name="registerform" id="registerform" action="<?php echo site_url('wp-login.php?action=register', 'login_post') ?>" method="post">
    
    	<p>
    			<label><?php _e('Username') ?>:</label><br />
    			<input tabindex="1" type="text" name="user_login" id="user_login" class="input" value="<?php echo attribute_escape(stripslashes($user_login)); ?>" size="20" tabindex="10" />
    			<br />
    
    			<label for="user_email" id="user_email"><?php _e('E-mail') ?>:</label><br />
    			<input tabindex="2" type="text" name="user_email" id="user_email" class="input" value="<?php echo attribute_escape(stripslashes($user_email)); ?>" size="25" tabindex="20" />
    			<br />
    		</p>
    
    			<?php do_action('register_form'); ?>
    		<p id="reg_passmail">
    			<?php _e('') ?>
    		</p>
    		<p class="submit"><input tabindex="4" type="submit" name="wp-submit" id="wp-submit" value="<?php echo($register_button) ?>" tabindex="100" /></p>
    	</form>
    	<?php
    }
    /**
     * Display and process registration widget options form.
     *
     */
    function registration_widget_control() {
    	$options = $newoptions = get_option('widget_registration');
    	if ( isset($_POST["registration-submit"]) ) {
    		$newoptions['title'] = strip_tags(stripslashes($_POST["registration-title"]));
    	}
    	if ( $options != $newoptions ) {
    		$options = $newoptions;
    		update_option('widget_registration', $options);
    	}
    	$title = attribute_escape($options['title']);
    ?>
    			<p><label for="registration-title"><?php _e('Title:'); ?> <input class="widefat" id="registration-title" name="registration-title" type="text" value="<?php echo $title; ?>" /></label></p>
    			<input type="hidden" id="registration-submit" name="registration-submit" value="1" />
    <?php
    }
    
    function registration_widget_init(){
    	register_sidebar_widget("Registration Form", "registration_widget");
    	register_widget_control("Registration Form","registration_widget_control");
    }
    
    add_action("plugins_loaded", "registration_widget_init");
    ?>
Viewing 1 replies (of 1 total)
  • The topic ‘Adjust spacing in a widget, sidebar’ is closed to new replies.