• Resolved pierremaitre

    (@pierremaitre)


    Hi there,

    Thank you for this nice plugin.

    I would like to be able to insert some php code into a kaya shortcode. My specific need is to dynamically display the post title

    I tried something like :

    <?php echo do_shortcode( '[kaya_qrcode content="echo the_permalink();"]' ); ?>

    But it does not work…

    Any solution?

    Thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter pierremaitre

    (@pierremaitre)

    I answer to myself, this code works:

    <?php echo do_shortcode('[kaya_qrcode content="' . get_permalink() . '"]'); ?>
    Plugin Author Kaya Studio

    (@kayastudio)

    Hello,
    Thank you for your comment and for using ‘Kaya QR Code Generator’.

    Indeed, your first snippet was wrong because it did not contain the concatenation between “get_permalink()” and the string, and also had an extra semicolon.

    I’m glad that you resolved your issue.

    I set the topic as resolved.

    Best regards.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘php in shortcode’ is closed to new replies.