Title: Sidebar if Query
Last modified: August 20, 2016

---

# Sidebar if Query

 *  [ben1000](https://wordpress.org/support/users/ben1000/)
 * (@ben1000)
 * [13 years, 1 month ago](https://wordpress.org/support/topic/sidebar-if-query/)
 * Hey
 * I have this query which I’m using in the sidebar, but when I place it in a php
   widget, the whole sidebar disappears… The code is below and the full sidebar 
   code is in a pastebin here [http://pastebin.com/FdPrsEJN](http://pastebin.com/FdPrsEJN).
 * Any ideas?
 *     ```
       global $wp_query;
       $postid = $wp_query->post->ID;
       if ( ! empty( get_post_meta($postid, 'TourURL', true) ) ) echo '<P>Show Link</P>';
       else echo '<P>No Link</P>';
       wp_reset_query();
       ```
   
 * Thanks

The topic ‘Sidebar if Query’ is closed to new replies.

## Tags

 * [sidebar](https://wordpress.org/support/topic-tag/sidebar/)
 * [widgets](https://wordpress.org/support/topic-tag/widgets/)
 * [wp-query](https://wordpress.org/support/topic-tag/wp-query/)

 * 0 replies
 * 1 participant
 * Last reply from: [ben1000](https://wordpress.org/support/users/ben1000/)
 * Last activity: [13 years, 1 month ago](https://wordpress.org/support/topic/sidebar-if-query/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
