Interestingly I have some problems with this myself.
We called it as such:
if (function_exists(‘bcn_display’)) {
$json=json_decode(bcn_display_json_ld(true));
Worked smashingly in development, but when taken to production, the function returns NULL.
Everythings latest version in both environments….
So on line 1265 of class.bcn_breadcrumb_trail.php , I commented out this:
// , JSON_UNESCAPED_SLASHES
And it all works just fine. PHP version? I saw this in my php logs:
PHP Notice: Use of undefined constant JSON_UNESCAPED_SLASHES – assumed ‘JSON_UNESCAPED_SLASHES’ in …/wp-content/plugins/breadcrumb-navxt/class.bcn_breadcrumb_trail.php on line 1265
So I just removed it on a lark, and it works.
-
This reply was modified 8 years, 6 months ago by
bretweinraub.
@lsilver:
Something like:
<?php if (function_exists(‘bcn_display’)) {?><script type="application/ld+json"><?php bcn_display_json_ld();?></script><?php } ?>
can be placed in your theme’s header.php (or place that code in a function and have it hook into into the wp_head action).
@bretweinraub:
It’s likely your server is running PHP5.3, which is ancient. New features in Breadcrumb NavXT require PHP5.4 or newer. In general, testing old versions of PHP is becoming incredibly difficult (my OS vendor no longer has PHP older than 5.5 in their package manager and travis.ci no longer supports PHP5.3).
Thanks, worked perfectly.