-
AuthorPosts
-
August 9, 2017 at 6:20 pm #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.August 9, 2017 at 9:54 pm #836643#cta .flex_column { text-align: center; }
_____________
by the way – enfold offers a lot of possiblities to hook.
on footer php there is thedo_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; }
August 9, 2017 at 11:56 pm #836694This is strange – the phone number font size is only correct on the home page. All other pages it’s the size of p.
August 10, 2017 at 5:05 am #836715Hi,
Just remove the #cta ID to affect all the pages.
Best regards,
John TorvikAugust 10, 2017 at 9:06 am #836825where 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');
August 10, 2017 at 9:15 pm #837148do 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; }
August 10, 2017 at 9:32 pm #837153Thank you. I used your code in the functions file and css but can’t center the text.
August 10, 2017 at 9:36 pm #837156Cool -it works great. Thank you so much. I really don’t know php and can’t write hooks etc.
August 11, 2017 at 5:57 am #837297 -
AuthorPosts
- You must be logged in to reply to this topic.