WordPress.org

Ready to get started?Download WordPress

Forums

QR Code Tag
Embedding in a Theme not working? (1 post)

  1. callumw
    Member
    Posted 3 years ago #

    Hi
    Great plugin and very customisable which puts it in my "must have" folder.

    But .... I'm having an issue merging the code into my template.
    I know there's an issue where it can't be in a page twice, but I use the widget only in my "contact me" page (via widget logic), so there's no conflict there.

    I'm using a conditional tag as I only want the QR to appear in blog entries and not in regular pages.

    In the index.php I located (the_content) and confirmed the correct location by using random text after which correctly appeared at the bottom/end of every blog page.

    I swapped the random text with the <img... code as mentioned in the plugin settings page, but it's not showing and I can't see why.

    I tried variations on the PHP, but I can't get it working.

    The code I used was
    '
    <?php if (!is_page()) : ?>
    <img src="<?php
    global $qrcodetag;
    echo $qrcodetag->getQrCodeUrl($content, $size, $encoding, $ecc, $margin, $version); ?>">
    <?php endif; ?>
    '

    I also tried:

    <?php if (!is_page()) :  ?>
    <?php global $qrcodetag; ?>
    <img src="<?php echo $qrcodetag->getQrCodeUrl($content, $size, $encoding, $ecc, $margin, $version); ?>" />
    <?php endif; ?>

    Neither worked.
    Am I missing something obvious?

    Ta
    CallumW

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic