Blog Posts

A few examples of blog posts shortcodes that you can use within any WordPress Page or Post with following shortcode and options:

[blog_posts type="recent" category="all" number="5" content="true" post_meta="true" thumbs="true" trim="250" thumb_width="150" thumb_height="150" only_thumbs="false" post_id="" // Only required if you use type = "related_by_tags" or "related_by_cats" anywhere instead of single post page. ]

Options:

  • type: (default: recent) | Optional
    » recent, popular, random, related_by_tags, related_by_cats
  • category: (default: All) | Optional
    » You can specify cat_ID separated by commas (e.g. 14,55)
  • number: (default: as per WP settings) | Optional
    » Specify number of posts to display
  • content: (default: true) | Optional
    » true, false
  • trim: (default: 250) | Optional
    » Trim content to 250 characters
  • post_meta: (default: false) | Optional
    » true, false
  • thumbs: (default: false) | Optional
    » true, false
  • thumb_width: (default: 150) | Optional
    » Specify width of thumbnail in pixels
  • thumb_height: (default: 150) | Optional
    » Specify hidth of thumbnail in pixels
  • only_thumbs: (default: false) | Optional
    » true, false (if true, only thumbs with specified width and height will be displayed)
  • post_id: (default: current_post_id) | Optional
    » post_ID: Only required if you call related posts (by_tags or by_cats) anywhere outside single post page.
  • class: (default: custom-blog-posts) | Optional

Recent Blog Posts with thumbnails

Proin augue magna, pretium in consectetur in, iaculis et velit!Nunc scelerisque elit sit amet purus tristique at rutrum arcu consectetur. Aliqu...
Ut nibh risus, elementum eget vestibulum quis, fringilla in dolor. Aenean pulvinar nulla nec eros porttitor ut fermentum ante sollicitudin. Duis n...

[blog_posts category="all" number="2" thumbs="true" thumb_width="100" thumb_height="100" trim="80" content="true" post_meta="true"]

Recent Blog Posts without thumbnails

Proin augue magna, pretium in consectetur in, iaculis et velit!Nunc scelerisque elit sit amet purus tristique at rutrum arcu consectetur. Aliqu...
Ut nibh risus, elementum eget vestibulum quis, fringilla in dolor. Aenean pulvinar nulla nec eros porttitor ut fermentum ante sollicitudin. Duis n...

[blog_posts category="all" number="2" thumbs="false" trim="80" content="true" post_meta="true"]

Popular Blog Posts without post meta

Aliquam eget turpis eu velit elementum suscipit.Sed purus lorem, bibendum sed accumsan vel, interdum ac erat. Curabitur eu lacus...
Curabitur felis mauris, ornare placerat accumsan eget, rhoncus ut orci.Curabitur felis mauris, ornare placerat accumsan eget, rhoncus ut orci. Praesent...

[blog_posts type="popular" category="10,14" number="2" thumbs="true" thumb_width="100" thumb_height="100" trim="80" content="true" post_meta="false"]

Popular Blog Posts without post meta

Aliquam eget turpis eu velit elementum suscipit.Sed purus lorem, bibendum sed accumsan vel, interdum ac erat. Curabitur eu lacus...
Curabitur felis mauris, ornare placerat accumsan eget, rhoncus ut orci.Curabitur felis mauris, ornare placerat accumsan eget, rhoncus ut orci. Praesent...

[blog_posts type="popular" category="10,14" number="2" thumbs="false" trim="80" content="true" post_meta="false"]

Random Blog Posts without content

[blog_posts type="random" number="2" thumbs="true" thumb_width="50" thumb_height="50" content="false"]

Random Blog Posts without content

[blog_posts type="random" number="2" thumbs="false" content="false"]

Related Blog Posts by tags

post_id is specified because this shortcode is used on a page instead of single post and we are calling related posts by tags for post_id 171. If you call this shortcode on single post, you won't have to specify the post_id and it will take the current post ID automatically
[blog_posts type="related_by_tags" post_id="171" number="2" thumbs="true" thumb_width="50" thumb_height="50" content="false"]

Related Blog Posts by categories

post_id is specified because this shortcode is used on a page instead of single post and we are calling related posts by cats for post_id 171. If you call this shortcode on single post, you won't have to specify the post_id and it will take the current post ID automatically
[blog_posts type="related_by_cats" post_id="171" number="2" thumbs="true" thumb_width="50" thumb_height="50" content="false"]

Random Posts >> Only Thumbs


[blog_posts type="random" only_thumbs="true" number="6" thumb_width="60" thumb_height="60" ]

Default CSS Code

.ncet-blog-post-content{
    float: left;
    min-width: 150px;
    margin-bottom: 15px;
}
.ncet-blog-post-thumb{
    float: left;
    border: 1px solid #ddd;
}
.ncet-blog-post-thumb img{
    border: 1px solid #FFF;
}
.ncet-blog-post-heading{
    display: block;
    clear: inherit;
    margin-bottom: 5px;
}
.ncet-blog-post-meta{
    clear: both;
    margin: 10px 0px 10px 0px !important;
    line-height: 1;
    padding: 5px 0px;
    border: 1px solid #DDD;
    border-left: 0px;
    border-right: 0px;
    font-size: 75%;
}
.ncet-blog-post-comments{
    float: right;
}
.ncet-blog-post-only-thumbs{
    margin-right: 10px;
    margin-bottom: 10px;
}

Comments are closed.