Support » Plugin: Widgets on Pages » [Plugin: Widgets on Pages] Template tag feature not working?

  • Resolved dains


    Hi, I’ve used Widgets on Pages for the template tag feature in the past and found it very valuable for themeing. I don’t have that past work available as a check, but I’m finding that the template tag feature doesn’t seem to work now. I’ve upgraded to 3.2.1 on my development sites and have some testing results for you.

    Here’s the output I get from a text widget inserted using WTP’s template tag call ‘widgets_on_template(“wop_5”);’ :

    [Code moderated as per the Forum Rules. Please use the pastebin]

    I’ve tried both the default markup of “wop_#” and swapping double quotes for single quotes ‘wop_#’ and neither way seems to work.

    Any help would be appreciated!


Viewing 11 replies - 1 through 11 (of 11 total)
  • Ciao David,
    you must replace “wop_1” with the name of your WoP.

    If your WoP is 5 the template tag will be:
    <?php widgets_on_template('5'); ?>

    It worked out for me!


    Plugin Author toddhalfpenny


    dgitaky is correct… so if you haven’t set any specific names and you want to access the third sidebar up you’re probably going to need something like

    <?php widgets_on_template("Widgets on Pages 3"); ?>

    Whoops, was I misinterpreting the instructions here?

    #5 on says use “php widgets_on_template(“wop_1″);”. I assumed that meant use “wop_+the number of the WOP widget”, which is 5 in my case.

    So it will work with just the number then, or with the specific name, and passed as a string either way. I can deal with that. Thanks for the help!

    Ok, still getting this output:

    It appears to be calling the right widget, but no output. The content is just a simple function to output something, and works fine when placed directly on the page. Any ideas?

    Plugin Author toddhalfpenny


    Erm… what widgets do you have in that sidebar?
    Can you try changing the template to call another of the sidebars?

    Hmm it seems that passing the number instead of the name is causing the problem. I tried the name and it worked fine in all cases, but number did not work either in template tag or shortcode.

    Do you see anything wrong with this?


    I’d really rather not use names because if they get changed, you have to change the code as well, whereas numbers are more-or-less static.

    Plugin Author toddhalfpenny


    Ha ha… do you know what I can’t even remember if it accepts a numerical value.., it was such a long time ago that I coded it.

    I’ll check the code and and post an update here.

    Thank you Todd! This is the ONLY plugin that gets rid of all that template and functions.php coding to put widgets in, so it’s really good to see it’s still supported. I wish it was core 🙂

    Plugin Author toddhalfpenny


    Hey dains,

    Seems that you have to use the name… and I also think this is the best way to do it… I mean if you name the sidebar then you should really use that as it’s much more meaningful.

    Sorry if this doesn’t match the way you want to use it.


    Thanks Todd. You might want to update the instructions then, I was just following the directions.

    Plugin Author toddhalfpenny


    Ah really?

    Thanks for the spot… I’ll get these updated.


Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘[Plugin: Widgets on Pages] Template tag feature not working?’ is closed to new replies.