Questions that are too localized (such as syntax errors, code with restricted access, hacked sites, hosting or support issues) are not in scope. See how do I ask a good question?
Closed 6 years ago.
Improve this questionI have new WordPress (5.0.2) install with the code added to the end of functions.php file:
function testsc(){
return "It is working!";
}
function testsc2(){
return "It is working!";
}
add_shortcode('testshortcode', testsc);
add_shortcode('testshortcode2', 'testsc2');
With Debug Objects plugin installed i can see that short codes are added:
Shortcode: testshortcode Function: testsc
Shortcode: testshortcode2 Function: testsc2
But when i put testshortcode or testshortcode2 in a page it is treated as text.
I use default theme: Twenty Sixteen.
Closed. This question is off-topic. It is not currently accepting answers.Questions that are too localized (such as syntax errors, code with restricted access, hacked sites, hosting or support issues) are not in scope. See how do I ask a good question?
Closed 6 years ago.
Improve this questionI have new WordPress (5.0.2) install with the code added to the end of functions.php file:
function testsc(){
return "It is working!";
}
function testsc2(){
return "It is working!";
}
add_shortcode('testshortcode', testsc);
add_shortcode('testshortcode2', 'testsc2');
With Debug Objects plugin installed i can see that short codes are added:
Shortcode: testshortcode Function: testsc
Shortcode: testshortcode2 Function: testsc2
But when i put testshortcode or testshortcode2 in a page it is treated as text.
I use default theme: Twenty Sixteen.
Finally it worked.
To ensure that, all following conditions must be met:
'testSC'
instead oftestSC
(unquoted), when in theadd_shortcode()
call. – Sally CJ Commented Jan 4, 2019 at 15:29functions.php
file, right? Try disabling all or certain plugins on your site. – Sally CJ Commented Jan 4, 2019 at 15:39testshortcode
. – Sally CJ Commented Jan 4, 2019 at 15:56