WordPress.org

Forums

[resolved] Center widget in header.php (2 posts)

  1. fedath
    Member
    Posted 1 year ago #

    Hello everyone!
    I'm relatively new to WordPress and facing an alignment problem with a shortcode from Shellbot's Easy Image Display within my header.
    Basically, it sticks to the bottom-left while I would like it to be at the center (horizontally and vertically). I tried to had some <div align="center"> or <center> code before <?php echo ....> and closing it after the ?>, but it has no effect.
    You can see the issue here:

    http://www.luxurybusiness-asso.com/

    I guess it might not be really complicated but I can't figure out a solution...

    <div class="page-wrap">
    	  <div id="memberlogin" class="leftsidebar"><?php echo do_shortcode('[sb_easy_image num="1" order="random" link="none" column="1" filter="include" ids="4562,4563,4564,4565,4566,4567"]'); ?>
    
    	<p>
    	<?php if (qtrans_getLanguage() == 'en') { ?>
    		<?php if ( !is_user_logged_in() ) { ?>
    			<a class="login-english" href="#login-english">MEMBER LOGIN</a>
    		<?php } else { ?>
    			<a href="/wp-login.php?action=logout&_wpnonce=733b6247fb">LOGOUT</a>
    		<?php } ?>
    
    		<div id="login-english" class="custom-login-box" style="display: none">
    			<form action="<?php echo get_option('home'); ?>/wp-login.php" method="post">
    			<p>
    				<label class="english-login">Username:</label>
    				<input type="text" name="log" id="log" value="<?php echo wp_specialchars(stripslashes($user_login), 1) ?>" size="20" />
    			</p>
    			<p>
    				<label class="english-login">Password:</label>
    				<input type="password" name="pwd" id="pwd" size="20" />
    			</p>
    			<p>
    				<label for="rememberme" class="rememberme"><input name="rememberme" id="rememberme" type="checkbox" checked="checked" value="forever" /> Remember me</label>
    				<input type="hidden" name="redirect_to" value="/welcome-member/" />
    			</p>
    			<p>
    				<input type="submit" name="submit" value="Log In" class="button" />
    			</p><a href="<?php echo get_option('home'); ?>/wp-login.php?action=lostpassword">Lost your password?</a>
    			</form>
    
    		</div>

    Thank you in advance for your help!

    Guillaume

  2. fedath
    Member
    Posted 1 year ago #

    Well, I added the following code instead of the plugin shortcode, and the CSS made the rest of the work.

    <?php
    	$images = array(
    		'Bateau-yacht-retravaille-2-copie.jpg',
    		'Champs-Elysees-Montblanc-4-copie.jpg',
    		'Plane.jpg',
    		'Valise-Louis-Vuitton.jpg',
    		'Vue-Balcon.jpg',
    	);
    	$image  = $images[array_rand($images)];
    	$output = "<img src=\"http://www.luxurybusiness-asso.com/wp-content/uploads/" . $image . "\" alt=\"Refresh browser for random image\" />";
    	echo $output;
    ?>

    Thanks anyway ;)

Topic Closed

This topic has been closed to new replies.

About this Topic