function test( $atts, $content = null ) {
return ‘<p>TEST TEXT</p>’;
}
add_shortcode(‘test’, ‘test’);
It still comes out blank.
Why change the theme? Everything else works, its just the shortcodes?
Why change the theme? Everything else works, its just the shortcodes?
Your theme could have same function ‘test’, could have some function which won’t let you have your own shortcodes, could have function to disable shortcodes, coud have removing filter etc, and etc.
It’s a custom theme. There is nothing to do with shortcodes up to this point.
It’s a custom theme. There is nothing to do with shortcodes up to this point.
Add this in your functions.php:
add_filter('the_content', 'do_shortcode', 11);
Does anyone know what I am doing wrong?
Test it on a default theme.
It works on the default theme.
So then there’s something in your theme as suggested above
Your theme could have same function ‘test’, could have some function which won’t let you have your own shortcodes, could have function to disable shortcodes, coud have removing filter etc, and etc.
This is my entire functions.php. What is causing the problem, then? This is the first theme I have ever made myself, so I really have no idea what is going wrong.
<!--sidebar -->
<?php
/*if ( function_exists('register_sidebar') )
// Sidebar Widget
register_sidebar(array('name'=>'right-Sidebar',
'before_widget' => '<li>',
'after_widget' => '</li>',
'before_title' => '<h3>',
'after_title' => '</h3>',
));*/
function test( $atts, $content = null ) {
return '<p>TEST TEXT</p>';
}
add_shortcode('test', 'test');
?>
Hello?
I replaced the entire functions.php of the twentythirteen theme, and it works properly. I did the same with my custom theme, and it does not work:
<?php function test( $atts, $content = null ) {
return '<p>TEST TEXT</p>';
}
add_shortcode('test', 'test'); ?>
So does anyone want to help out? Or…?