Zhenyu QI
asked 9 years ago

In DW Simplex, it seems that images and titles in the silder is un-clickable, you can only click on the arrow icons to switch different imags.
Can you tell me how to make each slideshow image and title clickable, and link to post/page?
Thank you very much!

2 Answers
Jackie Lord
answered 9 years ago

There is settings for slideshow that images can be linked. Simply enter the link for each slide, see screenshot of the settings here: 

Zhenyu QI
replied 9 years ago

I’ve entered the Slide URL, but it doesn’t work. the image is still un-clickable. Can you tell me how to fix it?

Jackie Lord
replied 9 years ago

Can you send your website URL and admin account for further checking (Via private answer below)

DominicStaff
answered 9 years ago

Hi Zhenyu,
To resolve the issue on the homepage slides which were not linked to single posts/pages, please open the slides.php file in the folder path ” wp-content\themes\dw-simplex\inc\slides.php” go to line 238 to line 255.
Replace the following code:

 <div class="carousel-inner">
        <?php
            foreach ($slides as $key => $slide) {
        ?>
        <div<?php if($slide['background']) echo ' style="background: url('.$slide['background'].');"'; ?>>
            <?php if($slide['image']) : ?>
            <img src="<?php echo $slide['image']; ?>" alt="<?php _e( $slide['title'], 'dw-simplex' ); ?>">
            <?php endif; ?>
            <?php if($slide['title']) : ?>
            <div class="carousel-caption">
                <h4><?php _e( $slide['title'], 'dw-simplex' ); ?></h4>
            </div>
            <?php endif; ?>
        </div>
        <?php
            }
        ?>
    </div>

With new code :

 <div class="carousel-inner">
        <?php
        foreach ($slides as $key => $slide) {
            if($slide['url'] != '' && $slide['url'] != '#') {
                $slide_url_begin = '<a href="'.$slide['url'].'">';
                $slide_url_end   = '</a>';
            } else {
                $slide_url_begin = '';
                $slide_url_end   = '';
            }
            ?>
            <div<?php if($slide['background']) echo ' style="background: url('.$slide['background'].');"'; ?>>
                <?php if($slide['image']) : ?>
                        <?php echo $slide_url_begin ?>
                        <img src="<?php echo $slide['image']; ?>" alt="<?php _e( $slide['title'], 'dw-simplex' ); ?>">
                        <?php echo $slide_url_end ?>
                <?php endif; ?>
                <?php if($slide['title']) : ?>
                <div class="carousel-caption">
                    <h4>
                        <?php echo $slide_url_begin ?>
                            <?php _e( $slide['title'], 'dw-simplex' ); ?>
                        <?php echo $slide_url_end ?>
                    </h4>
                </div>
                <?php endif; ?>
            </div>
            <?php
        }
        ?>
    </div>

Hope this helps !
 

Zhenyu QI
replied 9 years ago

Thank you very much. I replace the slides.php with the latest version, and it works fine now.

Powered by DW Question & Answer Pro