WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] style.css and images folder - where should they go? (7 posts)

  1. deko
    Member
    Posted 8 years ago #

    The location for my stylesheet and images folder is:

    /public_html/wp-content/themes/my-wp-theme/

    But if I have other, non-wp pages on my site, I will want ANOTHER stylesheet and images folder for the non-wp stuff, such as:

    /public_html/images

    and

    /public_html/my-style.css

    The problem is this kind of redundancy (two stylesheets, two images folders) is generally a bad idea.

    Would it not be better to consolidate into ONE stylesheet and ONE images folder? After all, my non-wp pages share most of the style directives and images in my-wp-theme.

    The challenge is that WordPress has various bits of code that uses the default location (my-wp-theme folder) when referencing the stylesheet and images.

    The question is this:

    Do I (a) point my non-wp pages to the stylesheet and images folder in my-wp-theme folder, or (b) hack wp-includes/functions.php so all my WordPress content references a centralized stylesheet and images folder in my site's root directory?

    If I could discover the right hack, I think I'd like to go with (b).

    Other suggestions?

  2. joshziman
    Member
    Posted 8 years ago #

    I don't see the problem with using /public_html/my-style.css for your second stylesheet and /public_html/wp-content/themes/my-wp-theme/images for all images.

  3. deko
    Member
    Posted 8 years ago #

    The problem is redundancy. Repeated code is always a bad idea.

    But I'm still thinking about this.

    (I'm anticipating someone suggesting using Pages instead of non-wp pages, but that's not a solution: I need non-wp pages on this site.)

    In any case,

    If I (a) point to the default wp locations for images and style there is less hacking (which is good).

    But my theme is custom anyway - so why not (b) point wp-content to a central public_html/images and public_html/style.css... this way my site is not so tightly coupled (which is bad) with wp...

  4. deko
    Member
    Posted 8 years ago #

    hmmm... maybe having two stylesheets is not so bad.

    Whatever is unique to non-wp pages can go in /public_html/my-style.css (as joshziman suggested), and I just reference two sytlesheets in my non-wp pages.

    As for the images folder, I think I'm going to centralize it. This means hard-coding a path rather than using

    <?php bloginfo('stylesheet_directory'); ?>

    but so what...

  5. spencerp
    Member
    Posted 8 years ago #

    *EDIT* I dunno anymore, this is becoming more complicated then need be lol!!

    Personally I'd just make their own image and CSS file locations, for the non-WP pages that is.. However, there is no need to make TOO MUCH work for yourself.. =P

    The second way of doing it, which you mentioned as (b), is MORE work on yourself then need be..I wouldn't do that. =P

    spencerp

    I dunno, but for the non-WP files, I would add the CSS link location in it's header, along with the path to it's own image folder..

  6. deko
    Member
    Posted 8 years ago #

    Yes, the less coding the better, to be sure. That's a good point.

    So I think my (c) idea is the winner - just reference two stylesheets in the non-wp pages - with public_html/my-style.css containing only unique directeives for non-wp pages - and centralizing the images folder (all images, both wp and non-wp) in the site's root.

    Thanks for the help :)

  7. spencerp
    Member
    Posted 8 years ago #

    Thanks for the help :)

    No problem. =) I'm not sure if *I* was much help, but...I'm glad to been able to throw in my opinions and or suggestions.. =P

    spencerp

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags