Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #836539

    I am trying to center the text (phone #) in a new div I created above the footer here: http://ustriminc.com/walt/
    using: add_action(‘get_footer’, ‘add_cta_before_footer’);
    function add_cta_before_footer(){
    ?>
    <div class=”container_wrap” id=”cta”>
    <div class=”container”>
    <?php echo do_shortcode(“[av_one_full first]248.649.8604[/av_one_full]“); ?>
    </div>
    </div>
    <?php
    }
    and:
    #cta {
    background-color:#f8f8f8 !important;
    border-top-color:#dedede;
    padding-bottom:20px;
    padding-top: 20px;
    font-size: 26px;
    margin: auto;
    color: #555555;
    }
    The margin:auto; does not center the text.

    #836643
    #cta .flex_column {
        text-align: center;
    }

    _____________

    by the way – enfold offers a lot of possiblities to hook.
    on footer php there is the do_action( 'ava_before_footer' ); so it could be a bit simpler to use this:

    for child-theme functions.php

    function custom_before_footer_div() {
    ?>
    <div id="cta" class="container_wrap">
       <div class="container">
           248.649.8604
       </div>
    </div>
    <?php
    }
    add_action('ava_before_footer' , 'custom_before_footer_div');

    for quick css

    #cta.container_wrap {
        background: #f8f8f8 none repeat scroll 0 0;
        border-top-color: #dedede;
    }
    
    #cta .container {
        font-size: 36px;
        color: #555;
        padding: 20px;
        text-align: center;
    }
    #836694

    This is strange – the phone number font size is only correct on the home page. All other pages it’s the size of p.

    #836715

    Hi,

    Just remove the #cta ID to affect all the pages.

    Best regards,
    John Torvik

    #836825

    where did you inserted your code above ? because there is no p tag in your code – so where did it come from in the about page f.e. ?

    if you use my code in functions.php of your child-theme it will affect all pages and post

    function custom_before_footer_div() {
    ?>
    <div id="cta" class="container_wrap">
       <div class="container">
          Phone:  248.649.8604
       </div>
    </div>
    <?php
    }
    add_action('ava_before_footer' , 'custom_before_footer_div');
    #837148

    do not forget the css above to quick css (remove the other things you inserted concerning to that issue)

    #cta.container_wrap {
        background: #f8f8f8 none repeat scroll 0 0;
        border-top-color: #dedede;
    }
    
    #cta .container {
        font-size: 36px;
        color: #555;
        padding: 20px;
        text-align: center;
    }
    #837153

    Thank you. I used your code in the functions file and css but can’t center the text.

    #837156

    Cool -it works great. Thank you so much. I really don’t know php and can’t write hooks etc.

    #837297

    Hi,

    Great, glad you got it working. Please let us know if you should need any further help on the topic or if we can close it.

    Best regards,
    Rikard

Viewing 9 posts - 1 through 9 (of 9 total)
  • You must be logged in to reply to this topic.