Notice: These forums are now retired and closed. For active support, please Submit a Ticket or visit our official WordPress.org community pages.
Kadence Theme | Kadence Blocks | Starter Templates | WooCommerce Email Designer | Ascend | Virtue | Pinnacle

Hook filter/action to functions.php

Home / Forums / Virtue Theme / Hook filter/action to functions.php

This topic is: Resolved
[Resolved]
Posted in: Virtue Theme
May 27, 2018 at 3:18 pm

Hi Team,
I want to add a function into a child single.php template but understand that the best way is to identify the right hook and add the code to functions.php. Please could you help?

For Custom post type epkb_post_type_1 I am adding a filter using:
// Function to add "What Links Here" to Knowledge Base articles
add_filter( 'the_content', 'my_wp_wlh_the_content', 10, 1 );
function my_wp_wlh_the_content( $content )
{
$wlh = do_shortcode( '[wp_what_links_here]' );

if( '' !== $wlh )
return "The following articles link to this document:" . $wlh . $content;

return $content;
}

Instead, I’d like to hook into ‘kadence_single_post_content_before’ and position the list of linked items before the “Back” button. (please see site, login to follow).
Very many thanks,
Phil.

  • The forum ‘Virtue Theme’ is closed to new topics and replies.