Skip to content

Instantly share code, notes, and snippets.

View nfmohit's full-sized avatar

Nahid F Mohit nfmohit

View GitHub Profile
@JRMorris77
JRMorris77 / before-after-content.php
Created November 18, 2017 08:41
Add HTML or Shortcode before or after the_content() - WordPress mu-plugin
<?php
// This particular example adds Hustle Social Sharing shortcode after content without editing template files on single posts/pages only.
function jmorris_before_after($content) {
$beforecontent = '';
if ( is_single() ) {
$aftercontent = '[wd_hustle_ss id="jmorris-online"]';
} else {
$aftercontent = '';
}
$fullcontent = $beforecontent . $content . $aftercontent;