Title: use a permalink outside the loop
Last modified: August 21, 2016

---

# use a permalink outside the loop

 *  [Overflow](https://wordpress.org/support/users/acrane/)
 * (@acrane)
 * [12 years, 2 months ago](https://wordpress.org/support/topic/use-a-permalink-outside-the-loop/)
 * Any way to pull a link from the loop and apply it to another element?
    For example,
 *     ```
       <div class="logo"><a href="want my link here">Logo</a></div>
       <?php
       	$args = array(
       		'post_type' => 'post',
       		'post_per_page' => '10'
       	);
       $the_query = new WP_Query( $args ); ?>
       <?php if ( $the_query->have_posts() ) : while ( $the_query->have_posts() ) : $the_query->the_post(); ?>
   
       <li><?php the_title(); ?></li>
   
       <?php endwhile; ?>
       <?php endif; // end have_posts() check ?>
       ```
   
 * I want the link to change on the logo from my 10 post elements.
 * It’s worth mentioning that I want to do this because the list is a rotating carousel.
   So only one list item is visible at a time. So i want the logo to represent the
   permalink of the visible list item.

The topic ‘use a permalink outside the loop’ is closed to new replies.

## Tags

 * [permalink](https://wordpress.org/support/topic-tag/permalink/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 0 replies
 * 1 participant
 * Last reply from: [Overflow](https://wordpress.org/support/users/acrane/)
 * Last activity: [12 years, 2 months ago](https://wordpress.org/support/topic/use-a-permalink-outside-the-loop/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
