Insert content of a post into another

When you use return in your function, the rest of the function will not run. It work somehow like exit(); or die();, but it won’t terminate the entire script, only ends that particular piece of code in your function, and return a value if necessary. You should save your content into a string, and then … Read more

Use of Templates in a Plugin

You would need to add a filter to the page_template hook that will look for whatever criteria you need. For example, if your plugin was for a custom post type you would have something like this: function myCustomTemplate( $page_template ) { // Check theme for template file $located = locate_template( ‘single-{{postype}}’ ); if ( ! … Read more