Theme Action Hooks

4 min read Updated

This is a developer topic. You do not need it to use Corp. Use these hooks 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 above the header:

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

Action Hooks in header.php

siteorigin_corp_body_top
Runs after wp_body_open() and before the page wrapper.
View header.php on GitHub.

siteorigin_corp_header_before
Runs before the header. It runs after the WooCommerce store notice bar, and it runs even when Header is off in Page Settings.
View header.php on GitHub.

siteorigin_corp_content_before
Runs after the header and before the content area. It runs even when the header is off. Corp hooks the blog home page slider here. See Posts Slider.
View header.php on GitHub.

siteorigin_corp_content_top
Runs at the top of the content area, inside the Corp container. Corp hooks the breadcrumbs here.
View header.php on GitHub.

Action Hooks in footer.php

The first three hooks run only when Footer is on in Page Settings.

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

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

siteorigin_corp_footer_bottom
Runs below the bottom bar, before the footer closing tag.
View footer.php on GitHub.

siteorigin_corp_footer_after
Runs after the page wrapper, the scroll to top button and wp_footer(), before the closing body tag. It runs even when Footer is off.
View footer.php on GitHub.

Logo Hooks

siteorigin_corp_logo_before
Runs before Corp outputs the logo or the site title.
View inc/template-tags.php on GitHub.

siteorigin_corp_logo_after
Runs after Corp outputs the logo or the site title.
View inc/template-tags.php on GitHub.

Quick View Hooks

These hooks are in the WooCommerce Quick View window. See WooCommerce. They run in this order:

  1. siteorigin_corp_woocommerce_quick_view_before_product
  2. siteorigin_corp_woocommerce_quick_view_before_image
  3. siteorigin_corp_woocommerce_quick_view_images
  4. siteorigin_corp_woocommerce_quick_view_after_image
  5. siteorigin_corp_woocommerce_quick_view_before_title
  6. siteorigin_corp_woocommerce_quick_view_title
  7. siteorigin_corp_woocommerce_quick_view_after_title
  8. siteorigin_corp_woocommerce_quick_view_before_content
  9. siteorigin_corp_woocommerce_quick_view_content
  10. siteorigin_corp_woocommerce_quick_view_after_content
  11. siteorigin_corp_woocommerce_quick_view_after_product

Corp adds the product image at images. It adds the title and the rating at title. It adds the price, the short description and the Add to Cart form at content. View woocommerce/quick-view.php on GitHub.

Breadcrumb Hooks

siteorigin_settings_before_breadcrumbs
Runs before the breadcrumbs. See Breadcrumbs.

siteorigin_settings_after_breadcrumbs
Runs after the breadcrumbs.

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 Corp Output

Corp uses its own hooks. To remove what Corp adds, use remove_action after the theme setup. Two examples:

  • Remove the breadcrumbs: remove_action( 'siteorigin_corp_content_top', 'siteorigin_corp_breadcrumbs' );
  • Remove the blog home page slider: remove_action( 'siteorigin_corp_content_before', 'siteorigin_corp_display_featured_posts' );

Filters

The filters change a value. Each filter shows its default.

siteorigin_corp_footer_credits
The credit text in the footer bottom bar. Default: Theme by SiteOrigin with a link.

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

siteorigin_corp_header_sticky_offset
The scroll distance in pixels before the header becomes sticky. Default: 0.

siteorigin_corp_content_width
The content width for WordPress. Default: 1140.

siteorigin_corp_custom_background_args
The arguments of the custom background feature. Default: color f9f9f9, no image.

siteorigin_corp_display_categories
Show or hide the category list in the post details. Default: true.

siteorigin_corp_get_featured_posts
The posts for the blog home page slider. Jetpack Featured Content supplies them.

siteorigin_corp_display_mini_cart
Show or hide the WooCommerce mini cart. Default: false on the Cart and Checkout pages, true everywhere else.

siteorigin_corp_woocommerce_quick_view_product_image_size
The image size in the Quick View window. Default: shop_single.

siteorigin_corp_settings_array
The array of Customizer sections and settings. Use it to add or remove 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_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 Corp page in the Appearance menu. Default: true.

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