/home/<website>/public_html/wp-content/themes/basic/functions.php
At the very end of the file, I have included these 8 lines:
// Add Shortcode
function custom_shortcode() {
return "Hello world.";
}
add_shortcode( 'test', 'custom_shortcode' );
Doesn't work and I can't figure out why.
I am self-hosted running the free Basic theme. I have the following plugins:
- Cache Enabler,
- Disable Emojis,
- Remove Google Fonts References,
- UpdraftPlus - Backup/Restore,
- WP Fastest Cache,
- WP Statistics.
I've tried various different ways of doing this and have looked up several guides. They all say to do exactly what I'm doing and that it will work, but when I do it it does not work.
init
hook.[test]
shortcode? have you verified that you have edited the correct file?