Select Page

The Divi NSO Theme is developped and maintained by SPC to answer NSOs specific needs.

This Divi child theme provides a few extra options available from the WordPress administration menu, under Divi > NSO Options.

This is part 1 of the discussion around the NSO Theme options.

What are category pages ?

WordPress automatically generates category pages from the defined posts categories.

Those category pages simply list all posts related to that category, from more recent to oldest posts.

We can use categories for statistic topics.
For instance, we can define the following categories:

  • Economy
    • CPI
    • Trade
  • Population
  • Social

By posting all CPI related news under the CPI category, a visitor can read all posts by going to the CPI category page.

Here’s an example of a category page as it is by default :
http://training.nso.spc.int/statistics/economy/balance-of-payments/

Ok that’s nice, but by default the category page only lists posts, and nothing else.

What if you want an introduction on this page, to explain what the topic is, how often you collect and publish reports, etc… ?

Something that would look like this :
http://training.nso.spc.int/statistics/economy/

That’s where the use of sticky posts can help.

Introducing a category using sticky posts

The idea is to use a post from the category to describe that category.

This special post is marked as sticky, and will be entirely displayed at the top of the category page, instead of a simple category name.

First of all, enable the use of sticky posts for category description:

Create a new post under the selected category.

Make sure you tick the “Stick to the top of the blog” option in the document settings:

Describe the category (topic), add any content, tabular data, link to files, etc… And publish !

Now your CPI category page will have an introduction at the top, followed by all CPI related posts as you publish them.

Listing latest documents from the WP File Upload library

So we have an introduction. How about adding the list of recent documents for that topic.
Something like this: http://training.nso.spc.int/statistics/economy/cpi/

In the NSO Theme options, you may have noticed 2 other options for category pages:

Those are titles for each section below the title (or the sticky post).

The first one is the title for the Recent Posts section which comes in category pages by default.

The second one is the title of the Recent Documents section.

How to show the list of recent documents related to this category, you wonder?

Firstly, you need to create a folder in WP File Download.
You then need to grab the (category) ID of the folder you just created:

In WP File Download, click on the name of the category corresponding to the topic. On the right hand side you will see a category shortcode field.

The shortcode contains the ID of the category. In this case 30.

Then, edit the category and add this ID in the Files Category ID field.

And that’s it !