Want to improve this question? Add details and clarify the problem by editing this post.
Closed 5 years ago.
Improve this questionIs there a way to create a plugin that output custom html on a page or post? I can use the shortcode, but if there is another way please let me know.
Closed. This question needs details or clarity. It is not currently accepting answers.Want to improve this question? Add details and clarify the problem by editing this post.
Closed 5 years ago.
Improve this questionIs there a way to create a plugin that output custom html on a page or post? I can use the shortcode, but if there is another way please let me know.
Share Improve this question asked Dec 31, 2019 at 12:30 sialfasialfa 32910 silver badges29 bronze badges1 Answer
Reset to default 1To create shortcode write code in the your theme file functions.php
function my_shortcode_fun() { $output = $class = ''; ob_start(); enter code here.... $output = ob_get_contents(); ob_end_clean(); return $output; } add_shortcode('my-shortcode', 'my_shortcode_fun');