Hi all,
I wrote my first shortcode based on https://pagely.com/blog/creating-custom-shortcodes/
So I added
function members_index($params = array()) {
return include(get_theme_root() . '/includes/index.php');
}
add_shortcode('members-index', 'members_index');
to functions.jsp and the php-script to /themes/includes.
It all works fine, see
http://website.eftcd.de/test/?lst_id=2
The same script, but then standalone can be found here:
http://website.eftcd.de/wp-content/themes/includes
The only issue I run into is that the digit “1” is added at the bottom, and I can not figure out why.
I checked for three things:
(1) The script is not the problem
I added a test shortcode for an empty php-script, it produces nothing (as should) except the “1” (as shouldn’t). See: http://website.eftcd.de/test2/
(2) This particular 5.3.1 WordPress installation is not the problem. I also added the test shortcode to an empty php-script to another 5.2.5 WordPress installation. The same results, a “1” were there shouldn’t be one. See: https://www.holdmetight.eu/test/
(3) I couldn’t find anything on the issue in Google.
What am I doing wrong? Any help is appreciated.
Best,
Hendrik