0

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 -->
0

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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