• Resolved 3cstudio

    (@3cstudio)


    @toddhalfpenny, I added:
    <?php echo do_shortcode(“[widgets_on_pages id=”1″]”); ?>
    …to a PHP file that is the homepage, and got:
    Your PHP code changes were rolled back due to an error on line 5 of file wp-content/themes/custom-wktv/front-page.php. Please fix and try saving again.
    syntax error, unexpected ‘1’ (T_LNUMBER), expecting ‘)’
    __________

    after seeing two resources suggest that was the proper way to add a shortcode in the Theme File Editor. Can you spot my error? This makes the site go blank-white… thanks in advance!

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Thread Starter 3cstudio

    (@3cstudio)

    I’m all set — I was pointed in the right direction by a colleague proficient in PHP — it should have been:

    <?php echo do_shortcode('[widgets_on_pages id=1]'); ?>

    …minus the double quotes & no quotes around the 1.

Viewing 1 replies (of 1 total)
  • The topic ‘adding a Widget on Pages to a PHP file’ is closed to new replies.