Page 1 of 2 12 LastLast
Results 1 to 10 of 16

Thread: WP3 multi site engue_style issue

  1. #1
    Rich Pedley's Avatar
    Rich Pedley is offline Hello World
    Join Date
    May 2009
    Location
    Liverpool, UK
    Posts
    92

    Default WP3 multi site engue_style issue

    (misspelled enqueue in title - oops)
    I've installed WP3, and set it up to use directories for testing my plugins with it. Everything works fine except for one small portion.

    PHP Code:
    wp_register_style('myStyleSheets'$myStyleUrl);
    wp_enqueue_style'myStyleSheets'); 
    this outputs as expected:
    HTML Code:
    <link rel="stylesheet" id="myStyleSheets-css" href="http://127.0.0.1/wpbetamu/eshop/files/eshop_files/eshop.css?ver=3.0" type="text/css" media="all">
    But the css is not being parsed. However it will if I remove the ?ver=3.0 from the end.

    So I tried this:
    PHP Code:
    wp_register_style('myStyleSheets'$myStyleUrl,'','',''); 
    and can't stop it being added to the end.(tried a few variants of that as well).

    So is this a problem for me as I'm testing locally, or is this a multi site issue?

  2. #2
    Rarst's Avatar
    Rarst is offline Big Tipper
    Join Date
    Jul 2009
    Posts
    322

    Default

    Very strange behavior. For browser version tag should absolutely make no difference. Try Firebug or some other tool to verify that file is served fine with correct mime type and everything.

    As for removing version (if you really need to in the end) see this post.
    Rarst.net - cynical thoughts on software and web (and sometimes WP) | @Rarst | I seem to be non-GPL-compliant person. Beware my poisonous thoughts.

  3. #3
    Ryan's Avatar
    Ryan is offline WordPress Legend
    Join Date
    Jan 2009
    Location
    New Zealand
    Posts
    2,801

    Default

    That certainly isn't a multi-site issue since WordPress has long since finished doing it's thing by the time that problem occurs.

    Are you sure it isn't just a browser caching issue of some sort? Perhaps try clearing your cache or try another browser to see if the problem persists.

  4. #4
    Rich Pedley's Avatar
    Rich Pedley is offline Hello World
    Join Date
    May 2009
    Location
    Liverpool, UK
    Posts
    92

    Default

    well if I read the documentation correctly you should be able to suppress the version variable being added, and it doesn't appear to be working. Can anyone confirm that I'm right/wrong?

    [the headers look to be correct]

  5. #5
    Rich Pedley's Avatar
    Rich Pedley is offline Hello World
    Join Date
    May 2009
    Location
    Liverpool, UK
    Posts
    92

    Default

    that's how I noticed it, by using another browser.

  6. #6
    wpmuguru is offline Here For The Peanuts
    Join Date
    Sep 2009
    Posts
    133

    Default

    What happens when you just request

    http://127.0.0.1/wpbetamu/eshop/files/eshop_files/eshop.css?ver=3.0

    vs

    http://127.0.0.1/wpbetamu/eshop/files/eshop_files/eshop.css


  7. #7
    Rarst's Avatar
    Rarst is offline Big Tipper
    Join Date
    Jul 2009
    Posts
    322

    Default

    Quote Originally Posted by Rich Pedley View Post
    well if I read the documentation correctly you should be able to suppress the version variable being added, and it doesn't appear to be working. Can anyone confirm that I'm right/wrong?
    Wrong. Version argument in wp_register_style() is to change version, it can't disable it. It defaults to false, so when you pass empty value to it it simply acts if nothing happened and attaches version tag as usual.

    For how to remove version tag see post I linked to above.
    Rarst.net - cynical thoughts on software and web (and sometimes WP) | @Rarst | I seem to be non-GPL-compliant person. Beware my poisonous thoughts.

  8. #8
    Rich Pedley's Avatar
    Rich Pedley is offline Hello World
    Join Date
    May 2009
    Location
    Liverpool, UK
    Posts
    92

    Default

    Quote Originally Posted by wpmuguru View Post
    What happens when you just request

    http://127.0.0.1/wpbetamu/eshop/files/eshop_files/eshop.css?ver=3.0

    vs

    http://127.0.0.1/wpbetamu/eshop/files/eshop_files/eshop.css

    First downloads, second is viewable (and yes this does make me think it may be my server setup).

    Quote Originally Posted by Rarst View Post
    Wrong. Version argument in wp_register_style() is to change version, it can't disable it. It defaults to false, so when you pass empty value to it it simply acts if nothing happened and attaches version tag as usual.

    For how to remove version tag see post I linked to above.
    Ahh thanks for clearing that up.

  9. #9
    Rich Pedley's Avatar
    Rich Pedley is offline Hello World
    Join Date
    May 2009
    Location
    Liverpool, UK
    Posts
    92

    Default

    argh figured it out:
    RewriteRule ^([_0-9a-zA-Z-]+/)?files/(.+) wp-includes/ms-files.php?file=$2 [L]
    in the htaccess is causing issues, so I need to change the location, or add a rewrite rule, or something.
    Last edited by Rich Pedley; 06-20-2010 at 05:30 AM.

  10. #10
    Rich Pedley's Avatar
    Rich Pedley is offline Hello World
    Join Date
    May 2009
    Location
    Liverpool, UK
    Posts
    92

    Default

    ugh, it gets worse, with a little tinkering I've found out my css file is being served thusly:
    Content-Type: image/0

    (not sure how I missed that first time around, apologies)

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •