I am trying to create a shortcode from a custom function in WP but it seems like I'm doing something wrong.
I have a function in child's theme function.php and add_shortcode code:
function uniquetestfunction() {
echo '<div class="my_class">Test Element</div>';
}
add_shortcode(‘uniqueshortcodename’,’uniquetestfunction’);
Which should generate a shortcode [uniqueshortcodename]. I have done this with existing functions in different plugins and it worked fine.
But when added to a page, it's not rendering the function, just showing the shortcode as a text. Any ideas what I'm doing wrong?
I'm very new to PHP :) Thanks