Created
March 24, 2017 09:36
-
-
Save dainiuxt/866a7b94f32ac29722abff9a31774a86 to your computer and use it in GitHub Desktop.
Add custom code before post content via functions.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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