BlueTheme Docs

Widgets

The theme registers seven classic widgets (inc/Widgets). They work in the block widget editor (as "Legacy widget"), in the Customizer, and in every widget area: sidebars, footer columns and Sliding Top.

Widget What it shows
BlueTheme: Posts Latest, most commented or random posts, optionally from one category, with thumbnails and dates. The current post is left out.
BlueTheme: Comments Latest approved comments with avatars, author, post and the first words.
BlueTheme: Login A login form with "Lost your password?" and "Register" links. Signed-in users see their avatar, name, account, dashboard and log out links.
BlueTheme: Menu A menu from Appearance → Menus as links with arrows, links with lines between, or pills.
BlueTheme: Social Icons The profiles from Theme Options → Social, plain, in circles or in squares, optionally in brand colors, with a short text.
BlueTheme: Image Gallery A grid of Media Library images that open in the theme lightbox. It replaces Flickr or Instagram feeds, which need outside services.
BlueTheme: Contact Details Address (optionally linking to a map), phone, email (protected from spam bots) and opening hours, with icons.

The core Tag Cloud widget and block show every tag at one size, as pills.

Adding a widget

Extend BlueTheme\Widgets\Widget and add the class to Widgets::WIDGETS:

  • fields() returns the settings as id => [ type, label, default, … ]. The types are text, textarea, number (min, max), checkbox, select (choices), url, email and ids (attachment ids, with the "Choose images" picker from src/admin/widgets-admin.js). The base class prints the form and cleans the values by type.
  • content( $values ) returns the HTML. An empty string prints nothing, not even the title, so a widget with nothing to show leaves no empty box.

Styles are in src/scss/_widgets.scss. They use logical properties, so one stylesheet serves both directions.