Theme pages introduction

Welcome to theme pages introduction. On this page you’ll find information and examples to help you get started.

If you want to start building theme pages immediately, please see quick start guide.

Little background first. The idea behind these theme pages is to allow channels to represent their video archive content more freely and customize it according to their wishes which is something that current vod categories cannot fully do. The main motivation of course is to make it easier for our viewers to find the content they like in our huge video archive. Eventually theme pages are expected to replace current category pages but before fully developed, both could exist side by side. In addition to theme pages, new theme tags can be used in any other pages where video content is desired.

Let’s move on by defining the theme tag, the main building block for our theme pages. By theme tag we mean here simple structure, text inside two square brackets such as:

[program]

This kind of element has special meaning in WordPress, and in that context these are called shortcodes. It means that when this kind of structure is found, more complex output is generated on the page instead of showing it as text. You can read more about shortcodes and see default shortcodes available in WordPress in https://wordpress.com/support/shortcodes/.

For our theme pages, custom theme tag (or shortcode) [program] has been added. When it’s found in page source, it is expected to output some familiar program lists seen in vod. The empty tag [program] doesn’t output anything in itself, but more info has to be given to the theme tag to specify what we want to show. For this purpose theme tag supports attributes (or options). The supported attributes of the tag are:

  • type
    • List of program types included (comma separated).
    • Possible values: series, episode, single, all.
    • Default: all
    • E.g. type=”episode, single” includes episodes of series and single programs
  • include
    • List of program or series ids to include.
    • Default: all
    • E.g. include=”1234, 5678″ includes these programs or series (depending on type)
  • exclude
    • List of program or series ids to exclude.
    • Default: nothing
    • E.g. exclude=”1234, 5678″ excludes these programs or series from the set.
  • category
    • List of category ids to include.
    • Default: nothing
    • E.g. category=”1,2″ includes programs or series from children and youth categories depending on type
  • sort
    • Sort order of programs/series shown
    • Options: latest-broadcast | highest-episode-number | most-popular | alphabetical | manual.
    • Default: latest-broadcast
    • Note: It depends on the type which sort order is available and makes sense. E.g. with type=”series” sort=”highest-episode-number” is not available for now.
    • Manual sort shows included programs in the given order (in include=”12,13,14″)
  • max
    • Limit the number of programs shown.
    • Default: unlimited
    • E.g. max=”8″ shows maximum of 8 programs / series.
  • columns
    • Number of columns to use on desktop, adjust automatically on smaller screens
    • Default: 4
  • links
    • How links should open, in the same or new tab (window)
    • Options: same | new
    • Default: same

These attributes allow building many kinds of program lists, and hopefully cover most practical use cases. Next we’ll take a closer look with examples.

Some examples

In these examples some basic use cases of theme tags are demonstrated. In the end of this section you’ll find links to additional sample pages.

1. Hand picked programs or series

The theme tag allows creating hand picked lists of programs or series. For example if we would like to show some series, episodes and single programs on top of children theme page, we could use the following tag. Type attribute defaults to all and hence, can be omitted in this case.

[program include="504,5986,26107,34117″ max="8"]:

If instead we’d like to show episodes of hand picked series and some singles, we could use type=”episode, single” instead. The number of programs shown is limited using attribute max.

[program type="episode, single" include="504,5986,26107,34107″ max="4"]:

Series can be shown with type=”series”:

[program type="series" include="76112,73694,14571,26107" sort="alphabetical"]:

With manual includes it’s good to check that correct type is used, especially if output is not as expected. For instance, if we try to output singles but included ids were series ids, this happens:

[program type="single" include="504, 34107"]:

More examples of hand picked programs

2. Recent programs from category

Let’s imagine that we would like to show 4 most recently broadcasted programs (episodes or singles) from children category. This can be achieved using the following theme tag.

[program type="episode, single" category="1" sort="latest-broadcast" max="4"] generates output seen below:

It’s also possible to include multiple categories, like we do here with children and music categories.

[program type="episode, single" category="1,7" sort="latest-broadcast" max="4"]:

3. Excluding programs or series

Sometimes it may be useful to exclude some programs or series from the result set. For example there are few series inside a category that don’t fit the theme very well, or perhaps we have already promoted the programs on top of the page and don’t want to show them again. Attribute exclude can be used for this purpose.

Here we like to show current affairs programs focused on Israel. Category 25 works for that if we exclude series that don’t belong to this theme.

[program type="series" category="25" exclude="15687, 62520, 39857, 15177, 78264, 76256"]:

In case we have already promoted some episodes and don’t want to show them again in full list of episodes, we just give the program ids to exclude. Here episodes 5 and 2 are excluded as can be seen.

[program type="episode" include="48163" exclude="48168, 48165" sort="highest-episode-number"]:

4. Sorting of episodes

Let’s take a look at different sorting options available. Series Derek Prince is used in this example.

Latest broadcast first (default)

[program type="episode" include="303" max="4"] or [program type="episode" include="303" max="4"  sort="latest-broadcast"] :

Highest episode number first

[program type="episode" include="303" sort="highest-episode-number" max="4"]:

[program type="episode" include="303" sort="most-popular" max="4"]:

Alphabetical order

[program type="episode" include="303" sort="alphabetical" max="4"]:

In case of multiple series included

Example with Wommack, Pawson and Prince.

[program type="episode" include="460,48,18013" sort="alphabetical" max="16"]:

More sorting related examples:

5. Like current category pages but with manual adjustments

Current category listings can still be easily created. However, thanks to manual includes and excludes, they can be customized to fit particular needs. In this case type=”series, single” is used to show series and single programs. In this example two categories are combined and there’re few manual includes and excludes as well.

[program type="series, single" include="66923, 501" exclude="63216, 68303" category="3, 6" sort="latest-broadcast" max="8"]:

See full example of above here: https://sandbox.tv7.fi/customized-category-pages/

More examples

More examples can be found on separate sample pages which are listed below.

https://sandbox.tv7.fi/live-prayer-programs/

https://sandbox.tv7.fi/music-programs-test/