Slimbox2 integration in WP XHTML 1.0 valid

Forums Forums Slimbox2 plugin Slimbox2 integration in WP XHTML 1.0 valid

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #945
    Bentrax
    Member

    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

    #6733

    Adding it twice to the header does not make the page invalid. Adding it to the footer would though.

    #6734
    Bentrax
    Member

    With "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…

    #6735

    I think you are calling wp_head() in your footer instead of wp_foot().

    #6736
    Bentrax
    Member

    I 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…

    #6737

    That’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/.

    #6738
    Bentrax
    Member

    I 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…

    #6739
    Bentrax
    Member

    FOUND 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….

    #6740
    malcalevak
    Moderator

    My 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!

    #6741
    Bentrax
    Member

    FYI:
    I posted the modification on my blog http://blog.bentrax.de in german and english…

Viewing 10 posts - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.