Viewing 12 replies - 1 through 12 (of 12 total)
  • Thread Starter 8persap

    (@8persap)

    Hello there, hope all is good.

    So, any idea why the custom styling isn’t applied when I move the site to display in root?

    Thanks

    Mark.

    Plugin Author John Regan

    (@johnregan3)

    Hi 8persap,

    When I try to look at http://iski-val.com, I get redirected to the subdirectory website, so I can’t exactly see what’s going on. If you could, on the root site, check your <HEAD> for a <LINK> with a url that ends with “?sccss=1&ver=3.6.1” Then, open that URL and ensure it is a css file containing your CSS.

    If you could do that much for me, it would give us a good start on solving this.

    Thanks for your question!

    John

    Thread Starter 8persap

    (@8persap)

    Yes, I had to keep it in the redirect to the subdirectory as the styles broke when I set it up to display in root.

    Great. Thanks for the advice John, I’ll try that.

    Thanks.

    Plugin Author John Regan

    (@johnregan3)

    Great. Glad I could help!

    Nicole

    (@teamsoarblog)

    Hi there, I’m having the same problem on my site after moving wordpress to my root: http://nelthropp-low.com/

    I checked the file as you mentioned above in the <head> and my custom CSS is there. A few of my plugins do not work after the move, but several do. The only one I am concerned with is Custom CSS as it is such a helpful plugin.

    Thank you!!

    I love how simple the plugin is, and after initially seeing it work, I added it as my CSS plugin of choice on most of my sites. It does seem like it doesn’t work in the case of a different WordPress directory and Site URL, though.

    The fix above has only sidestepped the problem. Leaving the Site URL and the WP directory the same may be fine for 8persap, althoguh I’m sure there are lots of people (myself included) who either have them set differently, or want to move the structure so it’s not http://www.site.com/wp-dir that people see when they go there.

    It looks like anything that has the ?sccss=XXXX extension will return the CSS file, which is really flexible – I’d like to know why despite the file (I know there’s no actual file there) being linked properly, the CSS styles are not being applied to the page.
    http://iski-val.com/iski/fake/subdir/?sccss=1&ver=3.8

    Looking on the source code for the page, the file is linked, and is generated when you access the CSS link.

    Plugin Author John Regan

    (@johnregan3)

    Hi majorredbeared, Thanks for your input! I’m really not sure why this is happening.

    Just to make sure I’m understanding this correctly, you all are saying the link is showing up, and when you open it the CSS appears. However, the CSS isn’t being applied to the page, right?

    That’s correct – the CSS link works when you click on it from the page source, but as I posted above with the fake link, anything with the “?sccss=1&ver=3.8” link applied to it inside the WordPress install folder or domain will return the CSS file.

    I just wanted to make sure that people reading this didn’t think that 8persap’s issue above was resolved – what happened was he reverted to keeping his Site Address the same as the WordPress Directory. Making the m different, which you very likely know, is how people host their WordPress install in http://www.site.com/wordpress, but displays as http://www.site.com to people viewing the page.

    I have the same issue on a multisite install at 3.7.1 (3.81.1 update pending once our testing is complete).

    I’m running the WordPress Custom CSS aka Safe CSS plugin http://wordpress.org/plugins/safecss/ rather than the http://wordpress.org/plugins/simple-custom-css/ plugin, but have the same issue. Noting here in case it helps with resolving the issue reported here. (The plugin I’m using was eventually folded into and is not maintained outside of Jetpack.)

    To rule out caching, I added a css comment echoed from the plugin’s php file – shows up cleanly in the browser. I then added a css rule in the same way: it shows up in the file when called directly, but the css rule is not applied by the browser. Next I checked the php header to see if it was properly serving the file as text/css and all seems correct there. To fully isolate the plugin, I created a simple html file that calls the “file” for the custom css as noted in the page source. When loading the html file, the styles are still not being interpreted by the browser. Wonder if it’s related to output form the built-in css-tidy module, but rather than strip that out, I installed the http://wordpress.org/plugins/my-custom-css/ plugin for comparision. (This is a simpler plugin – no css validation and doesn’t give an option to append or replace the existing css, but it does have syntax highlighting.) This works for me and supports multisite, but I don’t want to change over the whole network, so I’m watching this thread to see if there may be a solution to fix the plugin I’m using. (Alternate solution may be to pull this module out of Jetpack for use as a standalone plugin.)

    Has anyone come up with a better solution or gotten to the bottom of what’s happening with this issue?

    Hi,
    I solved the issue changing the line
    wp_register_style( 'sccss_style', '/?sccss=1' );
    to
    wp_register_style( 'sccss_style', home_url('/?sccss=1') );

    Hope this helps.

    Plugin Author John Regan

    (@johnregan3)

    Thanks, lopo! I’ve been wrestling with this for a while now, and you’re fix is so simple that I missed it. I’ll push this out today.

    Follow me up on Twitter (@johnregan3), buddy. I’ve got something for you to say “Thanks”!

    You’re welcome!

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘Problem when moving sub directory install to view in root’ is closed to new replies.