Hooks
From StartBox Docs
Below is a list of the hooks included with StartBox broken down by where they appear in each template. At the bottom is a list of default actions being hooked.
Learn how to tap into these hooks with add_action().
For a visual record of where these hooks fire, check out the Annotated Markup
Default Hooks
Located in header.php
- sb_title
- Location: The site title
- sb_before
- Location: the very first thing inside <body>
- sb_before_header
- Location: inside div#wrap, before div#header
- sb_header
- Location: inside div#header, before any content
- sb_after_header
- Location: inside div#wrap, after div#header
- sb_before_container
- Location: inside div#container_wrap, before div#container
Located in front-page.php
- sb_before_featured
- Location: Located just after sb_before_content
- sb_featured
- Location: Located just after sb_before_featured
- sb_after_featured
- Location: Located just after sb_featured
- sb_no_featured_widgets
- Location: Fires if no widgets are hooked into Home Featured.
- sb_home
- Location: Located just after sb_after_featured
Located in most Templates
Specifically, these hooks are located in: 404.php, archive.php, attachment.php, author.php, index.php, page.php and all other page templates, search.php, single.php
- sb_before_content
- Location: Just before the content
- sb_page_title
- Location: The Page Title, appears immediately after sb_before_content
- sb_after_content
- Location: Just after the content
Located in loop.php
- sb_before_post
- Location: Just before the post
- sb_after_post
- Location: Just after the post
- sb_before_first_post
- Location: Just before the first post
- sb_after_first_post
- Location: Just after the first post
Located in loop.php and single.php
- sb_before_post_content
- Location: Inside div.post, after .entry-header, before .entry-content
- sb_post_header
- Location: Inside div.entry-meta
- sb_post_footer
- Location: Inside div.entry-footer
- sb_after_post_content
- Location: Inside div.post, after .entry-content, before .entry-footer
Located in 404.php
- sb_404
- Location: Inside div.post, only on 404 page
Located in sidebar.php
- sb_before_primary_widgets
- Location: Inside div#container, after div#content before div#primary
- sb_primary_widgets
- Location: The #primary widget area
- sb_no_primary_widgets
- Location: Fires when there are no widgets is the Primary widget area
- sb_between_primary_and_secondary_widgets
- Location: After div#primary, before div#secondary
- sb_secondary_widgets
- Location: The #secoandary widet area
- sb_no_secondary_widgets
- Location: Fires when there are no widgets is the Secondary widget area
- sb_after_secondary_widgets
- Location: Inside div#container, after div#secondary
- sb_no_widgets
- Location: This is hooked into all sb_no_*_widget hooks
Located in sidebar-tertiary.php
- sb_before_tertiary_widgets
- Location: Inside div#container, after div#content, before div#tertiary
- sb_after_tertiary_widgets
- Location: Inside div#container, after div#tertiary
- sb_no_tertiary_widgets
- Location: Fires when there are no widgets is the Tertiary widget area.
- sb_before_footer_widgets
- Location: inside div#footer, before div#footer_sidebar
- sb_between_footer_widgets
- Location: inside div#footer_sidebar, between each div.aside
- sb_after_footer_widgets
- Location: inside div#footer, after div#footer_sidebar
- sb_no_footer_aside_widgets
- Location: Fires when there are no widgets in Footer Column 1.
- sb_no_footer_aside_2_widgets
- Location: Fires when there are no widgets in Footer Column 2.
- sb_no_footer_aside_3_widgets
- Location: Fires when there are no widgets in Footer Column 3.
- sb_no_footer_aside_4_widgets
- Location: Fires when there are no widgets in Footer Column 4.
- sb_after_container
- Location: inside div#container_wrap, after div#container
- sb_between_content_and_footer
- Location: after div#wrap, before div#footer_wrap
- sb_before_footer
- Location: inside div#footer_wrap, before div#footer
- sb_footer
- Location: inside div#footer after div#footer_sidebar
- sb_footer_left
- Location: inside div#footer
- sb_footer_right
- Location: inside div#footer
- sb_after_footer
- Location: inside dive#footer_wrap, after div#footer
- sb_after
- Location: the very last thing before </body>
Located in startbox.php
- sb_init
- Location: Included hook for other things to do during initialization.
- sb_install
- Location: Included hook for other things to do during installation.
- sb_upgrade
- Location: Included hook for other things to do during upgrade.
- sb_child_install
- Location: Included hook for other things to do during child theme installation.
- sb_uninstall
- Location: Included hook for other things to do during uninstall.
Located in slideshows.php
- sb_slideshow_enqueue
- Location: Allows default enqueued scripts for slideshow to be replaced.
- sb_slideshow_wp_head
- Location: Hooks into wp_head
Default Actions
Below is everything that is being hooked in throughout StartBox, listed alphabetically by file, and then again by hook.
Note: To remove or reposition actions hooked in via option panels, wrap sb_remove_action() and sb_add_action() into a function hooked into init within your child theme.
Hooked in via /includes/functions/startbox.php
- sb_add_action( 'wp_enqueue_scripts', 'StartBox', 'sb_default_scripts', 12 ); // Default StartBox scripts
Hooked in via /includes/functions/hooks.php
- add_action( 'wp_head', 'sb_default_stylesheet' ); // Default Stylesheet
- add_action( 'sb_title', 'sb_default_title' ); // Page titles for archives, attachment, author and search
- add_action( 'sb_after_header', 'sb_breadcrumb_output', 15 ); // Breadcrumb output for Yoast Breadcrumbs
- add_action( 'sb_before', 'sb_topofpage', 1); // #top anchor
- add_action( 'sb_before','sb_skip_to_content'); // Accessibility link to skip directly to #content
- add_action( 'sb_featured', 'sb_home_featured_sidebar' ); // Adds widgetized area to homepage
- add_action( 'sb_home','sb_home_content'); // Content for the home page
- add_action( 'sb_404','sb_404_content'); // The 404 Content
- add_action( 'sb_after','sb_iphone' ); // A script to auto-hide the address bar in mobile safari
Hooked in via Header Settings
- sb_add_action( 'wp_head', 'sb_header_settings', 'favicon' ); // Favicon
- sb_add_action( 'sb_before_header', 'sb_header_settings', 'nav_before' ); // Navigation before the header
- sb_add_action( 'sb_header', 'sb_header_settings', 'logo' ); // Inserts logo, site title and description
- sb_add_action( 'sb_after_header', 'sb_header_settings', 'nav_after' ); // Navigation after header
Hooked in via Content Settings
- sb_add_action( 'sb_post_header', 'sb_content_settings', 'sb_header_meta' ); // Meta information for post header
- sb_add_action( 'sb_before_content', 'sb_content_settings', 'sb_post_nav_above' ); // Post navigation
- sb_add_filter( 'sb_read_more', 'sb_content_settings', 'more_text' ); // Read More text
- sb_add_action( 'sb_after_content', 'sb_content_settings', 'sb_author_bio' ); // Author bio
- sb_add_action( 'sb_after_content', 'sb_content_settings', 'sb_post_nav_below' ); // Post navigation
- sb_add_action( 'sb_post_footer', 'sb_content_settings', 'sb_footer_meta' ); // Meta information for post footer
- sb_add_action( 'template_redirect', 'sb_content_settings', 'sb_layout' ); // Page layout
- sb_add_action( 'sb_footer', 'sb_footer_settings', 'sb_rtt'), 5 ); // Inserts Return to Top link
- sb_add_action( 'sb_footer', 'sb_footer_settings', 'sb_footer_output' ), 11 ); // Produces copyright, credit, etc. in footer
Hooked in via Feedburner Settings
- sb_add_action( 'sb_after', 'sb_analytics_settings', 'output' ); // Your analytics code
Hooked in via Analytics Settings
- sb_add_action( 'init', 'sb_feedburner_settings', 'sb_check_url' ); // Feedburner scripts
- sb_add_action( 'template_redirect', 'sb_feedburner_settings', 'sb_feed_redirect' ); // Feedburner scripts
Hooked in via Save the Web Settings
- sb_add_action( 'template_redirect', array('sb_pushup_settings', 'sb_pushup_output'); // Pushup script
Hooked in via SEO Settings
- sb_add_action( 'wp_head', 'sb_seo_settings', 'sb_seo_output' ); // SEO output (will only output if no other popular SEO plugins are active)