Adding content to the top of post’s based on their category

You can use the the_content filter for this: add_filter( ‘the_content’, ‘wpse420024_filter_content’ ); /** * Conditionally adds content above the post content. * * @param string $content The post content. * @return string The filtered post content. */ function wpse420024_filter_content( $content ) { // Only run on the single post view. if ( is_single() ) { … Read more