changing genesis_before_while in new theme framework

I am moving a site from a Genesis theme to Colorlib theme. The genesis theme includes add_action( 'genesis_before_while', 'custom function' ); in a custom archive page, which loads restricted content from a template part. Is there a standard WP hook equivalent? or a work-around?

Topic actions genesis-theme-framework hooks Wordpress

Category Web


It's possible there's an equivalent filter in the new theme but there is no standard general hook you can use that acts as a direct replacement like for like.

You should check the Colorlib themes documentation and support, but keep in mind Genesis relies heavily on custom hooks by design, much more so than other themes. You might be able to manually add a hook in a child theme if Colorlib is built properly.


After thinking through Tom Nowell's advice it occurred to me I could create a custom hook and place it after if( have_posts(). This worked like a charm. Thanks again. https://developer.wordpress.org/plugins/hooks/custom-hooks/

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.