Hooks – Custom Theme Elements

Dispatch uses a few Hook Elements and Block Elements to create some Custom Elements in the site.
All of them provide dynamic output and should not require any changes to their content.

For more info on the Hook Element read here:

Hooks Element Overview

Secondary Navigation

This hook calls the Secondary Navigation and displays below the header / header element. It also uses Display Rules so it is excluded from All Posts.
Please note: the Secondary Navigation Location in the Customizer is set to No Navigation.

WPSP Open Wrapper & WPSP Close Wrapper

These two hooks create a Div wrap around the Enter Header, Summary and Entry Footer of the WP Show Posts. This is used to create the custom styling you see here.

Post Navigation Block

For more information see this document:

Page and Post Heroes

Page Heroes are those big bold images and headlines you find at the top of your posts and pages. They sit just below the Site Header and added using the Header Element module, when activated provides the Elements menu in Dashboard > Appearance > Elements

Dispatch has two Header Elements in place. But you can add as many as you need.

Magazine Grid – Home Page

Combined with the WP Show Posts plugin this header creates a 5 post card grid. Very few settings are required. These are the main points:

Hero Content: WP Show Posts Short code
Element Classes: wpsp-grid wpsp-card
This creates the grid and styles the cards
Padding: Zero padding
Makes the grid fill the hero
Display Rules: Front Page

The shortcode required is found in the WP Show Posts list you created. More detail on creating these special lists can be found here.

Single Post

Method: Block Element – Page Hero
Background Image: Dynamic Featured Background Image on Container Block
Content: Headline Blocks displaying dynamic Post Title, Post Author, Post Data and Category Terms
Display Rules: All Posts

Creating new Block Elements

Creating a new Block Element is as easy as creating a new post. This article explains how to:

Block Element Overview

Display Rules

Display Rules are used to determine where a Block Element is displayed. Here are some pointers:

Front Page

When you select a blog or a static page in Dashboard > Settings > Reading as your Front Page. You must specifically apply that as a Display Rule for it to display.

Display the Dispatch Header Elements on other pages

Simply edit the Header Element and add additional Display Rules.

Copy an existing Block Element

So you think these Block Elements are awesome. But you want to add your own versions to some other posts, and there is not duplicate feature. Well just add one of the Duplicate Post plugins found on wordpress.org and your in business.

How to change the Custom Colors

Changing Colors in Dispatch are mainly done via the Theme Customizer. Certain elements such as Page Heros are controlled within the Header Element and are covered in that article. There are a few colors that are controlled by CSS. The rules for them are found in the Customizer > Additional CSS:

Primary Navigation

Hairline Border above desktop navigation

.main-navigation .inside-navigation {
    border-top: 0.5px solid #d4d7d8;
}

Menu item underline on hover

.main-navigation ul li:after {
    background-color: #000;
}

Navigation Search

.navigation-search.nav-search-active {
    background-color: rgba(255,255,255,0.95);
    top: 100%;
}

Buttons

All of the colors are controlled via the customizer. However the button border inherits the color of the font. This is set by this CSS:

button, html input[type="button"], input[type="reset"], input[type="submit"], a.button, a.button:visited, a.wp-block-button__link:not(.has-background) {
    pointer-events: initial !important;
    border-color: inherit;
    border: 1px solid;
}

WP Show Posts – Card Style

Entry Title, Summary and Meta text color

.wpsp-card, .wpsp-card a, .wpsp-card .wp-show-posts-meta a, .wpsp-card .wp-show-posts-meta a:visited {
    color: #fff;
}

Gradient overlay

To improve contrast of text a subtle gradient overlay is applied to the cards content wrapper.

.wpsp-card .wpsp-content-wrap {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 5% 8%;
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
    background-color: rgba(0, 0, 0, 0.35);
    background: -webkit-gradient(linear, left bottom, left top, color-stop(80%, rgba(0, 0, 0, 0.6)), to(rgba(0, 0, 0, 0)));
    background: linear-gradient(0deg, rgba(80, 50, 50, 0.5) 30%, rgba(0, 0, 0, 0) 100%);
    pointer-events: none;
}

Custom Featured Image Post Navigation Next/Previous

.post-nav {
    padding: 6px 12px;
    border-radius: 3px;
    font-size: 0.7em;
    text-transform: uppercase;
    background-color: #ff1956;
    color: #fff !important;
}

Style Guide

Heading One H1

Heading Two H2

Heading Three H3

Heading Four H4

Heading Five H5
Heading Six H6

Font: Playfair

Playfair is a transitional design. In the European Enlightenment in the late 18th century, broad nib quills were replaced by pointed steel pens as the popular writing tool of the day. Together with developments in printing technology, ink, and paper making, it became to print letterforms of high contrast and delicate hairlines that were increasingly detached from the written letterforms.

This design lends itself to this period, and while it is not a revival of any particular design, it takes influence from the designs of John Baskerville and from ‘Scotch Roman’ designs. Being a Display (large size) design in the transitional genre, functionally and stylistically it can accompany Georgia for body text.

volume button

Color Plan

#ff1956
#fbfbfb
#f4f6f7
#3a3a3c

 

volume button

Aside for Widgets

Sidebar Widgets are a main feature of any Magazine Blogging site. To aid with that Dispatch uses a nifty little plugin and a couple of custom CSS classes to make styling your sidebar a breeze.

Widget CSS Classes

Using the namesake plugin you can now add CSS Classes to Widgets. Simple.

Dispatch Widget Classes

CSS Class: zero-padding
Removes the padding from the widget. Perfect for adding those banner ads for maximum space.

CSS Class: no-background
Removes the widget color background that is set in the Customizer.

CSS Class: wpsp-card
Used exclusively with the WP Show Posts Widget and with zero-padding and no-background.
Read more here

Adding your own classes

Want different color background for your widgets. Heres how to. Add you Custom Class Name to your widget. In this example we’ll go for a red color and name our class red-background. Now thats added lets add some CSS.


.widget.red-background {
    background-color: #ff0000;
}

A Sample Post with Comments

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa a link to know where qui officia deserunt mollit anim id est laborum. a link to know where

Lorem ipsum dolor sit amet, consectetur adipiscing elit, style sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Great typography and bold imagery speak volumes about quintessential topics

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia a link to know where deserunt mollit anim id est laborum.

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. a link to know where

Great typography and bold imagery speak volumes about quintessential topics

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.