• Hi,

    How to use ‘[cfdb-json]’ shortcode in my theme.

    — functions.php write —
    $json = do_shortcode(‘[cfdb-json form=”form name” trans=”CountInField(user,point)&&NaturalSortByField(point,DESC)” tfilter=”Submitted>=2016-12-01&&Submitted<2017-01-01″]’);
    var_dump( $json );

    but, shortcode dose not working.

    output: string “[cfdb-json form=”form name” trans=”CountInField(user,point)&&NaturalSortByField(point,DESC)” tfilter=”Submitted>=2016-12-01&&Submitted<2017-01-01″]”

    Please help, thank you.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Michael Simpson

    (@msimpson)

    Do all shortcodes not work in your theme? It may be a problem with the Theme.

    Also try a short version to see if that works:
    $json = do_shortcode('[cfdb-json form="form name"]');

    Thread Starter ibridge_jp

    (@ibridge_jp)

    Thank you for reply.

    $json = do_shortcode(‘[cfdb-json form=”form name”]’);
    var_dump( $json );
    ->Not working

    $json = do_shortcode(‘[cfdb-html form=”form name”]’);
    var_dump( $json );
    ->Not working

    $json = do_shortcode(‘[cfdb-table form=”form name”]’);
    var_dump( $json );
    ->Working

    $json = do_shortcode(‘[cfdb-datatable form=”form name”]’);
    var_dump( $json );
    ->Working

    Thread Starter ibridge_jp

    (@ibridge_jp)

    Hi, I was a lack of confirmation

    $json = do_shortcode(‘[cfdb-json form=”form name”]’);
    var_dump( $json );

    -Display
    <script type=”text/javascript” language=”JavaScript”>
    var cf7db = [
    {“Submitted”:”2016-12-03″, *** }
    ];
    </script>

    But,

    $json = do_shortcode(‘[cfdb-json form=”form name” trans=”CountInField(user,point)&&NaturalSortByField(point,DESC)” tfilter=”Submitted>=2016-12-01&&Submitted<2017-01-01″]’);
    var_dump( $json );

    Not working.

    -Display
    string “[cfdb-json form=”form name” trans=”CountInField(user,point)&&NaturalSortByField(point,DESC)” tfilter=”Submitted>=2016-12-01&&Submitted<2017-01-01″]”

    Plugin Author Michael Simpson

    (@msimpson)

    Ensure there are no line breaks inside the shortcode string.

    Thread Starter ibridge_jp

    (@ibridge_jp)

    Hi,

    There is no line break.
    Why is nothing displayed if “TRANS” is used?

    Plugin Author Michael Simpson

    (@msimpson)

    Since you are seeing the shortcode itself being printed out. That suggests that WordPress could not parse the shortcode and execute it. So there is probably a syntax error in your shortcode. I don’t see one based on what you posted. But please repost what you have formatted as “code” so I can see if there are any subtle errors.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘‘[cfdb-json]’ shortcode use in my theme’ is closed to new replies.