Title: Shortcode to Toogle Excerpt
Last modified: August 21, 2016

---

# Shortcode to Toogle Excerpt

 *  Resolved [janewilliam](https://wordpress.org/support/users/janewilliam/)
 * (@janewilliam)
 * [12 years, 4 months ago](https://wordpress.org/support/topic/shortcode-to-toogle-excerpt/)
 * Hi,
 * I have commented out the code which does Excerpt but i badly need it on some 
   place.
 * Could you please tell me now can i create a new shortcode to turn excerpt on 
   or off?
 * Eg: [ic_add_posts category=’category-slug’ excerpt=’on’]
 * Looking forward to have this or any other solution to toggle excerpt.
 * Thanks
 * [http://wordpress.org/plugins/posts-in-page/](http://wordpress.org/plugins/posts-in-page/)

Viewing 6 replies - 1 through 6 (of 6 total)

 *  Thread Starter [janewilliam](https://wordpress.org/support/users/janewilliam/)
 * (@janewilliam)
 * [12 years, 4 months ago](https://wordpress.org/support/topic/shortcode-to-toogle-excerpt/#post-4510317)
 * Seems no one is interested in this 🙁
 *  [ottomek](https://wordpress.org/support/users/ottomek/)
 * (@ottomek)
 * [12 years, 3 months ago](https://wordpress.org/support/topic/shortcode-to-toogle-excerpt/#post-4510396)
 * Yes I would like to know how to do this too.
 *  Thread Starter [janewilliam](https://wordpress.org/support/users/janewilliam/)
 * (@janewilliam)
 * [12 years, 3 months ago](https://wordpress.org/support/topic/shortcode-to-toogle-excerpt/#post-4510397)
 * I wish i had some solution to do this 🙂
 *  Plugin Author [Eric Amundson](https://wordpress.org/support/users/sewmyheadon/)
 * (@sewmyheadon)
 * [12 years, 3 months ago](https://wordpress.org/support/topic/shortcode-to-toogle-excerpt/#post-4510398)
 * Hi janewilliam and ottomek,
 * Right now, there’s no way to toggle the excerpt on or off via shortcode, but 
   there’s a workaround:
 * Since the plugin uses the `posts_loop_template.php` file from the plugin directory
   as a template for the output for Posts in Page, and you can have multiple output
   templates, you could try this:
    1. copy the `posts_loop_template.php` file to your theme directory before customizing.
    2. by default, the plugin looks for this `posts_loop_template.php` file in the 
       root of your active theme first and, if it doesn’t find it, it looks in the 
       plugin folder in /wp-content/plugins/posts-in-page
    3. once you’ve copied the file into your theme directory, you can change the name
       of this file and then you can specify the template you’d like to use in the 
       shortcode as seen on the [Installation page](http://wordpress.org/plugins/posts-in-page/installation/)–`[
       ic_add_posts template='template-in-theme-dir.php']` – In case you want to style
       your markup, add meta data, etc. Each shortcode can reference a different template.
       These templates must exist in the theme directory.
 * So, in places where you’d like to show the excerpt, you can either use the default
   template, or specify a custom template that shows the exerpt, but for those where
   you’d like no excerpt, or maybe even the full post `the_content()`, you can customize
   the posts_loop_template.php file, save it as a different name in your theme folder,
   and point to it with the shortcode.
 * Make sense?
 * Hope that helps,
    Eric
 *  [ottomek](https://wordpress.org/support/users/ottomek/)
 * (@ottomek)
 * [12 years, 3 months ago](https://wordpress.org/support/topic/shortcode-to-toogle-excerpt/#post-4510399)
 * Thanks. That worked for me.
 *  Plugin Author [Eric Amundson](https://wordpress.org/support/users/sewmyheadon/)
 * (@sewmyheadon)
 * [12 years, 3 months ago](https://wordpress.org/support/topic/shortcode-to-toogle-excerpt/#post-4510400)
 * Terrific. Glad to hear it. 🙂

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Shortcode to Toogle Excerpt’ is closed to new replies.

 * ![](https://ps.w.org/posts-in-page/assets/icon-256x256.png?rev=1596190)
 * [Posts in Page](https://wordpress.org/plugins/posts-in-page/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/posts-in-page/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/posts-in-page/)
 * [Active Topics](https://wordpress.org/support/plugin/posts-in-page/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/posts-in-page/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/posts-in-page/reviews/)

## Tags

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

 * 6 replies
 * 3 participants
 * Last reply from: [Eric Amundson](https://wordpress.org/support/users/sewmyheadon/)
 * Last activity: [12 years, 3 months ago](https://wordpress.org/support/topic/shortcode-to-toogle-excerpt/#post-4510400)
 * Status: resolved