EDIT
May be my question is not well formed i need to use the url http://localhost/wordpress/houses/all-houses to display a house plugin view somewhere in plugin directory
function getHouses(){
include plugin_dir_path(__FILE__) . 'public/publicHouse.php';
}
the result i'm getting is on the picture below
I'm expecting the view with the whole template and houses view inside body template area
any help is appreciated
EDIT
May be my question is not well formed i need to use the url http://localhost/wordpress/houses/all-houses to display a house plugin view somewhere in plugin directory
function getHouses(){
include plugin_dir_path(__FILE__) . 'public/publicHouse.php';
}
the result i'm getting is on the picture below
I'm expecting the view with the whole template and houses view inside body template area
any help is appreciated
Share Improve this question edited Sep 14, 2019 at 19:58 SHYAKA Rene asked Sep 14, 2019 at 8:15 SHYAKA ReneSHYAKA Rene 12 bronze badges2 Answers
Reset to default 0In your plugin class (e.g. MyPlugin), add public static function, returning some content:
public static function my_plugin_output() {
// Build your content
$output = '<div>';
$output .= 'This is a text to display.';
$output .= '</div>';
return $output;
}
Once your plugin is activated, add this line to any template, you want the plugin content to appear:
<?php if (class_exists('MyPlugin')) echo MyPlugin::my_plugin_output(); ?>
@Frank P. Walentynowicz i dit it with fake post and it worked. on this link
wordpress fake post
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745146157a4613656.html
评论列表(0条)