Display posts in Sidebar

This post will introduce you how to use Content Views Pro to display latest posts, most popular posts… in Sidebar. There is only 2 simple steps:

Step 1: Create a View to query posts you want to display in Sidebar.
You should set custom size for Thumbnail (such as 60 x 60) to make them display nice in narrow space of Sidebar.

Step 2: Visit Widgets management page by clicking on Widgets (under Appearance menu), drag and drop a Text widget to a desired Sidebar, then paste View shortcode to content area of that widget. Finally, don’t forget to click Save button.



If you want to display multiple Views in Sidebar (such as Latest posts and Most popular posts), we still need 2 steps as above. But:

– In Step 1, you have to create 2 different Views. The first View is used to query latest posts, with following Order setting:
Latest posts

The second View is used to query most popular posts, with following Order setting:
Most popular posts

If you didn’t see View count option, please do step 1, 2 on this document.

– In Step 2, paste this HTML code to content area of Text widget
(replace VIEW_ID_1 and VIEW_ID_2 with IDs of 2 Views in Step 1)

<div class="pt-cv-wrapper">
<ul class="nav nav-tabs pt-cv-client-tab">
    <li class="active"><a href="#latest" data-toggle="tab">Latest posts</a></li>
    <li><a href="#popular" data-toggle="tab">Most popular posts</a></li>
<div class="tab-content">
    <div id="latest" class="tab-pane active">[pt_view id="VIEW_ID_1"]</div>
    <div id="popular" class="tab-pane">[pt_view id="VIEW_ID_2"]</div>

Then you will have output like this.

Best regards,