Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save matadorjobs/215ec3ea648e10dbe8154abcc6695472 to your computer and use it in GitHub Desktop.
Save matadorjobs/215ec3ea648e10dbe8154abcc6695472 to your computer and use it in GitHub Desktop.
Add "Page Builder" Shortcodes before and after Matador Job Description
<?php // do not include opening PHP tag unless required
/**
* Matador Docs : Adding "Page Builder" shortcodes before/after job description
*
* @author Jeremy Scott, Paul Bearne, Matador Software LLC https://matadorjobs.com
*
* @param $content
*
* @return string
*/
function matadordocs_the_content( $content ) {
if ( ! is_singular( 'matador-job-listings' ) ) {
return $content;
}
ob_start();
?>
EVERYTHING FOR BEFORE THE JOB DESCRIPTION HERE.
<?php
$before = ob_get_clean();
ob_start();
?>
EVERYTHING FOR AFTER THE JOB DESCRIPTION HERE.
<?php
$after = ob_get_clean();
ob_end_flush();
return do_shortcode( $before . $content . $after );
}
// Later priority of at least 50 recommended.
add_filter( 'the_content', 'matadordocs_the_content', 50 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment