Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I'm using the Fusion Elegant Theme, but am having an issues with the featured slider.

I added custom "read more" links for my slides. However, where a featured image is assigned, clicking on that image does not link to my specified custom link, but merely navigates to the featured post.

I have posted what I believe to be the relevant code below.

Any help is greatly appreciated!

et_get_option('fusion_feat_pages') ),
                            'posts_per_page'    => (int) $featured_num
                        )
                )   
            );
        }

        while ( $featured_query->have_posts() ) : $featured_query->the_post();
            $post_id            = get_the_ID();

            $bg = et_get_option( 'fusion_bg_image' );
            if ( '' == $bg ) $bg = get_template_directory_uri() . '/images/bg_fusion.jpg';

            $slide_bg           = ( $slide_bg_url = get_post_meta( $post_id, '_et_slide_bg', true ) ) && '' != $slide_bg_url ? $slide_bg_url : $bg;

            $slide_subtitle     = get_post_meta( $post_id, '_et_slide_subtitle', true );
            $slide_more_text    = get_post_meta( $post_id, '_et_slide_more_text', true );
            $slide_more_link    = get_post_meta( $post_id, '_et_slide_more_link', true );
            $more_link          = '' != $slide_more_link ? $slide_more_link : get_permalink();
    ?>
        <div class="et-slide"<?php if ( '' != $slide_bg ) echo ' style="background-image: url(' . esc_url( $slide_bg ) . ');"'; ?>>
            <div class="container clearfix">
                <div class="description">
                    <h2><a href="<?php echo esc_url( $more_link ); ?>"><?php the_title(); ?></a></h2>
                <?php if ( '' != $slide_subtitle ) { ?>
                    <p class="subtitle"><?php echo esc_html( $slide_subtitle ); ?></p>
                <?php } ?>

                    <p><?php truncate_post( 180 ); ?></p>

                    <a href="<?php echo esc_url( $more_link ); ?>" class="more">
                        <?php if ( '' != $slide_more_text ) echo esc_html( $slide_more_text ); else esc_html_e( 'Read More', 'Fusion' ); ?>
                    </a>
                </div> <!-- .description -->

            <?php
                $width = (int) apply_filters( 'slider_image_width', 535 );
                $height = (int) apply_filters( 'slider_image_height', 572 );
                $title = get_the_title();
                $thumbnail = get_thumbnail( $width, $height, '', $title, $title, false, 'Featured' );
                $thumb = $thumbnail["thumb"];
            ?>
                <div class="featured-image">
                    <a href="<?php the_permalink(); ?>"><?php print_thumbnail( $thumb, $thumbnail["use_timthumb"], $title, $width, $height, '' ); ?></a>
                </div> <!-- .featured-image -->
            </div> <!-- .container -->
share|improve this question

1 Answer 1

Look at the specified link within the featured-image in the last part of your snippet. You'll have to update the_permalink() with your custom link, too:

<div class="featured-image">
    <a href="<?php echo esc_url( $more_link ); ?>"><?php print_thumbnail( $thumb, $thumbnail["use_timthumb"], $title, $width, $height, '' ); ?></a>
</div> <!-- .featured-image -->
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.