Created
July 10, 2017 12:37
-
-
Save domantasg/71d5d5825ccbb8512534f06a6e858fe8 to your computer and use it in GitHub Desktop.
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
// Hook the get_the_excerpt filter hook, run the function named mfp_Add_Text_To_Excerpt | |
add_filter("get_the_excerpt", "mfp_Add_Text_To_Excerpt"); | |
// If today is a Thursday, remove the filter from the_excerpt() | |
if (date("l") === "Thursday") { | |
remove_filter("get_the_excerpt", "mfp_Add_Text_To_Excerpt"); | |
} | |
// Take the excerpt, add some text before it, and return the new excerpt | |
function mfp_Add_Text_To_Excerpt($old_Excerpt) | |
{ | |
$new_Excerpt = "<b>Excerpt: </b>" . $old_Excerpt; | |
return $new_Excerpt; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment