Template Components

Reusable template components for consistent display across the theme.

Pagination Component

Location: /inc/core/templates/pagination.php
Function: extrachill_pagination( $query, $context )

Parameters

  • $query (WP_Query|null) – Custom query or global $wp_query
  • $context (string) – Styling context: ‘default’, ‘archive’, ‘search’

Features

  • Post count display with intelligent formatting
  • Previous/Next navigation
  • Page number links with ellipsis
  • URL parameter preservation
  • Mobile responsive

Usage

// Use global query
extrachill_pagination();

// Use custom query
$query = new WP_Query( $args );
extrachill_pagination( $query, 'archive' );

Output Format

Viewing posts 1-10 of 156 total
[« Previous] [1] [2] [3] ... [16] [Next »]

Count Display Logic

  • Single post: "Viewing 1 post"
  • Single result on page: "Viewing post 5 of 156"
  • Multiple results: "Viewing posts 1-10 of 156 total"

Post Meta Component

Location: /inc/core/templates/post-meta.php
Function: extrachill_entry_meta()

Displays

Standard Posts:

  • Publication date
  • Author (filterable via extrachill_post_meta_author)
  • Last updated date (if modified)

Forum Posts (multisite):

  • Post date
  • Forum author with community link
  • Forum name with link

Filter Hook

apply_filters( 'extrachill_post_meta', $default_meta, $post_id, $post_type )

Usage

// In templates
extrachill_entry_meta();

// Customize output
add_filter( 'extrachill_post_meta', function( $meta, $post_id, $post_type ) {
    return $meta . '<div>Custom meta</div>';
}, 10, 3 );

Author Output Override

Use the author override filter if you need to customize the author HTML:

add_filter( 'extrachill_post_meta_author', function( $author_html, $post_id ) {
    return $author_html;
}, 10, 2 );

Update Detection

Shows "Last Updated" date only when:

  • Modification date differs from publication date
  • Difference is at least 1 day

Taxonomy Badges Component

Location: inc/core/templates/taxonomy-badges.php
Function: extrachill_display_taxonomy_badges( $post_id, $args )

Parameters

  • $post_id (int|null) – Post ID (defaults to current post)
  • $args (array) – Configuration options

Arguments

$args = array(
    'wrapper_class' => 'taxonomy-badges',
    'show_wrapper'  => true,
    'wrapper_style' => '',
);

Displays Badges For

  • Any taxonomy attached to the post type
  • Skips the author taxonomy
  • Limits to 3 terms per taxonomy (highest count, then alphabetical)
  • Supports cross-site search results by switching to the origin blog when needed

Usage

extrachill_display_taxonomy_badges();
extrachill_display_taxonomy_badges( 123 );

extrachill_display_taxonomy_badges( null, array(
    'wrapper_class' => 'custom-badges',
    'wrapper_style' => 'margin-bottom: 20px;'
) );

extrachill_display_taxonomy_badges( null, array(
    'show_wrapper' => false,
) );

Badge Styling

Badges use predictable CSS classes:

  • .taxonomy-badge (base)
  • .{taxonomy}-badge and .{taxonomy}-{term-slug}
  • Categories also get .category-{slug}-badge for legacy compatibility

Styling file: assets/css/taxonomy-badges.css

Breadcrumb Component

Location: inc/core/templates/breadcrumbs.php
Function: extrachill_breadcrumbs()

Extension Points

Breadcrumbs are designed for plugin overrides (bbPress/WooCommerce/etc.):

  • Root override: extrachill_breadcrumbs_root
  • Trail override: extrachill_breadcrumbs_override_trail
  • Append extra items: extrachill_breadcrumbs_append

Usage

extrachill_breadcrumbs();

Format Examples

Single Post:

Home › Category › Tag › Post Title

Page with Parent:

Home › Parent Page › Current Page

Category Archive:

Home › Parent Category › Child Category

Taxonomy Archive:

Home › Locations › Colorado › Denver

Social Links Component

Location: /inc/core/templates/social-links.php
Function: extrachill_social_links()
Hook: extrachill_social_links

Social Platforms

  • Facebook: facebook.com/extrachill
  • Twitter/X: twitter.com/extra_chill
  • Instagram: instagram.com/extrachill
  • YouTube: youtube.com/@extra-chill
  • Pinterest: pinterest.com/extrachill
  • GitHub: github.com/Extra-Chill

Icon Source

Uses ec_icon() helper with extrachill.svg sprite:

<?php echo ec_icon('facebook'); ?>

Usage

// Display social links
do_action( 'extrachill_social_links' );

// Or direct function call
extrachill_social_links();

Output Structure

<div class="social-links">
    <ul>
        <li><a href="..." aria-label="Facebook"><svg>...</svg></a></li>
        <!-- ... more platforms ... -->
    </ul>
</div>

Share Button Component

Location: /inc/core/templates/share.php
Function: extrachill_share_button( $args )
Hook: extrachill_share_button

Parameters

$args = array(
    'share_url'         => get_permalink(),      // URL to share
    'share_title'       => get_the_title(),      // Title to share
    'share_description' => '',                    // Description (optional)
    'share_image'       => '',                    // Image URL (optional)
);

Share Options

  • Facebook
  • Twitter/X
  • Email
  • Copy Link (with clipboard API + fallback)

Usage

// Display with defaults
do_action( 'extrachill_share_button' );

// Custom share data
extrachill_share_button( array(
    'share_url'   => 'https://example.com/page',
    'share_title' => 'Custom Title',
) );

Features

  • Dropdown toggle on click
  • Close on outside click
  • Clipboard copy with "Copied!" feedback
  • Fallback prompt for unsupported browsers
  • External links open in new tab
  • JavaScript interactions via share.js

Notice System Component

Location: /inc/core/notices.php
Functions: extrachill_add_notice(), extrachill_display_notices()
Hook: extrachill_notices

Parameters for extrachill_add_notice()

extrachill_add_notice( $type, $message, $options = array() );

Where $options can include:

$options = array(
    'dismissible' => true,                    // Allow dismissal
    'action_url'  => '/dashboard',            // Action button URL
    'action_text' => 'Go to Dashboard',       // Action button text
    'cookie_key'  => 'custom_notice_key',     // Cookie dismissal key
    'priority'    => 10,                      // Display priority
);

Notice Types

  • success – Green success notices
  • error – Red error notices
  • warning – Yellow warning notices
  • info – Blue informational notices

Usage

// Simple notice
extrachill_add_notice( 'success', 'Settings saved successfully!' );

// Dismissible notice with action
extrachill_add_notice( 'warning', 'Please update your profile', array(
    'dismissible' => true,
    'action_url'  => '/profile',
    'action_text' => 'Update Profile',
    'cookie_key'  => 'profile_update_notice'
) );

// Display all notices
do_action( 'extrachill_notices' );

Features

  • Multiple notice support
  • Cookie-based dismissal tracking
  • Action buttons for user guidance
  • Priority-based ordering
  • Anonymous user cookie support
  • Automatic cleanup of expired notices

No Results Component

Location: /inc/core/templates/no-results.php

Displays when no content found:

  • Search pages with zero results
  • Empty archives
  • 404 pages

Features

  • Contextual messaging
  • Search form for new search
  • Helpful suggestions

404 Error Component

Location: /inc/core/templates/404.php

Standard 404 error page template.

Search Form Component

Location: /inc/core/templates/searchform.php
Function: extrachill_search_form()

Standard WordPress search form with theme styling.

Usage

// Display search form
extrachill_search_form();

// Or WordPress function
get_search_form();

Community Activity Component

Location: /inc/core/templates/community-activity.php
Functions: extrachill_get_community_activity_items(), extrachill_render_community_activity()

Centralized shared helper library for displaying bbPress activity from multiple sites.

Features

  • Community Queries: Fetches activities from community.extrachill.com (blog ID 2)
  • Chronological Merging: Combines activities from both sites into unified timeline
  • Configurable Rendering: Customizable HTML structure and CSS classes
  • WordPress Object Cache: 10-minute caching for optimal performance
  • Reusable Library: Eliminates code duplication across sidebar and homepage widgets

Data Function

Function: extrachill_get_community_activity_items( $limit )

Parameters:

  • $limit (int) – Number of activity items to return from cached pool

Returns: Array of activity items with metadata:

  • id – Post ID
  • type – ‘Topic’ or ‘Reply’
  • username – Author username
  • user_profile_url – Profile URL (via extrachill-users plugin)
  • topic_title – Topic title
  • forum_title – Forum title
  • date_time – ISO 8601 datetime
  • forum_url – Forum permalink
  • topic_url – Topic permalink

Render Function

Function: extrachill_render_community_activity( $args )

Parameters:

$args = array(
    'limit'          => 5,                         // Number of items to display
    'wrapper_tag'    => 'div',                     // HTML tag for container
    'wrapper_class'  => 'community-activity-list', // Container CSS class
    'item_class'     => '',                        // Activity card CSS class
    'empty_class'    => '',                        // Empty state CSS class
    'render_wrapper' => true,                      // Whether to render container
    'counter_offset' => 0,                         // Topic ID counter offset
    'items'          => null,                      // Pre-fetched items (bypasses query)
);

Usage Examples

// Fetch and render with defaults
extrachill_render_community_activity();

// Custom styling for sidebar
$items = extrachill_get_community_activity_items( 5 );
extrachill_render_community_activity( array(
    'items'          => $items,
    'render_wrapper' => false,
    'item_class'     => 'sidebar-activity-card',
) );

// Custom styling for homepage grid
extrachill_render_community_activity( array(
    'limit'         => 9,
    'wrapper_class' => 'home-activity-grid',
    'item_class'    => 'grid-activity-card',
) );

Implementation Locations

  • Sidebar Widget: /inc/sidebar/community-activity.php – Calls shared helper with sidebar styling
  • Homepage 3×3 Grid: /inc/home/templates/section-3x3-grid.php – Calls shared helper with grid styling
  • Legacy Wrapper: /inc/home/templates/community-activity.php – Deprecated wrapper (v1.1.1+)

Output Format

<div class="community-activity-list">
    <div class="community-activity-card">
        <a href="/profile/username">Username</a> replied to
        <a href="/topic/slug/">Topic Title</a> in
        <a href="/forum/slug/">Forum Name</a> - 2 hours ago
    </div>
    <!-- More activities... -->
</div>

Caching

Activities cached for 10 minutes using WordPress object cache with key extrachill_community_activity_all. Cache contains results from community site.

Filter Bar Component

Location: /inc/components/filter-bar.php, /inc/components/filter-bar-defaults.php
Styles: /assets/css/filter-bar.css
Function: extrachill_filter_bar()

Purpose

Universal filter bar component providing consistent sorting and filtering UI across archives, forums, and other list views.

API (filters/actions)

extrachill_filter_bar() does not accept arguments. Items are registered via filters.

  • Register items: extrachill_filter_bar_items (filter)
    • Each item is an associative array with type (dropdown or search) and the configuration consumed by the renderer.
  • Override output: extrachill_filter_bar_override (filter)
    • Return non-empty HTML to short-circuit the default rendering.
  • Inline extension points:
    • extrachill_filter_bar_start (action)
    • extrachill_filter_bar_end (action)

Theme default items

The theme registers archive defaults in inc/components/filter-bar-defaults.php (via extrachill_filter_bar_items):

  • Category dropdown (blog archive)
  • Child term dropdown (category + location taxonomy)
  • Artist dropdown (specific categories)
  • Sort dropdown (sort=recent|oldest|random|popular)
  • Search input (s)

Sort option labels are filterable via extrachill_filter_bar_sort_options.

Integration Points

  • Theme Archives: the theme outputs the bar via extrachill_archive_above_posts.
  • Community Forums: extrachill-community registers additional items for bbPress via extrachill_filter_bar_items.

Output Structure

<form method="get" action="/current/path" class="extrachill-filter-bar">
    <div class="filter-bar-dropdowns">
        <select name="sort">...</select>
        <!-- other dropdowns ... -->
    </div>

    <div class="filter-bar-search">
        <input type="text" name="s" value="...">
        <button type="submit">...</button>
    </div>
</form>

Component Integration

All components designed for:

  • Modularity: Use independently
  • Consistency: Uniform output across theme
  • Flexibility: Configurable via parameters/filters
  • Accessibility: ARIA labels, semantic HTML
  • Performance: Efficient database queries
  • JavaScript Enhancement: Interactive features with graceful degradation