WordPress.org

Ready to get started?Download WordPress

Forums

Twenty Thirteen
[resolved] Child Theme footer.php (14 posts)

  1. quintain
    Member
    Posted 8 months ago #

    Hi
    This is the first time I have used a child theme, please see http://www.greenlabpestcontrol.co.uk

    I need to alter the child theme footer, do I just create a file called footer.php in the child theme folder to accompany the style.css file and copy all contents from original footer.php into it.

    Where in the footer contents or elsewhere do I add the command to centre the footer text: <p style="text-align: center;"></p>

  2. esmi
    Forum Moderator
    Posted 8 months ago #

    do I just create a file called footer.php in the child theme folder

    Yes. Try initially just copying the parent's footer.php file into the child and then start editing the child's version.

    Where in the footer contents or elsewhere do I add the command to centre the footer text

    To centre what footer text?

  3. quintain
    Member
    Posted 8 months ago #

    Hi esmi

    Thank you for your quick reply.
    To centre the existing "Proudly powered by WordPress"

  4. esmi
    Forum Moderator
    Posted 8 months ago #

    You should be able to do this using pure CSS using something like:

    .site-info {text-align:center;}

  5. quintain
    Member
    Posted 8 months ago #

    esmi
    Thank you again I have tried your info
    .site-info {text-align:center;}

    in a variety of places within the footer.php but I cannot get it to centre the text, where am I going wrong ??

    Where should I place the code in the text below.

    <?php
    /**
     * The template for displaying the footer
     *
     * Contains footer content and the closing of the #main and #page div elements.
     *
     * @package WordPress
     * @subpackage Twenty_Thirteen
     * @since Twenty Thirteen 1.0
     */
    ?>
    
    		</div><!-- #main -->
    		<footer id="colophon" class="site-footer" role="contentinfo">
    
    			<?php get_sidebar( 'main' ); ?>
    
    			<div class="site-info">
    
    <a href="http://www.disney-villavacation.com/">site by Richard</a> and
    				<?php do_action( 'twentythirteen_credits' ); ?>
    				<a>" title="<?php esc_attr_e( 'Semantic Personal Publishing Platform', 'twentythirteen' ); ?>"><?php printf( __( 'Proudly powered by %s', 'twentythirteen' ), 'WordPress' ); ?></a>
    			</div><!-- .site-info -->
    		</footer><!-- #colophon -->
    	</div><!-- #page -->
    
    	<?php wp_footer(); ?>
    </body>
    </html>

    [Moderator Note: Please post code & markup between backticks or use the code button. Your posted code may now have been permanently damaged by the forum's parser.]

  6. esmi
    Forum Moderator
    Posted 8 months ago #

    You need to add it to your theme's stylesheet.

  7. quintain
    Member
    Posted 8 months ago #

    My apologies for not picking up immediately your advice.
    I understand you are saying place it in my new style.css file which I built as the first file in my child theme.

    I further understand it should be added immediately after
    /* =Theme customization starts here
    -------------------------------------------------------------- */
    but I must relate the instruction to the footer only so I cannot just use the instructions: .site-info {text-align:center;}

    I would welcome a complete instruction; perhaps:
    .footer-info {text-align:center;}

    Just tried that but didn't work

  8. esmi
    Forum Moderator
    Posted 8 months ago #

    I cannot just use the instructions: .site-info {text-align:center;}

    Yes you can. Please try it.

  9. quintain
    Member
    Posted 8 months ago #

    If all else fails believe in the expert.

    Thank you it did as you knew would work on the footer.

    I don't understand why it has not centred all the site text.

    Again thank you for your help, if you can explain or point me to a link for me to understand why it is only effecting the footer I would be thankful.

    BTW; I created a child theme as a result of your many posts recommending that such be built. I have for years put of doing so for my (to date) preferred theme of Atahualpa but I thought after listening to you I should "bite the bullet" and try it.

    Best regards and thank you.

  10. esmi
    Forum Moderator
    Posted 8 months ago #

    I don't understand why it has not centred all the site text.

    Because the .site-info class is only used in the footer of that theme. If you would like to learn more about the way in which CSS works, I recommend:
    CSS Tutorials
    Learning CSS

  11. quintain
    Member
    Posted 8 months ago #

    Thank you

    Of course, if I had looked further into the css I may have spotted that.
    Again thank you for the time you have spent helping me.

  12. esmi
    Forum Moderator
    Posted 8 months ago #

    Not at all. Glad to have helped. You might also want to try using Firefox with the Firebug add-on for this kind of CSS troubleshooting. It can take hours off this kind of work.

  13. quintain
    Member
    Posted 8 months ago #

    Again, good advice if I started to use firebug which I have had for a heck of a long time and 'promised myself' that I would learn how to use it correctly.

  14. quintain
    Member
    Posted 8 months ago #

    Thanks Esmi

Reply

You must log in to post.

About this Theme

About this Topic

Tags

No tags yet.