T
T
thehighhomie2015-10-15 17:27:08
WordPress
thehighhomie, 2015-10-15 17:27:08

Image paths in wordpress theme?

In general, I can not understand how best to prescribe the path to the picture in the html file. Is there a better record than:
?
I found only such a way, which I found in google and youtube from the "wordpress guru" ...

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
MetaDone, 2015-10-15
@MetaDone

write paths to files and images in html

/assets/img/...
/assets/js/...

and in the theme of the template you can drive out the replacement and it will turn out
<?php echo get_stylesheet_directory_uri(); ?>/assets/img/...
<?php echo get_stylesheet_directory_uri(); ?>/assets/js/...

but in general, correctly connect scripts and styles through wp_enqueue_style and wp_enqueue_script
And place the images as it is more convenient, you can also drive away the paths to them by replacing

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question