Forums › Forums › Slimbox2 plugin › Slimbox2 integration in WP XHTML 1.0 valid
- This topic has 9 replies, 3 voices, and was last updated 15 years, 3 months ago by Bentrax.
-
AuthorPosts
-
July 28, 2009 at 9:07 am #945BentraxMember
Hi,
while using Slimbox2 in addtione to Picasa Image Express for WP I encoutered that after addin the Addon, my page is not longer XTHML 1.0 Transitionla valid.
Slimbox2 seems to add its link to its stylesheet twice to the page, in the header (html head section) and in the footer of WP.
Is it possible to correct that to get a valid document again?Thanks in advance.
Regards
Bentrax
July 28, 2009 at 11:12 am #6733imported_RyanMemberAdding it twice to the header does not make the page invalid. Adding it to the footer would though.
July 28, 2009 at 11:26 am #6734BentraxMemberWith "twice" I meant it is twice in the whole code of the page. One time in the html-head-section and one time in the footer generated by WP…
Watch the output at http://blog.bentrax.de, there are not pics on the page using Slibox2 yet but the styles are included…
July 28, 2009 at 11:28 am #6735imported_RyanMemberI think you are calling wp_head() in your footer instead of wp_foot().
July 28, 2009 at 11:39 am #6736BentraxMemberI checked the call in the theme, it is "wp_footer()". I commented it out and all the stuff was gone but i had more errors since some other scripts rely on a metion in the footer…
July 28, 2009 at 2:23 pm #6737imported_RyanMemberThat’s a very weird problem you have there. Hopefully malcalevak can figure out what is going on for you. The plugin seems to be working fine on http://transientmonkey.com/.
July 28, 2009 at 7:32 pm #6738BentraxMemberI think I found something.
I am using the addon SyntaxHighlighter Evolved too.
So this addon adds neede scripts in the footer by calling the function "wp_print_scripts( $scripts );". Right before that call the array $scripts is filled with values.
If i comment this call out the doubled entry of Slimbbox2 css file is gone but the scripts of the other plugin too. Somehow that function puts out the link fpr the css too. Didnt figure out yet why…July 28, 2009 at 8:05 pm #6739BentraxMemberFOUND IT!
I dont know much about PHP and WP and WPAPI and stuff…
Well in you plugin code you have the wp_slimbox() function. And an add_action(‘wp_print_scripts’, ‘wp_slimbox’);" call
This call seems to be the problem. It leaves the css link line somewhere and when the other addon calls that function it is added again. I dont know who did what wrong but I edited your plugin to the following:
I edited your add_action call to "add_action(‘init’, ‘wp_slimbox’);"
and added a second one "add_action(‘wp_head’, ‘wp_slimbox_css’);"
Then I removed the echo statement print the style link in the function wp_slimbox() and made another functione called "wp_slimbox_css()" with only that echo staement in it.
Now it works.
The css line is on an other place a bit lower in the code after the javascripts are but in the head section. And the footer stay clear…
Please tell me what you think….July 28, 2009 at 11:04 pm #6740malcalevakModeratorMy apologies for not responding sooner, I’ve been ridiculously busy lately. So busy that I haven’t even gotten to start work on the next plugin that I’d wanted to do.
When I get some time I’ll try and look into this and your solution, but at a glance it looks like your solution is a perfect fix, and there’s a good chance that’s how it was actually supposed to be done. This is my first plugin (though I did contribute to Ryan’s Multi-Level Navigation Menu plugin), so I’m still learning things.
Anyway, once I get some more time, if I still think it’s a good fix I’ll likely make a new release to incorporate it and a few other small things.
Thanks for proactively looking into a possible solution on your own!
July 31, 2009 at 8:27 am #6741BentraxMemberFYI:
I posted the modification on my blog http://blog.bentrax.de in german and english… -
AuthorPosts
- You must be logged in to reply to this topic.