Tagged: , ,

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #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?

    #438722

    Hey 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,
    Rikard

    #439429
    This reply has been marked as private.
    #439894

    Hi!

    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!
    Yigit

    #440226

    Hi 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.

    #442421

    Hi!

    Do you mind creating a temporary admin login and posting it here privately?

    Regards,
    Yigit

    #442726
    This reply has been marked as private.
    #443008
    This reply has been marked as private.
    #444301

    Hey!

    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!
    Yigit

    #446315

    Hi, thanks for trying – it’s a bit of a strange one.

Viewing 10 posts - 1 through 10 (of 10 total)
  • The topic ‘Add a class to a Promo box button link’ is closed to new replies.