Replacing Page Content
-
So I’d like to be able to put a shortcode at the begging of a page. Then if certain conditions aren’t met only display what’s generated by the shortcode, not any of the other content in the page.
Simply put, I’d like to be able to do something like this:
add_shortcode('myshortcode','myfunction' ); function myfunction( $atts ) { if ( somestuff ) { Display the page's content. Short code basically does nothing. } else { Replace all of the page's content. Completely replace the content with php code here. }So far everything I’ve tried has failed.
The topic ‘Replacing Page Content’ is closed to new replies.