Unless a theme provides such a hook there is no way to do this with actions and filters. If a hook is provided then it will be theme specific, no generic WP solution exists.
For a full list of the hooks that a theme should implement, see here:
https://developer.wordpress.org/themes/advanced-topics/plugin-api-hooks/
At the moment this includes:
wp_head()Goes at the end of the element of a theme’s header.php template file.wp_body_open()Goes at the begining of the element of a theme’s header.php template file.wp_footer()Goes in footer.php, just before the closing tagwp_meta()Typically goes in the- Meta
comment_form()Goes in comments.php directly before the file’s closing tag ()
section of a Theme’s menu or sidebar.
Note that aside from wp_head and wp_footer, there is no guarantee that the theme developer knew to add them, or did so correctly, particularly wp_body_open and wp_meta
Related Posts:
- How can I see all the actions attached to an “add_action” hook?
- Which hook callback has priority if both plugin and theme use the same hook?
- add_action in functions.php, do_action in plugin?
- How to get menu location in wp_update_nav_menu hook
- Are there action hooks for comments?
- wp_login_form() ignoring login_form action hook
- Plugin Hook: Get posts
- Passing a parameter to filter and action functions
- Get a list of all registered actions
- How can I edit post data before it is saved?
- How to get the active theme’s slug?
- When can you get current page ID and initialize hooks right after?
- Customizing subject in comment notification e-mails
- How can I log a user out of WordPress before the page loads?
- Check php version before theme activation
- WP showing “warning: call_user_func_array()”, What to do?
- WordPress admin notice in plugin function
- Using the ‘draft_to_publish’ hook (post status transition)
- How can I remove “Proudly powered by WordPress” from twentyeleven without modifying footer.php?
- WordPress Hook that will run when media file deleted
- Use external link in the add sub menu
- How to filter content post only on save
- Filter or action hook to insert content on admin pages before tag
- Is it possible to remove this action? (as it’s added just before it’s called)
- WordPress Plugin Boilerplate – add_action hook in static “activate” function
- template_redirect not being called when using ajax
- Plugin custom Action Hook not working
- What are the benefit in adding hook in the init() hook?
- add_meta_box (Will display only in specific page admin WordPress)
- add action for displaying posts using a shortcode
- Deactivate Plugin on Theme Switch
- Where to hook my plugin’s action
- How to Use Parameters with a Do_Action Function Within PHP Tags
- How do action and filter hooks understand where to look for the core function that we hooked our function to them
- WordPress filter that hook after each action/filter hook
- How to stop or remove an action being called inside a function of an extended class
- Automatically add attributes to woocommerce product?
- Insert new user with form submit ‘init’ hook
- Hooking in to replace the Sidebar/Widget areas
- How to get all of the activate_plugin action parameters?
- Calling plugin function inside custom plugin for onclick event
- Calculate price and display on woocommerce product single page under price (simple price, variable price) [closed]
- Removing an action from wp_footer called in a class that’s inside a bigger class
- All sites themes functions.php have been changed
- Why namespaces are rarely used in WordPress plugins?
- What is @Action in WordPress?
- My single.php page does not show the related data to the post which is clicked
- How passing values to construct function with Actions?
- add_action into another add_action not working
- Why do plugins often ask to add in to templates?
- remove_action not removing add_action from constructor
- Basic function call on init failing
- Use $variable from file1.php in file2.php (different file paths)
- How to make a dynamic css class whose name changes every visit to confuse scraper
- I receive taxonomy id
- WooCommerce: after install hook
- Save user total active time after login in wordpress [closed]
- How to include files relative to a file’s directory
- Advanced WordPress plugin activation detection
- How to remove products-links after the product title using remove_action
- Inserting Plugins Into Blank Space of Externally Designed WordPress Theme
- Add action to custom Function
- How to hook into action/filter call
- Plugin Admin panel checkbox unchecked after submit
- uncaught TypeError: Cannot read properties of null (reading ‘classList’) custom plugin
- Custom Plugin scripts from admin working in frontend
- WordPress Cache delete on plugin uninstall
- Use a hook or filter, or overwrite this Gamipress function?
- WordPress Custom Hook with Class method
- Replace old theme that understand old css (vcex_icon_box css_animation)
- update_option_{$option} not working (do function after options are saved)
- Remove a div class with condition
- How to get a post views count using ‘WordPress popular posts’ plugin
- Removing Plugin Action via Theme for Non-admins
- Use action, filter, or hook to append HTML to WordPress plugin function
- Passing function into add_action always returns the first argument
- Is it possible to disable a theme programmatically?
- {status}_{post_type} does not run correctly?
- Creating Admin Submenu Page via Class Method
- I want add repository theme folder
- What is the correct entry point for capturing coverage data
- Why can’t I shove an instance of a class into a variable from a do_action hook?
- Passing a parameter to filter and action functions
- Run only on plug-in activation instead of wp_head
- Things that saved lose when logout
- plugins_loaded action is not working properly
- Woocommerce: deleted single-product.php, everything still works. How is it possible?
- What is the process for reimplementing a back up WordPress?
- Template from scratch: Sidebars not showing widget
- Display static pages instead of category, in code
- OOP Plugin: Where should I place the action hooks in the class?
- add query string to all pages after user logged in
- How wordpress plugin hooks works? [duplicate]
- Two sites one PC
- Hook automatic_updates_complete to autoupdate plugin
- Real estate schema markup not showing up on Rich Results test
- WordPress : how to create onglet and remove it when only one
- Remove H1 title in admin post edit screen
- Remove 3rd party plugin notices from within own plugin
- How to customize WP_Error (REST JWT authentication plugin) [closed]