Skip to content

Instantly share code, notes, and snippets.

@dainiuxt
Created March 24, 2017 09:36
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 dainiuxt/866a7b94f32ac29722abff9a31774a86 to your computer and use it in GitHub Desktop.
Save dainiuxt/866a7b94f32ac29722abff9a31774a86 to your computer and use it in GitHub Desktop.
Add custom code before post content via functions.php
<?php
function my_before($content) {
if (is_single()) {
$beforecontent = previous_post_link(); ?> | <?php next_post_link();
$content = $beforecontent . $content;
return $content;
}
return $content;
}
add_filter('the_content', 'my_before');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment