Question

I've added a text area to each slide, an external link is called using a custom field, but using target="_blank" doesn't open links in a new window - it just loads the link in the same window. target=_blank works fine on the same page outside of Flexslider, so I'm assuming the link is getting interfered with by Flexslider, but I'm not sure how.

I've checked the FlexSlider properties but I don't see anything regarding this issue. Here is the code I'm using for the flexslider:

<div class="flexslider">    
<ul class="slides">
    <?php  
        query_posts(array(
            'post_type' => 'slides',
            'orderby' => 'menu_order',
            'order' => 'ASC'
        ));
        if ( have_posts() ) while ( have_posts() ) : the_post(); 
    ?>          
    <li>
        <?php if ( has_post_thumbnail() ) {
            the_post_thumbnail('slide');
        } ?>

        <div class="banner-text">
            <h2><?php the_title(); ?></h2>
            <?php the_content(); ?>
            <a href="<?php global $post; $text = get_post_meta( $post->ID, '_cmb_slide_link', true ); echo $text; ?>" target="_blank">Learn More &rarr;</a>
        </div>

    </li>
    <?php endwhile; wp_reset_query();  ?>
</ul>

Was it helpful?

Solution

On line 161 of the source code, a preventDefault is added to each slide when it is clicked.

You would have to find a way of circumventing that or edit the source code to match the required functionality.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top