Support Forum
I know support is for members, but I've subscribed a couple times already in the past just to download plugins, and I think this is my first support question ever, so hopefully you all can point me in the right direction.
I'm not super savvy with WordPress so bear with me. I'm trying to enqueue a script into my wordpress site. I figured out how to do this last night, and it works on the site.
However, it doesn't work on our forums, which is where I need the script to work. I'm assuming the script needs to be enqueued in the SP plugins itself, but I have no idea where. I tried sticking it in various places in the SP phps, but you can probably guess it just broke things.
I just need to know the proper way to enqueue scripts into SP.
Thanks. Btw love SP. I swear by it. People even wanted me to use other forums on my site like vbulletin, but I defend my choice in SP every time!
do you know how to use WordPress action hooks? If you ONLY want your script to run on the page the forum displays on then you can use our hook.
Create a an empty php file called 'sp-user-functions.php' and place it in the wp-content folder.
Then use the action - 'sph_scripts_end' - which we define after the SP scripts are enqueued. This action hook passes one argument which is true if the scripts are to be loaded on the footer or else false if header.
The beauty of the file in wp-content is that we or anything else will never try and update or change it so it is future-proof. It was introduced in 5.5.8.
Hope that helps.
YELLOW
SWORDFISH
|
Thank you very much! That worked just fine. However, and this is my fault, but I couldn't get it to work initially. Basically my scripts allow users to utilize bbcode to add special links in their posts that create tooltip popups when mousing over them. Well, I had my profile set to use rich text editor and not bbcode, so it kept reformatting my bbcode, lol!
Anyways, thanks for the help! It works now.
You can see it in action, if you like =D
Just mouse over the text. Cheers!
Glad to hear all is working!
Visit Cruise Talk Central and Mr Papa's World
1 Guest(s)