Theme Action Hooks

4 min read Updated

North runs action hooks at fixed places in its templates, so developers can add output without editing theme files. You do not need them to use North; use them in a child theme or in a Code Snippets snippet. If you are new to action hooks, read Using Action Hooks in WordPress Child Themes. For ready to use code, see Advanced Customizations.

This example adds a notice between the header and the content:

add_action( 'siteorigin_north_content_before', function() {
	echo '<div class="notice-bar">Free delivery in Delaware</div>';
} );

Action Hooks in header.php

siteorigin_north_content_before
Runs after the header and before the content area. It runs even when Hide Masthead is on in Page Settings.
View header.php on GitHub.

siteorigin_north_content_top
Runs at the top of the content area, inside the North container and before the main content and the sidebar.
View header.php on GitHub.

Action Hooks in footer.php

siteorigin_north_footer_before
Runs after the content area and before the footer.
View footer.php on GitHub.

siteorigin_north_footer_top
Runs at the top of the footer, before the footer widgets.
View footer.php on GitHub.

siteorigin_north_footer_bottom
Runs below the footer text and the credit, before the footer closing tag.
View footer.php on GitHub.

Logo Hooks

siteorigin_north_logo_before
Runs before North outputs the logo or the site title.

siteorigin_north_logo_after
Runs after the logo. It runs only when you set a Logo in AppearanceCustomizeTheme SettingsBranding. It does not run after a Site Identity logo or after the site title.

siteorigin_north_logo_title_before
Runs before the site title that shows next to the logo. It runs only when the site has a logo and Display Site Title Alongside Logo is on in Branding.

siteorigin_north_logo_title_after
Runs after the site title that shows next to the logo, with the same conditions.
View inc/template-tags.php on GitHub.

Author Box Hook

siteorigin_north_after_entry_author_avatar
Runs after the author picture in the author box below a single post. The author box shows when Display author box on single is on in AppearanceCustomizeTheme SettingsBlog.
View inc/template-tags.php on GitHub.

Quick View Hooks

These hooks are in the WooCommerce Quick View window. The window opens from the Quick View button, which shows when Display Quick View button is on in AppearanceCustomizeTheme SettingsWooCommerce. See WooCommerce. They run in this order:

  1. siteorigin_north_woocommerce_quick_view_images: North adds the product image.
  2. siteorigin_north_woocommerce_quick_view_title: North adds the price and the title. This hook is inside the link to the product page.
  3. siteorigin_north_woocommerce_quick_view_content: North adds the rating, the short description and the Add to Cart form.

View woocommerce/quick-view.php on GitHub.

Breadcrumb Hooks

siteorigin_settings_before_breadcrumbs
Runs before the breadcrumbs. North shows breadcrumbs from Breadcrumb NavXT, Yoast SEO, Rank Math or All in One SEO. See Integrated Plugins.

siteorigin_settings_after_breadcrumbs
Runs after the breadcrumbs.

The two hooks run where North places the breadcrumbs, even when no breadcrumb plugin is active.

Page Settings Hooks

siteorigin_settings_before_page_settings_meta_box
Runs at the top of the Page settings box. It receives the post.

siteorigin_settings_after_page_settings_meta_box
Runs at the bottom of the Page settings box. It receives the post.

Remove the North Output

North adds its Quick View content with its own hooks. To remove an item, use remove_action with the same priority, after the theme setup. Two examples:

  • Remove the price from the Quick View window: remove_action( 'siteorigin_north_woocommerce_quick_view_title', 'woocommerce_template_single_price', 5 );
  • Remove the rating from the Quick View window: remove_action( 'siteorigin_north_woocommerce_quick_view_content', 'woocommerce_template_loop_rating', 15 );

Run the code on after_setup_theme with a priority above 10, for example:

add_action( 'after_setup_theme', function() {
	remove_action( 'siteorigin_north_woocommerce_quick_view_title', 'woocommerce_template_single_price', 5 );
}, 20 );

Filters

Use these filters with add_filter. Where a filter has a fixed default, the entry shows it.

siteorigin_north_footer_credits
The credit text in the footer. Default: Theme by SiteOrigin with a link.

siteorigin_north_logo_sticky_scale
The scale of the logo in the sticky header. Default: 0.755.

siteorigin_north_sticky_topbar
Make the top bar stick to the top of the screen with the sticky header. Default: false.

siteorigin_north_content_width
The content width for WordPress. Default: 650.

siteorigin_north_custom_background_args
The arguments of the custom background feature. Default: color ffffff, no image.

siteorigin_north_comment_form_placeholders
The placeholder text of the comment form fields. Default: Enter Your Name, Enter Your Email and Your Site URL.

siteorigin_north_logo_url
The attachment ID of the logo set in Branding.

siteorigin_north_logo_attributes
The attributes of the Branding logo image. Default: class custom-logo.

siteorigin_north_settings_array
The array of Customizer sections and settings. Use it to add or remove settings in Theme Settings.

siteorigin_settings_show_breadcrumbs
Show or hide the breadcrumbs. Default: true.

siteorigin_settings_custom_css
The custom CSS that the settings framework prints.

siteorigin_settings_defaults
The default values of the Theme Settings.

siteorigin_web_font_url
The base address for web fonts. Default: https://fonts.googleapis.com/css. See Advanced Customizations.

siteorigin_settings_disable_new_widget_area
Turn off the block widget editor of WordPress. Default: true, so North uses the classic widgets screen.

siteorigin_page_settings
The settings of the Page settings box.

siteorigin_page_settings_defaults
The default values of the Page settings box. See Advanced Customizations.

siteorigin_page_settings_values
The saved values of the Page settings box for a page.

siteorigin_about_page_show
Show or hide the About SiteOrigin North page in the Appearance menu. Default: true.

siteorigin_settings_display_teaser
Show or hide the Premium teaser fields in the Customizer. Default: true.