WordPress provides Actions and Filters to allow developers to “hook into” specific parts of WordPress and modify or extend functionality without directly editing core files.
Similarly, the Porto Theme implements its own hooks, enabling you to modify theme-specific behavior through your child theme or a custom plugin.
How to Use a Hook or a Filter
Let’s say you want to display the product tab accordion on a specific product page. You can do this easily using a Porto filter.
- Copy and Edit Template
Copy thesingle-producttemplate file to your child theme and modify it as needed. - Apply the Filter
In your child theme’s
single-product/tabs.php, add the following codeadd_filter( 'porto_single_product_data_tab_type', function() { return 'accordion'; });
That’s it! The tab layout will now use the accordion style for that product.
Using Actions Instead of Filters
When customizing Porto via a child theme, use actions and filters whenever possible.
This approach makes your site easier to maintain and upgrade, since your changes are applied dynamically rather than by editing core files.
You can find many available Porto hooks and filters in the lists below.
Filters List
-
porto/footer/footer_tooltip.phpDescription: Filters the footer tooltip content.
apply_filters( 'porto_footer_tooltip', $tooltip_content );
-
porto/header/header_tooltip.phpDescription: Filters the header tooltip content.
apply_filters( 'porto_header_tooltip', $tooltip_content );
-
porto/inc/admin/customizer/header-builder.phpDescription: Filters Customizer header builder elements.
apply_filters( 'porto_header_elements', $elements );
-
porto/inc/admin/setup_wizard/speed_optimize_wizard.phpFilters all shortcodes:
apply_filters( 'porto_all_shortcode_list', $shortcode_list );
Filters all shortcodes currently used on the site:
apply_filters( 'porto_used_shortcode_list', $used, $return_ids );
-
porto/inc/functions/class-dynamic-style.phpFilters internal dynamic CSS:
apply_filters( 'porto_dynamic_style_internal_output', $this->minify_css( $css ) );
-
porto/inc/functions/content_type.phpFilters meta values, layouts, and sidebars:
apply_filters( 'porto_get_meta_value_' . $meta_key, $value ); apply_filters( 'porto_meta_layout', array( $value, $sidebar, $sidebar2 ) ); apply_filters( 'porto_meta_default_layout', $value ); apply_filters( 'porto_portfolio_sub_title', $output );
-
porto/inc/functions/general.phpFilters for template parts, screen sizes, and product detection:
apply_filters( 'porto_get_template_part', $template, $slug, $name ); apply_filters( 'porto_is_product', $result ); apply_filters( 'porto_is_shop', $result );
-
porto/inc/functions/layout.phpIncludes filters for header, footer, menus, wrappers, view switchers, minicarts, and more:
apply_filters( 'porto_logo', ob_get_clean() ); apply_filters( 'porto_get_wrapper_type', $porto_settings['wrapper'] ); apply_filters( 'porto_is_dark_skin', $porto_settings['css-type'] === 'dark' );
-
porto/inc/functions/layout/breadcrumbs.phpapply_filters( 'porto_breadcrumbs', $output );
-
porto/inc/functions/layout/page-title.phpapply_filters( 'porto_page_title', $output ); apply_filters( 'porto_page_sub_title', $output );
-
porto/inc/functions/woocommerce.phpFilters related to WooCommerce integration:
apply_filters( 'porto_lazy_load_images', $thumb_image ); apply_filters( 'porto_filter_cart_version', $cart_ver ); apply_filters( 'porto_filter_checkout_version', $checkout_ver );
…and many more filters for infinite scroll, live search, pre-order dates, and shortcode rendering.
Actions List
-
porto/content-archive-portfolio-fullscreen.phpdo_action( 'porto_portfolio_after_content' );
-
porto/footer.phpdo_action( 'porto_after_main' ); do_action( 'porto_after_wrapper' );
-
porto/functions.phpdo_action( 'porto_enqueue_css' );
-
porto/header/header_before.phpTriggers before and after main wrappers and banners:
do_action( 'porto_before_wrapper' ); do_action( 'porto_before_header' ); do_action( 'porto_after_banner' );
…and many more for sidebars, admin actions, builders, and templates.
JavaScript Hooks List
-
porto/js/admin/admin.jsTriggered when WooCommerce plugin initializes swatches:
$wrapper.trigger('plugin_init'); -
porto/js/theme-async.jsTriggered when the login popup opens:
$(window).trigger('porto_login_popup_opened'); -
porto/js/theme.jsCommon frontend triggers for dynamic updates:
$(document.body).trigger('porto_refresh_vc_content', [$elements]); $(document).trigger('porto_theme_init'); $real.trigger('skeleton-loaded');
…and many more for sidebars, admin actions, builders, and templates.
Additional Pro Tips
- Always use child themes for applying hooks or filters.
- Never modify Porto’s core files.
- Document your custom hooks for maintainability.
- Use filters for modification, actions for extension.