Title: Shortcode in widget
Last modified: August 20, 2016

---

# Shortcode in widget

 *  [Mikepro](https://wordpress.org/support/users/mikepro/)
 * (@mikepro)
 * [14 years, 2 months ago](https://wordpress.org/support/topic/shortcode-in-widget/)
 * HI!
 * I would like display a post in widget.
    I add these lines to my function.php 
   file : add_filter( ‘widget_text’, ‘shortcode_unautop’); add_filter( ‘widget_text’,‘
   do_shortcode’);
 * I add this shortcode in my widget :
    [post_list categories=”topnew” thumbs=”default”
   post_content=”excerpt” numberposts=”1″ orderby=”post_date” order=”DESC” offset
   =”0″ link=”false” link_target=”_self”]
 * When I view my page, my post is display in widget correctly but the content of
   my main page display this post too!!!!!!!
    How can I display my post in widget
   but keep my page content unchanged?

The topic ‘Shortcode in widget’ is closed to new replies.

## Tags

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

 * 0 replies
 * 1 participant
 * Last reply from: [Mikepro](https://wordpress.org/support/users/mikepro/)
 * Last activity: [14 years, 2 months ago](https://wordpress.org/support/topic/shortcode-in-widget/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
