I make plugin for WordPress, and I want to add content php file to end of post content.
This is my plugin file:
add_filter('the_content', 'modlifyContent');
function modlifyContent($content)
{
global $post;
$content .= include(plugin_dir_path(__FILE__) . 'my_plugin_test.php');
return $content ;
}
but, content php file is added at start of post content.
This is content php file which I want to include to of post content:
<div>
<a href="<?php echo get_post_meta($post->ID, 'url', true); ?>">Enter</a>
<span>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque sed ipsum augue.</span>
</div>
How I can include content of php file to the end of post content?