Extending Blogfolio: action hooks & template fragments

This article highlights the various Blogfolio action hooks and explains the template fragment system – everything you need to know about properly overriding and child theming Blogfolio. The WordPress nomenclature can seem a bit odd to the eye; I will be referring to any type of content in general as a post (internally all content is a post), a blog post as a single, a static page as a page, and archive pages as an archive.

Blogfolio Pageview Overview

Todo: Blofgolio Flowchart

Blogfolio implements many of WordPress’ specialized templates for displaying content. Check out the source to see which templates are present, and consult the WordPress Template Hierarchy for additional information on how templates are chosen for displaying various content types.

Blogfolio Hooks and Template Fragment System

Todo: content text

Blogfolio Hooks

blogfolio_topbar

Called in the Topbar. Hooked by BlogfolioTemplate::topbar()

Default behaviour: Displays the primary navigation menu and optionally the search bar.

blogfolio_site_header

Called right before the end of the site header. Hooked by BlogfolioTemplate::siteHeader()

Default behaviour: Displays the ‘Site Header Widget Area’ widget area.

blogfolio_before_content

Called before any site content is presented. Hooked by BlogfolioTemplate::beforeContent()

Default behaviour: Displays the ‘Before Content Widget Area’ widget area.

blogfolio_post_feature

Called immediately before the post header. Hooked by BlogfolioTemplate::postFeature();

Default behaviour: Displays a feature item (thumbnail) via the thumbnail-loop.php template fragment on archive & search, and via thumbnail.php template fragment on single & page.

blogfolio_loop_header

Called in the header of every post shown on an archive page. Hooked by BlogfolioTemplate::loopHeader()

Default behaviour: Displays the header of each post via the header-loop.php template fragment, and authorship metadata via postmeta-authorship.php template fragment.

blogfolio_page_header

Called in the header of a post shown on a page. Hooked by BlogfolioTemplate::pageHeader()

Default behaviour: Displays the post title via header-page.php template fragment.

blogfolio_page_footer

Called in the footer of a post shown on a page. Hooked by BlogfolioTemplate:pageFooter()

Default behaviour: none.

blogfolio_single_header

Called in the header of a post shown on a single. Hooked by BlogfolioTemplate::singleHeader()

Default behaviour: Displays the post title via header-single.php template fragment, authorship metadata via postmeta-authorship.php template fragment, and an excerpt if there is one available.

blogfolio_single_footer

Called in the footer of a post shown on a single. Hooked by BlogfolioTemplate::singleFooter()

Default behaviour: Displays classification metadata via postmeta-classification.php template fragment.

blogfolio_attachment_header

Called in the header of an attachment. Hooked by BlogfolioTemplate::attachmentHeader()

Default behaviour: Displays the post title via header-attachment.php template fragment, authorship metadata via postmeta-authorship.php template fragment, and an excerpt if there is one available.

blogfolio_attachment_footer

Called in the footer of an attachment. Hooked by BlogfolioTemplate::attachmentFooter()

Default behaviour: Displays a link back to the parent post.

blogfolio_after_content

Called after all site content is presented. Hooked by BlogfolioTemplate::afterContent()

Default behaviour: Displays the ‘Content Sidebar’ widget area, the After Content Widget Area’ widget area, and the comments if applicable.

blogfolio_site_footer

Called in the site footer. Hooked by BlogfolioTemplate::siteFooter()

Default behaviour: Display a copyright notice regarding the site, and optionally a credit to Blogfolio theme.

blogfolio_no_results

Called after the “no results” message when no posts are found in an archive.

Default behaviour: none.

blogfolio_404

Called after the “404 error” message when a post isn’t found.

Default behaviour: none.

Extending Templates and Template Fragments

Todo: content text