Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #25329

    Candace Duffy Jones
    Participant

    I want to link a font awesome icon to a lightbox gallery, but you can’t enter html code in the title attribute. Is there another way around this? When I bought this plugin I didn’t realize it would be using the gallery shortcode for the link.

    This is the code I have right now:

    <a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>"><i class="fa fa-link"></i></a>
                  <?php $image_ids = get_field('gallery', false, false);
                  $shortcode = '[' . 'gallery type="hidden" ids="' . implode(',', $image_ids) . '" mode="text" title="<i class=\'fas fa-search-plus\'></i>" show_description="0" show_count="0"]';
                  echo do_shortcode( $shortcode ); ?>

    But that just displays the icon code and not the icon.

    #25368

    Candace Duffy Jones
    Participant

    Figured out. I used this:

    <a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>"><i class="fa fa-link"></i></a>
                  <?php $image_ids = get_field('gallery', false, false);
                  $shortcode = '[' . 'gallery type="hidden" ids="' . implode(',', $image_ids) . '" mode="text" title="" show_description="0" show_count="0"]';
                  echo do_shortcode( $shortcode ); ?>

    and styled it with css by using:
    font-family: FontAwesome;

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