Shopping Cart (0)

News Show Pro as a shortcode

Our News Show Pro widget for WordPress has long been an excellent way to create product and article showcases; its extensive options allow for link previews, images with article overlays, titles and news snippets, all pulled from the source of your choice, whether your latest posts, latest posts in a specific category, specific posts, or WooCommerce products and categories.

However, as it was a widget, it had to be manually placed and configured after theme installation, or you needed to use our quickstart package to create a new installation of WordPress with the widgets already configured.

Our new page-based frontpage, introduced with StoreFront, allows News Show Pro to be embedded on a page via a shortcode, with all the options and flexibility that you’ve come to expect. This means that the settings from our demo page can be imported or replicated in moments for quick, comfortable configuration. Every option usually found in the widget options may be defined in the shortcode; any options not directly specified will be left at their default values.

How do I display my WooCommerce products on the frontpage like in the demo for StoreFront?

Before proceeding you should ensure you are familiar with how to create the layout of the tabs on the demo frontpage; a guide to this may be found here.

Once you have created your tab pages, you need to add the shortcode that will display News Show Pro. The basic shortcode, that will display images of your most-recently added products with title, pricing and an ‘ADD TO CART’ button may be displayed using the following shortcode:


Warning! There is no posts to display. Please check your widget settings


The majority of the options in the shortcode do not need to be changed, so you can leave them as they are. However, you may wish to change the ‘data_source_type’ attribute to point to a specific category or SKUs (the basic configuration above will take all new products from all categories). To do so, follow the below instructions:

Displaying specific products only

To display only products that you specify, change the attribute from:




This tells NSP to take specific articles. Now, you’ll need to define the products you want to show. After the data_source_type attribute in the shortcode, add the following new attribute:


Where the ’sku-code’ is the SKU code for the product(s) in WooCommerce. Our amended shortcode may look like this :


Warning! There is no posts to display. Please check your widget settings


Displaying latest products from a category

To display the latest products from a specific category only, which is very useful if you want to have multiple tabs each with a different selection of products, you should change the data_source_type attribute to:


This will tell News Show Pro to take details from categories. To specify which categories, add the following attribute to the shortcode:


Where ‘X’ is the category ID(s) (found in the category URL) from WooCommerce, separated by a comma if there is more than one. To find the category ID, in your WordPress backend click on Products>Categories on the menu on the left of the screen, and click on the category you wish to display. Once on the category page in your backend, check the URL; you should see something similar to:

Notice that part of the URL is “ID=99”; the number that appears after the equals sign is the category ID. So in this example, the category would be “99”, and our amended code will look something like this:


Warning! There is no posts to display. Please check your widget settings


How do I display my latest articles in the ‘From Our Blog’ section of the StoreFront frontpage?

As with our WooCommerce product display, the blog section of the frontpage uses NSP as a shortcode to display the latest posts from your WordPress ‘Posts’ section. To achieve this layout, paste the following shortcode into the WYSIWYG editor for the page (or frontpage subpage, if you want the display to appear on your frontpage) you want display your blog posts on:


Warning! There is no posts to display. Please check your widget settings


You may notice that unlike the NSP shortcode for WooCommerce, there is no data_source_type or data_source attribute. This is because the default setting of News Show Pro is to display your latest posts, so no changes are necessary. However, you may wish to specify particular posts to display, or display the latest posts from a particular category. To make these changes, follow the below instructions.

Displaying specific posts

To display only specific posts, you will need to add the data_source_type attribute to the base shortcode to specify where News Show Pro should look for posts to display. For specific posts, the attribute should look like this:


Once done, you’ll also need to tell NSP specifically which posts to show; this can be done using the data_source attribute. Add the following attribute to the shortcode:


Where x is the post slug(s) you wish to display, with each slug separated by a comma.

Displaying posts from a category

To display posts from a particular category, you would again need to add the data_source_type and data_source attributes to the base example shortcode. To specify that NSP should take posts from categories, use the following attribute:


Then, to tell NSP exactly which category to take posts from, add this attribute:


Where x is the category slug/category ID you wish to display, separated by a comma if you wish to display posts from multiple categories.

Want to go deeper?

The extensive options of our News Show Pro widget are all definable in the shortcode, which allows you to control the number of article showcases, choose whether an image, title, text snippet and read more are displayed and their respective sizes and lengths, and many more options. A full list of available attributes are available here.


SCRIPTASK: Best Online Academic Writing Websites Script