• Resolved mattsinc

    (@mattsinc)


    Hi, just wondering if it’s possible to break the auto-generated copyright line into 3.

    I ideally want 3 lines, one each for:

    Copyright
    Contact info
    Link to theme horse

    Personally I find dealing with footers in wordpress particularly fiddly.

    Can any one help? Thanks in advance.

    http://www.matthewsinclair.net

Viewing 10 replies - 1 through 10 (of 10 total)
  • Try this ( put in below @import line of your child theme’s style.css )

    .copyright a:after {
    	content: "";
    	display: block;
    }
    Thread Starter mattsinc

    (@mattsinc)

    Thanks, I tried that but nothing has changed.

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Clear your cache.

    Thread Starter mattsinc

    (@mattsinc)

    Thanks Andrew, that worked.

    If I was a massive pedant (!) I think I would probably prefer Email/Tel on the second line and then the link to Theme Horse on the third line, but not sure how to tell it where to break?

    M

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Can’t see how that’s possible with CSS.

    Also, it seems like you got footer.php already edited in child theme, why don’t you just put in <br /> ?

    Thread Starter mattsinc

    (@mattsinc)

    The <br /> helps break the text onto a fourth line, but I can’t see how to keep tel/email on one line (to be honest, though, it’s not the end of the world). The code in the child theme is as follows (it’s within functions.php):

    <?php
    
    // Remove old copyright text
    add_action( 'init' , 'mh_remove_copy' , 15 );
    function mh_remove_copy() {
            remove_action( 'attitude_footer', 'attitude_footer_info', 30 );
    }
    
    // Add my own copyright text
    add_action( 'attitude_footer' , 'mh_footer_info' , 30 );
    function mh_footer_info() {
       $output = '<div class="copyright">'.'Copyright © [the-year] [site-link] Email: <a href="mailto:hello@matthewsinclair.net"> hello@matthewsinclair.net</a> Tel: +44 (0)20 7630 9271 <br />
    Source theme: <a href="http://themehorse.com" target=blank>Theme Horse</a>.'.'</div><!-- .copyright -->';
       echo do_shortcode( $output );
    }
    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Add:

    .copyright a:nth-child(2):after {
      float: left;
    }

    Actually, using <br /> you got 100% control on where to cut to new line. ( so you won’t need any CSS to do that ).

    Thread Starter mattsinc

    (@mattsinc)

    @andrew – thank you, that worked. 🙂 In the interests of me trying to learn and get a bit more self-sufficient, can you just explain what that code is doing? Useful for me to know in case I get the same issue on another site. Basic CSS stuff I can do but this was certainly beyond me 😛

    @paul – the issue I was having, though, is that I couldn’t keep the contact line intact in the first place (it was automatically breaking after the email and before the telno).

    Anyway, thanks both for helping with this issue and I’m happy with how my footer is now looking. It also looks a lot better on tablet/phone now too, rather than when it was one long line and I had no control where it split 🙂

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Breaking the copyright/footer line onto more than one line?’ is closed to new replies.