Adding code before and after text of article

 

/* =================================================================================
 * CODES BEFORE and AFTER TEXT
 * ================================================================================= */
function functionsphp_html_in_content( $content ) {
 
    if ( !is_single() ) {
        return $content;
    }

    $before = <<<EOT
<!-- code bwfore article -->
EOT;

    $after .= <<<EOT
<!-- code after article -->
EOT;

   return $before . $content . $after;

}
add_filter( 'the_content', 'functionsphp_html_in_content' );
/* ================================================================================= */