Title: Shortcode Ultimate Posts Templates
Last modified: August 21, 2016

---

# Shortcode Ultimate Posts Templates

 *  [Muskie73](https://wordpress.org/support/users/muskie73/)
 * (@muskie73)
 * [12 years, 5 months ago](https://wordpress.org/support/topic/shortcode-ultimate-posts-templates/)
 * I revised a Posts template to create a new custom one, stuck it in the templates
   folder, pointed the shortcode to it, and it was working until we updated the 
   plugin, which removed the custom template file. I uploaded it back and all is
   OK. I want to prevent this from happening in future, how can we do that? I tried
   putting the file into a custom folder in the theme directory, but couldn’t get
   the path in the shortcode to work.
    Thanks!
 * [http://wordpress.org/plugins/shortcodes-ultimate/](http://wordpress.org/plugins/shortcodes-ultimate/)

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

 *  [hewijess](https://wordpress.org/support/users/hewijess/)
 * (@hewijess)
 * [12 years, 3 months ago](https://wordpress.org/support/topic/shortcode-ultimate-posts-templates/#post-4419625)
 * I have this exact same question and have not been able to find an answer.
 *  [darinroman](https://wordpress.org/support/users/drome22/)
 * (@drome22)
 * [12 years, 2 months ago](https://wordpress.org/support/topic/shortcode-ultimate-posts-templates/#post-4419639)
 * I was looking into this same issue. I was unable to find any documentation on
   creating custom post templates, however, the Shortcodes Ultimate plugin code 
   reveals the solution.
 * Simply copy the ‘templates’ folder from the plugin directory to your active theme
   directory. You can then edit the templates all you want and they will be safe
   from plugin updates.
 * So, if your theme is ‘twentytwelve’ copy the folder:
 * From:
    /wp-content/plugins/shortcodes-ultimate/templates
 * To:
    /wp-content/themes/twentytwelve/templates
 * Shortcodes Ultimate will first look for the post template(s) in the stylesheet
   directory (child theme if used), then in the template directory (parent theme),
   then in its own plugin directory.
 * I found the following conditional template loader around line 1257 of: ‘wp-content/
   plugins/shortcodes-ultimate/inc/core/shortcodes.php’:
 *     ```
       // Search for template in stylesheet directory
       if ( file_exists( STYLESHEETPATH . '/' . $atts['template'] ) ) load_template( STYLESHEETPATH . '/' . $atts['template'], false );
       // Search for template in theme directory
       elseif ( file_exists( TEMPLATEPATH . '/' . $atts['template'] ) ) load_template( TEMPLATEPATH . '/' . $atts['template'], false );
       // Search for template in plugin directory
       elseif ( path_join( dirname( SU_PLUGIN_FILE ), $atts['template'] ) ) load_template( path_join( dirname( SU_PLUGIN_FILE ), $atts['template'] ), false );
       // Template not found
       else echo '<p class="su-error">Posts: ' . __( 'template not found', 'su' ) . '</p>';
       ```
   
 *  [pbeckley](https://wordpress.org/support/users/pbeckley/)
 * (@pbeckley)
 * [12 years, 2 months ago](https://wordpress.org/support/topic/shortcode-ultimate-posts-templates/#post-4419641)
 * This info is actually in the plugin interface when setting up the Custom posts
   query with customizable template options:
 * “Relative path to the template file. Default templates is placed under the plugin
   directory (templates folder). You can copy it under your theme directory and 
   modify as you want. You can use following default templates that already available
   in the plugin directory”
 * I still can’t seem to get it to recognize post formats through get_template_part,
   which seems like it should be a pretty basic thing, given that it’s core (and
   bragged about) functionality in WP.
 *  [davelee811](https://wordpress.org/support/users/davelee811/)
 * (@davelee811)
 * [12 years, 1 month ago](https://wordpress.org/support/topic/shortcode-ultimate-posts-templates/#post-4419644)
 * Am I correct in that it doesn’t use the ‘default’ template copied to the theme
   folder without renaming and declaring template path/name, within the su_post 
   shortcode?
    Nor does it list theme’s templates in the su-generator UI?
 * If so- could next update address..
    – to use theme’s ‘templates/default-loop.
   php’ without having to include template attribute? – list theme’s templates when
   creating post shortcode with the generator.
 * Great plugin, thanks!

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

The topic ‘Shortcode Ultimate Posts Templates’ is closed to new replies.

 * ![](https://ps.w.org/shortcodes-ultimate/assets/icon-256x256.gif?rev=2547563)
 * [Shortcodes Ultimate - Content Elements](https://wordpress.org/plugins/shortcodes-ultimate/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/shortcodes-ultimate/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/shortcodes-ultimate/)
 * [Active Topics](https://wordpress.org/support/plugin/shortcodes-ultimate/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/shortcodes-ultimate/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/shortcodes-ultimate/reviews/)

## Tags

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

 * 4 replies
 * 5 participants
 * Last reply from: [davelee811](https://wordpress.org/support/users/davelee811/)
 * Last activity: [12 years, 1 month ago](https://wordpress.org/support/topic/shortcode-ultimate-posts-templates/#post-4419644)
 * Status: not resolved