• Resolved appelby1010

    (@thegreatdanton)


    Hi there,

    I am using wordpress to design a website. I bought a theme and installed it. I am trying to fit a small div next to my header logo, so I’m trying to have the same as the attached screenshot. However, I can’t seem to get it to work. I’ve edited the header.php file and the css file but it’s still not showing.

    The header.php code is:

    <div id="top">
                        <?php
                        $logotype = get_option('templatesquare_logo_type');
                        $logoimage = get_option('templatesquare_logo_image');
                        $sitename = get_option('templatesquare_site_name');
                        $tagline = get_option('templatesquare_tagline');
                        if($logoimage == ""){ $logoimage = get_bloginfo('template_url') . "/images/logo.png"; }
                        ?>
                <?php if($logotype == 'textlogo'){ ?>
                <div id="logo">
                        <?php if($sitename=="" && $tagline==""){?>
                                <h1><a href="<?php echo get_option('home'); ?>/" title="<?php _e('Click for Home','templatesquare'); ?>"><?php bloginfo('name'); ?></a></h1>
                            <span class="desc"><?php bloginfo('description'); ?></span>
                        <?php }else{ ?>
                            <h1><a href="<?php echo get_option('home'); ?>/" title="<?php _e('Click for Home','templatesquare'); ?>"><?php echo $sitename; ?></a></h1>
                            <span class="desc"><?php echo $tagline; ?></span>
                        <?php }?>
                </div><!-- end #logo -->
                <div id="media"><p>test</p></div>
                <?php } else { ?>
                        <div id="logo"><a href="<?php echo home_url( '/' ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home"><img src="<?php echo $logoimage;?>" alt="" /></a></div><!-- end #logo -->
                <?php }?>
                </div><!-- end top -->

    and the css code is:

    #top{height:125px;}
    #logo{width: 750px; height: 125px;}
    #media{width: 170px; height: 125px; background: red; margin:0px 0px 0px 760px; float: right;}

    Can anyone please help me to make this media div visible? The link to the site is https://martins.ie/newsite/. Thank you

Viewing 6 replies - 1 through 6 (of 6 total)
  • I notice yr div#media is nested inside yr php if conditional.

    Thread Starter appelby1010

    (@thegreatdanton)

    Hi, I put it outside the php if/else statement and the red box appears but it is below the header. Please have a look at the website now. I want it to appear to the right of the header. The php code is now:

    <div id="top">
    					<?php
    					$logotype = get_option('templatesquare_logo_type');
    					$logoimage = get_option('templatesquare_logo_image');
    					$sitename = get_option('templatesquare_site_name');
    					$tagline = get_option('templatesquare_tagline');
    					if($logoimage == ""){ $logoimage = get_bloginfo('template_url') . "/images/logo.png"; }
    					?>
    			<?php if($logotype == 'textlogo'){ ?>
    			<div id="logo">
    					<?php if($sitename=="" && $tagline==""){?>
    							<h1><a href="<?php echo get_option('home'); ?>/" title="<?php _e('Click for Home','templatesquare'); ?>"><?php bloginfo('name'); ?></a></h1>
    						<span class="desc"><?php bloginfo('description'); ?></span>
    					<?php }else{ ?>
    						<h1><a href="<?php echo get_option('home'); ?>/" title="<?php _e('Click for Home','templatesquare'); ?>"><?php echo $sitename; ?></a></h1>
    						<span class="desc"><?php echo $tagline; ?></span>
    					<?php }?>
    			</div><!-- end #logo -->
    			<?php } else { ?>
    					<div id="logo"><a href="<?php echo home_url( '/' ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home"><img src="<?php echo $logoimage;?>" alt="" /></a></div><!-- end #logo -->
    			<?php }?>
    			<div id="media"><p>test</p></div>
    			</div><!-- end top -->

    there is no need to use the huge margin; thats the point of the float;
    float the 2 divs side by side, one left; one right; make sure u clear the floats after.

    Thread Starter appelby1010

    (@thegreatdanton)

    Thank you very much. I really appreciate your help. I’ve been a good few hours trying to get this sorted. I’ll know now in future. Thanks again

    yw
    its a nice looking site

    Thread Starter appelby1010

    (@thegreatdanton)

    Cheers

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Why isn't this div showing?’ is closed to new replies.