css styling a shortcode

Community Forums Forums Design Tips and Tricks css styling a shortcode

This topic is: resolved

This topic contains 3 replies, has 2 voices, and was last updated by  nutsandbolts 7 months, 3 weeks ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #92948

    greygable
    Member
    Post count: 9

    I originally put this in the “General” forum but think it should of gone in here and as I didn’t know how to move it it’s become a duplicate post; sorry about that.

    I want to style the “return to top” shortcode [footer_custombacktotop] with a “clear: all” css style so that it displays at the bottom of an image instead of beside it but I can’t see how to do it.

    The shortcode works fine but I want it to “clear ” image alignments.

    Can anyone help please?

    Here’s what I’ve added to my functions.php to create the “return to top”

    //* Create a shortcode to display our custom Go to top link
    add_shortcode(‘footer_custombacktotop’, ‘set_footer_custombacktotop’);
    function set_footer_custombacktotop($atts) {
    return ‘
    Return to top of page
    ‘;
    }

    • This topic was modified 7 months, 3 weeks ago by  greygable.
    • This topic was modified 7 months, 3 weeks ago by  greygable.
    #93008

    nutsandbolts
    Moderator
    Post count: 3140

    In your shortcode function, give the link a div class like this:

    //* Create a shortcode to display our custom Go to top link
    add_shortcode(‘footer_custombacktotop’, ‘set_footer_custombacktotop’);
    function set_footer_custombacktotop($atts) {
    return '
    <div class="custombacktotop">Return to top of page</div>
    ';
    }

    Then you can use .custombacktotop in your stylesheet to create style rules for it.


    Andrea Whitmer, Owner, Nuts and Bolts Media
    I provide dev and training services for web designers • Find me on Twitter and Google+

    • This reply was modified 7 months, 3 weeks ago by  nutsandbolts. Reason: missed a quotation mark :)
    • This reply was modified 7 months, 3 weeks ago by  nutsandbolts. Reason: missed a quotation mark :)
    #93042

    greygable
    Member
    Post count: 9

    Thank you Andrea.
    Now why didn’t I think of that!

    #93043

    nutsandbolts
    Moderator
    Post count: 3140

    I’m a firm believer that, once you stare at a site for more than 15 minutes, your ability to think is impaired. :D


    Andrea Whitmer, Owner, Nuts and Bolts Media
    I provide dev and training services for web designers • Find me on Twitter and Google+

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.