-
AuthorPosts
-
May 1, 2015 at 1:15 pm #438019
Hi,
I would like to add a class to a Promo Box href link.
I followed the instructions here and that did what I wanted. The only problem is it adds the class to the links on all buttons – I only need it adding to the Promo box links.Is there a way around this?
May 4, 2015 at 5:52 am #438722Hey boxedupmedia!
Could you provide us with a link to the site in question so that we can take a closer look please? Also, what are you trying to alter via CSS?
Regards,
RikardMay 5, 2015 at 12:56 am #439429This reply has been marked as private.May 5, 2015 at 5:52 pm #439894Hi!
Please turn on custom CSS field for ALB elements – http://kriesi.at/documentation/enfold/turn-on-custom-css-field-for-all-alb-elements/ and give your promo box element a custom class and then add following code to Functions.php file in Appearance > Editor
function add_custom_a_class(){ ?> <script> jQuery(window).load(function(){ jQuery('.your-custom-class-here a ').addClass('class-you-would-like-to-add-to-button-here'); }); </script> <?php } add_action('wp_footer', 'add_custom_a_class');
Cheers!
YigitMay 6, 2015 at 10:46 am #440226Hi Yigit, thanks for the help.
I’d already turned on the custom css fields.
I’ve added the above code with my changes but I still can’t get it to work. The class is being added when I check in Firebug (but not there when I view source?), and the code I need for the modal window is being added too – but the modal window doesn’t appear when I click on the link.
This is my code:function add_custom_a_class(){ ?> <script> jQuery(window).load(function(){ jQuery('.booknow-modal a').addClass('fancybox'); }); </script> <div class="fancybox-hidden" style="display: none;"> <div id="book-act-now"> <?php echo do_shortcode('[contact-form-7 id="3615" title="Book Now"]'); ?> </div> <?php } add_action('wp_footer', 'add_custom_a_class');
Is there something I’m missing? The same code added to the header and footer works fine, so I’m wondering if it’s the window.load function that is preventing it from firing.
May 11, 2015 at 1:26 pm #442421Hi!
Do you mind creating a temporary admin login and posting it here privately?
Regards,
YigitMay 11, 2015 at 10:23 pm #442726This reply has been marked as private.May 12, 2015 at 2:29 pm #443008This reply has been marked as private.May 14, 2015 at 2:55 pm #444301Hey!
I tried couple of variations but could not get it to work. If you urgently need it, please consider to hire a freelance developer. I am pretty sure Codeable team can get it to work within an hour or two :)
Cheers!
YigitMay 19, 2015 at 10:50 am #446315Hi, thanks for trying – it’s a bit of a strange one.
-
AuthorPosts
- The topic ‘Add a class to a Promo box button link’ is closed to new replies.