Skip to content

Instantly share code, notes, and snippets.

@tcmulder
Last active December 20, 2023 18:55
Show Gist options
  • Save tcmulder/4481051 to your computer and use it in GitHub Desktop.
Save tcmulder/4481051 to your computer and use it in GitHub Desktop.
Simulate the_content() with a WordPress shortcode.
<?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