Last active
December 20, 2023 18:55
-
-
Save tcmulder/4481051 to your computer and use it in GitHub Desktop.
Simulate the_content() with a WordPress shortcode.
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 | |
/** | |
* Set up faux the_content() simulation | |
* | |
* You can use this to simulate the_content() through a shortcode. Simply | |
* add the shortcode [faux] on any page in wp-admin and publish. Then, | |
* Then, make all your changes in your favorite text editor in the includes/faux-content.php | |
* file. Once finished, paste the contents of includes/faux-content.php into the page in wp-admin. | |
*/ | |
function faux_the_content_() { | |
$content = file_get_contents(get_bloginfo('template_url').'/includes/faux-content.php'); | |
$content = apply_filters('the_content', $content); | |
return $content; | |
} | |
add_shortcode('faux', 'faux_the_content_'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment