• I have a nivo slider. It pulls images from a loop that calls the “slider_image” magic field from each post. these images are wrapped in anchor tags that href the permalink. so if you click on the current image – it’ll take you to that posts single page. (streaming video)

    NOW – I also have a play button, ( a small circle in the corner ) but it is not in the loop.
    It sits on top of the slider.

    is there a way I can get the current permalink from that loop – and bring it outside to use in the href for this little button ? so that it links to the current permalink?

    it seems like I should be able to make a variable or something… any ideas ?

    <div class="slider-area round">
    
                <div class="slider-image">
    
                    <div id="slider" class="nivoSlider">                        
    
                        <?php query_posts('post_type=film&category_name=film&showposts=0') ?>
                        <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    
                            <a href="<?php the_permalink() ?>"><img src="<?php echo get ('slider_image') ?>" title="<?php echo get ('project_title') ?>" alt="slider images" />
                            </a>
    
                        <?php endwhile; ?>
    
                        <?php else : ?>
    
                            <h2>Not Found</h2>
    
                        <?php endif; ?>
                        <?php wp_reset_query(); ?>
    
                    </div><!--end slider-->
    
                    <!--script-->
                    <script type="text/javascript">
                        $(window).load(function() {
                        $('#slider').nivoSlider();
                        });
                    </script>
    
                </div><!--end slider image-->
    
                <div class="slider-header">
                    <h2 class="trans"><?php echo get ('slider_headline_line_one') ?><br>
                    <span class="accent"><?php echo get ('slider_headline_line_two') ?></span></h2>
                </div>
    
                <a href="I WANT THAT PERMALINK FROM THAT LOOP ABOVE - HERE" class="circle trans">
                    play
                </a>
    
            </div><!-- end slider-area-->
  • The topic ‘get a current permalink out of the loop for / slider’ is closed to new replies.