Giter Site home page Giter Site logo

not working in subfolder about sage HOT 17 CLOSED

roots avatar roots commented on May 3, 2024
not working in subfolder

from sage.

Comments (17)

retlehs avatar retlehs commented on May 3, 2024

nice catch, i hadn't tested roots in a subfolder since we added rewrites from /wp-content/themes/roots/css/ (and js/ and img/) to /css/ etc.

looking into it now -- looks like it's in roots-cleanup.php starting at line 28 that must be fixed

from sage.

swartsr avatar swartsr commented on May 3, 2024

Thanks for looking into this! I'm having the same issue... I set up a child theme folder for my website so when you update I can pull down your latest stuff without breaking anything. It seems to be causing broken links for me too. Thank you!

from sage.

retlehs avatar retlehs commented on May 3, 2024

@swalkinshaw is working on a fix but not sure when he'll get it out (just left for a trip today)

in the meantime you could removes lines 1 through 45 on roots-cleanup.php to get it so you can at least work in a subfolder for now -- basically remove the roots_add_rewrites and roots_clean_assets/plugins functions

from sage.

swartsr avatar swartsr commented on May 3, 2024

Thanks! Appreciate it!

from sage.

misfist avatar misfist commented on May 3, 2024

I also have WP installed in a sub-directory (called /wordpress) and am having the same problem. I commented out lines 8-45 (line 1 is <?php and 2-7 are already commented out), but it's looking for css, js and img directories in:

/wp-content/themes/roots/
It needs to be:
/wordpress/wp-content/themes/roots/

Any ideas?

Thanks!

from sage.

retlehs avatar retlehs commented on May 3, 2024

hmm the rewrite rules might need to be flushed after that -- try going to the permalinks page and clicking 'save' just to make that happen

if you still have the problem then you can take out the root relative filters in roots-cleanup.php

sorry about the troubles in subfolders! will get this fixed asap.

from sage.

retlehs avatar retlehs commented on May 3, 2024

i think scott got this working.. will try and push it out to the repo tonight

from sage.

swalkinshaw avatar swalkinshaw commented on May 3, 2024

Updated relative path function to work with sub dirs - closed by 40485c7

from sage.

misfist avatar misfist commented on May 3, 2024

I replaced the roots-cleanup.php file and it appears to be working correctly.

Thanks!

from sage.

swalkinshaw avatar swalkinshaw commented on May 3, 2024

Yep, that's the only file that's been changed. Let me know how it goes. I tested it on a subfolder install but you never know...

from sage.

misfist avatar misfist commented on May 3, 2024

I replaced the roots-cleanup.php file and it appears to be working correctly.

Thanks very much!

from sage.

bonny avatar bonny commented on May 3, 2024

I just installed roots in a subfolder and it does not work. It will however work if I replace roots-cleanup.php with the version from april 04. So... something must have happened between now and april 04. Should I start a new issue about this?

from sage.

retlehs avatar retlehs commented on May 3, 2024

i have the latest roots and latest WP installed in a subdirectory

are you sure that maybe your .htaccess file just wasn't generated yet? need some more info besides 'does not work', what's broken.. file paths?

from sage.

bonny avatar bonny commented on May 3, 2024

Ok, does this help:

WordPress is installed in /wordpress/

The link-tag for the stylesheet looks like this:
link rel="stylesheet" href="/wordpress/css/style.css"

/wordpress/css/style.css gives a file not found/404

If I manually go to
/css/style.css
it will show me the css-file, which makes me think that the htaccess does indeed work.

If i remove
add_filter('template_directory_uri', 'roots_clean_assets');
from roots-cleanup.php it will work (but output old ugly code, of course)

Oh, and I just realized I am using WP 3.2-bleeding and not the latest stable, so maybe that has something to do with it.

from sage.

retlehs avatar retlehs commented on May 3, 2024

i just installed wordpress 3.2 nightly and the latest roots into a subdirectory, all paths/redirects working properly

if you're getting 404 when trying to hit /wordpress/css/style.css then it sounds like your .htaccess isn't getting generated or isn't working like it should

from sage.

bonny avatar bonny commented on May 3, 2024

The .htaccess do get generated. But I'll try it on another server and see if that helps. Hopefully there's something weird going on on this one. Thanks for your time!

from sage.

retlehs avatar retlehs commented on May 3, 2024

you mention that you're able to hit /css/style.css but not /wordpress/css/style.css, is it possible that your .htaccess file is in the root and not at /wordpress/.htaccess? also, can you provide us with the .htaccess file that's on your server?

from sage.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.