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!
Dina
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"); ?>
Thread Starter
dains
(@dains)
Whoops, was I misinterpreting the instructions here?
#5 on http://wordpress.org/extend/plugins/widgets-on-pages/installation/ 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!
Thread Starter
dains
(@dains)
Ok, still getting this output:
http://pastebin.com/8vb5smkN
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?
Erm… what widgets do you have in that sidebar?
Can you try changing the template to call another of the sidebars?
Thread Starter
dains
(@dains)
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?
<?php
widgets_on_template('4');
?>
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.
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.
Thread Starter
dains
(@dains)
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 🙂
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.
Todd
Thread Starter
dains
(@dains)
Thanks Todd. You might want to update the instructions then, I was just following the directions.
Ah really?
Thanks for the spot… I’ll get these updated.
Ta,
Todd