Unable to echo to the front end
-
I am learning WordPress from a book and while learning about how to use action hooks the author gives the below code . I am assuming this would change the footer at the front end.
<?php function boj_example_footer_message() { echo 'This site is built using < a href="https://www.remarpro.com" title=”WordPress publishing platform” > WordPress < /a > .'; } add_action( 'wp_footer', 'boj_example_footer_message', 100 ); ?>
To test this out I created a plugin and had the above code put in the main plugin file . However , upon activation I get :
"The plugin generated 8 characters of unexpected output during activation. "
What causes this ? What is the correct way to echo to the front end on an action hook ? How to make this work ?
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Unable to echo to the front end’ is closed to new replies.