• I’m trying to put text (e.g. a copyright notice) that runs across the bottom of each page in my website. But in twentyten the footer has four widgetized areas. I’ve put the copyright text in the ‘text widget’ and dragged that into one of the widgetized footer areas but of course the text just runs across a quarter of the page (stuck in one of the widgetized areas). I don’t want to unwidgetize the four footer areas because I want to use them for other widgets. Can I get text to go below this and centre it? Thanks!

Viewing 12 replies - 1 through 12 (of 12 total)
  • You could put it below the widgets by editing the footer.php file — but be sure you are using a Child Theme to do so. Then use CSS to center it.

    you might need to edit footer.php directly and add the copyright notice either before, between, or after the site-info and site-generator divs.

    Thread Starter clovis

    (@clovis)

    Thank you @alchymyth and @wpyogi ! I’ve found the location in my child theme’s footer.php but have no idea what to write to get the text I want to show up! I’ve been trying to work out the solution but failed so far! I don’t know enough about how php and css works ??

    In my style.css file I have:

    #site-generator{display: none;}

    and this in footer.php

    get_sidebar( 'footer' );
    ?>
    
    			<div id="site-info">
    				<a href="<?php echo home_url( '/' ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home">
    					<?php bloginfo( 'name' ); ?>
    				</a>
    			</div><!-- #site-info -->
    
    			<div id="site-generator">
    				<?php do_action( 'twentyten_credits' ); ?>
    				<a href="<?php echo esc_url( __( 'https://www.ads-software.com/', 'twentyten' ) ); ?>" title="<?php esc_attr_e( 'Semantic Personal Publishing Platform', 'twentyten' ); ?>" rel="generator"><?php printf( __( 'Proudly powered by %s.', 'twentyten' ), 'WordPress' ); ?></a>
    			</div><!-- #site-generator -->
    
    		</div><!-- #colophon -->
    	</div><!-- #footer -->

    is there somewhere I can insert the actual text I want to show on the page?

    Probably just adding something like this should be fine:

    <div class="my-copyright">Copyright blah blah blah</div>

    And then add something to your CSS like:

    .my-copyright {
       width: XXpx;
       margin: 0 auto 0;
    }

    Set the width to the width of the copyright text and adjust the 0 margins (top and bottom) accordingly. The auto (left and right) on the margin centers the div.

    Check the edited code below, should work.

    get_sidebar( 'footer' );
    ?>
    
    			<div id="site-info">
    				<a href="<?php echo home_url( '/' ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home">
    					<?php bloginfo( 'name' ); ?>
    				</a>
    			</div><!-- #site-info -->
    
    			<div id="site-generator">
    				<?php do_action( 'twentyten_credits' ); ?>
    				<a href="<?php echo esc_url( __( 'https://www.ads-software.com/', 'twentyten' ) ); ?>" title="<?php esc_attr_e( 'Semantic Personal Publishing Platform', 'twentyten' ); ?>" rel="generator"><?php printf( __( 'Proudly powered by %s.', 'twentyten' ), 'WordPress' ); ?></a>
    
    <p>Copyright &copy; <?php date('Y'); ?> by Your Company Name</p>
    			</div><!-- #site-generator -->
    
    		</div><!-- #colophon -->
    	</div><!-- #footer -->

    Thread Starter clovis

    (@clovis)

    Thank you v much! I’m trying @wpyogi ‘s solution first, then I’ll try @alieneila ‘s.

    I put

    <div class="my-copyright">Copyright blah blah blah</div> after </div><!-- #site-info --> and before <div id="site-generator">

    in my child theme’s footer.php

    @wpyogi so far I’ve got the text to show on the page and run along the bottom (not get stuck in a widget area) but the first part of my text starts one line above and way over on the right and the rest starts right over on the left hand side, one line down.

    I tried different positions of the php in footer.php but that made no difference, all looked the same (except if you put it after the wrapper)

    Then I tried all different values for margin (I don’t know what the standard values for margins are! :s) and it still won’t centre or go on one line

    .my-copyright {
       width: 700px;
       margin: 0 auto 0;
    }

    I’m looking up margin values now to see what what values they should have but if you could tell me where I’m going wrong that’d be great!

    Without seeing your site I can’t really diagnose, however since you’re setting the width, the margin doesn’t need to change, add text-align: center; to your .my-copyright style.

    Thread Starter clovis

    (@clovis)

    @alieneila Ah great, thanks! Now the text is on one line and almost in the centre, but still a little more over to the left. Is there a way to move it over to the right a bit more? e.g. so that it centers in relation to the banner (in twentyten theme)

    It’s not good coding to use text-align for divs. If you use p tags for the text rather than div, the text-align should work find.

    But as already mentioned, without a link to the site, kinda hard to be much more specific.

    No need for margins — only if appearance dictated them.

    More than likely the 700px width you set it to is too narrow for your site (though the margin should be centering that as well). Try setting it to 100% or increasing it above 700px. If that doesn’t work, can you link me your site and I can tell you more exactly what to do?

    Thread Starter clovis

    (@clovis)

    weird, I put text-align:right; instead of center and now it’s centered in relation to the banner.

    For other ultra noobs like me, style.css now has:

    .my-copyright {
       width: 700px;
       margin: 0;
    text-align: right;
    }

    Thanks @alieneila and @wpyogi for the solution! ??

    Thread Starter clovis

    (@clovis)

    oh didn’t see these replies! is it bad to leave it as text-align: right; ?

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘how to put copyright text below the four widgetized footer areas in twentyten’ is closed to new replies.