Shortcode templatation_posts details

Shortcode templatation_posts details

At Templatation.com, in few of our themes we use [templatation_posts] Shortcode. In this article, I will list parameters and other info for this shortcode.

Available parameters for this Shortcode are below (with their default values):

            'template'            => 'templates/tt-posts-sc.php',
            'id'                  => false,
            'posts_per_page'      => get_option( 'posts_per_page' ),
            'post_type'           => 'post',
            'taxonomy'            => 'category',
            'tax_term'            => false,
            'tax_operator'        => 'IN',
            'author'              => '',
            'tag'                 => '',
            'meta_key'            => '',
            'offset'              => 0,
            'order'               => 'DESC',
            'orderby'             => 'date',
            'post_parent'         => false,
            'post_status'         => 'publish',
            'ignore_sticky_posts' => 'no',
            'temptt_show_filters' => 'no',
            'temptt_filter_all' => 'yes',
            'temptt_show_title'   => 'yes',
            'temptt_show_excerpt' => 'yes',
            'temptt_show_readmore'=> 'yes',

So if you just use [templatation_posts] as shortcode, it will display Posts. However, this shortcode is very powerful and you can use it to display almost any content in the way you want. 

Here is an example. Say you want to display Portfolios, then you can use.

[templatation_posts temptt_show_filters='yes' post_type='tt_portfolio' posts_per_page='30' template='templates/tt-portfolio-sc.php']

Above shortcode will grab the template file for displaying content from THEME(or Child theme) templates/tt-portfolio-sc.php file. (more on this later below).

You will also note temptt_show_filters parameter set as yes, so it will display portfolios sortable by clicking on category. As seen here  https://ttplay.wpengine.com/cakeryshop/portfolio/



Now say you want to display portfolios only from certain categories. So you can use this :

[templatation_posts taxonomy='tt_portfolio_cats' temptt_show_filters='yes' post_type='tt_portfolio' posts_per_page='30' tax_term='category1,category2']

Please note the taxonomy and tax_term parameter in above shortcode. The earlier one is name of taxonomy, and latter is slug. So category1,category2 are the slug of the portfolio category that we want to include posts from.



Now lets talk a bit about template file. In few cases you may want to customise the display of the content on the front end. This is very easy as we are using template file for the output of shortcode.

So just create templates folder in your child theme, and copy templates/tt-portfolio-sc.php from parent theme into that and modify tt-portfolio-sc.php as you want.

Hope this helps, and if you have any questions feel free to contact me from https://templatation.com/support/

    • Related Articles

    • Editing Car Details page

      In Carena theme, to edit Cars details page, please edit that car by going to Autos/Selecting and editing that particular car. After that you will find every detail editable. https://cl.ly/33eede0c9b67 From the right side panel of Cars edit page, you ...
    • How to remove date from posts.

      In order to remove date from blog posts and posts block, Please enter below css in wp-admin/appearance/customise/additionalCSS box. On blog page. To remove full block that displays date/author/categories. .blog_area .blog_inner .blog_lift_sidebar ...
    • How to change View Details button text

      In addition to complete Translation guide included in documentation, here is a little tip if you only want to change text of 1 button as some customers wanted. Here are the steps to change the text string. 1) Install this ...
    • Recommended WordPress plugins for additional functionality

      -------------------------- Please note below plugins are not coded or endorsed by Templatation.com, we are not responsible for their effect on your website. Please make sure that you understand that you are using these on your own risk. ...
    • Contact form 7 (CF7) plugin related issues.

      Please note the form is powered by popular Contact form 7 plugin( Which is stand-alone plugin with over  1 million installs) and has no association with the theme. The theme only makes it look good.  To change the email address you want the form ...