Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Where to put image files referenced in index.php #3

Open
bryanwaddington opened this issue May 12, 2022 · 2 comments
Open

Where to put image files referenced in index.php #3

bryanwaddington opened this issue May 12, 2022 · 2 comments

Comments

@bryanwaddington
Copy link

That's for creating this boiler plate, it looks really useful.

I have a question about where to put image files. I have background images in the scss and webpack handles them and they end up in the build/images folder, as expected. My question though is where should I put images that are referenced in an img tag in a php file, index.php for example? Should I create a separate static images folder for these outside my src/images folder, but that will mean two locations for images, or perhaps I could move my src/images folder up a level and keep all images in one folder?

I suppose at the end of the day I could do either but I'm wondering if I'm missing something or there is a preferred way?

Thanks
Bryan

@bryanwaddington bryanwaddington changed the title Where to put image files reference in index.php Where to put image files referenced in index.php May 12, 2022
@LearnWebCode
Copy link
Owner

I don't think there's any problem with having two separate folders for images, as long as they don't have the same images duplicated in both. WordPress is pretty hands off in terms of how it does or doesn't want us to organize files. You can adjust your code in your PHP files to point towards the appropriate image case-by-case:
<?php echo get_theme_file_uri('/images/library-hero.jpg') ?>

@bryanwaddington
Copy link
Author

Thanks Brad, that's my take on it too, just set up another images folder.

Thanks for your help 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants