WordPress.org

Forums

HG Slider
[resolved] slide url, error in flexslider-hg.php (3 posts)

  1. maxgx
    Member
    Posted 2 years ago #

    on line 126 of you're missing a doublequote after the href attribute, which invalidates the slide's url:

    line 126:
    $a_tag_opening = '<a href=' . $url . '" title=" [...]

    should be:
    $a_tag_opening = '<a href="' . $url . '" title=" [...]

    http://wordpress.org/extend/plugins/flexslider-hg/

  2. maxgx
    Member
    Posted 2 years ago #

    while at it, i've added a checkbox to the Slide Settings in case one wants the link to open in a new window:

    around line 125:

    $url = get_post_meta( get_the_ID(), "_slide_link_url", true );
    $target = get_post_meta( get_the_ID(), "_slide_link_target", true );
    if ($target) {
        $a_tag_opening = '<a href="' . $url . '" title="' . the_title_attribute( array('echo' => false) ) . '" target="_blank" >';
    } else {
        $a_tag_opening = '<a href="' . $url . '" title="' . the_title_attribute( array('echo' => false) ) . '" >';
    }

    (not sure that's the cleanest implementation but it does work)

    line 205:

    $slide_link_url = get_post_meta( $post->ID, '_slide_link_url', true );
    $slide_link_target = get_post_meta( $post->ID, '_slide_link_target', true );

    line 209:

    <p>URL: <input type="text" style="width: 90%;" name="slide_link_url" value="<?php echo esc_attr( $slide_link_url ); ?>" /></p>
    <span class="description"><?php echo _e( 'The URL this slide should link to.', 'flexslider_hg' ); ?></span>
    <p><input type="checkbox" name="slide_link_target" <?php if( $slide_link_target == true ) { ?>checked="checked"<?php } ?> /> Opens in new window</p>
  3. Hal Gatewood
    Member
    Plugin Author

    Posted 2 years ago #

    Thanks maxgx, I'll get this stuff added to the plugin.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic