Last active
September 8, 2024 14:41
-
-
Save kadimi/3fc2ec38ae41fed06f0a2d76a39df5f2 to your computer and use it in GitHub Desktop.
SportsPress: Show tournament editor content first
This file contains hidden or 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 | |
add_filter('the_content', function($content) { | |
if (is_singular('sp_tournament')) { | |
ob_start(); | |
?> | |
<div class='tournament_text_first'><?php echo $content; ?></div> | |
<style> | |
.entry-content { | |
display: flex; | |
flex-direction: column; | |
} | |
.entry-content > * { order: 2; } | |
.entry-content > .tournament_text_first { order: 1; } | |
</style> | |
<?php | |
$content = ob_get_clean(); | |
} | |
return $content; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment