I have a site https://www.example.com with a subsite or subdomain address https://subsite.example.com. When images are uploaded in the dashboard of the subdomain (i.e. https://subsite.example.com/wp-admin) to the media library, they go where they are supposed to be – the images folder within the subdomain folder. But when displayed – whether in the media library or front end – images are not showing because img src points to https://example.com/wp-content/uploads/2022/02/imageName.jpg instead of
https://subdomain.example.com/wp-content/uploads/2022/02/imageName.jpg.
In wp-config.php, I have added the following (without it, all internal links will go to https://example.com instead of https://subsite.example.com):
define('WP_HOME','https://subsite.example.com');
define('WP_SITEURL','https://subsite.example.com');
I also managed to get some of the images showing on the front end by adding a php string replace code on the template file that changes “example” to “subsite.example”, but this is only a temporary fix and does not affect dashboard, where images are not showing in media libray.
Is there something that should be added to or changed in .htaccess and/or wp-config.php?
]]>How do I obtain this absolute path, given the relative path passed to me, the WordPress way? Everywhere I look, it explicitly states that the WP_PLUGIN_DIR and WPMU_PLUGIN_DIR constants are for internal use only.
Sorry if this has already been beaten to death here and elsewhere. And, please do not suggest I pass __FILE__ to some function. I don’t want to find out the absolute path to my own code.
I’m obviously doing something wrong, and am hoping for someone to tell me what that wrong is
-joho
]]>I am working on a project and I needed to have relative path URL so as to make netlify enable its CDN for the site’s assets.
In your plugin even when I choose the relative path option and no matter what I type in the root path field, the STATIC output generated by wp2static doesn’t have relative URLs.
I have tried it with Pantheon Host, hosted demo account on Google cloud and tried to sync to Netlify, tried Manual Upload >> Zip, Manual Upload >> Save to sub-dir.
No matter what I choose, the relative path is not generated.
As of now, I have enabled “Simply static” and its relative feature is working.
Can you please check this feature on your system and if you succeed can you please share the steps you followed.
Kindly, help me with this issue.
]]>Strange thing is that I am clueless as to why this occurs, the native WP behaviour should be absolute paths.
The lack of absolute paths is running me into troubles with one or two plugins, so I would like to change the default behaviour (yes, I can change all paths in the mySQL database, but that doesn’t do anything for future images and internal links).
How to get back WordPress’ native absolute path behaviour…
]]>YOU GUYS ROCK!
I tested three images that had steadfastly refused to change their paths (mostly WooCommerce category images and images placed in widgets) and your plugin caught them all.
THANK YOU!!!
Right now I’m developing a site locally using xampp and virtualhosts. I just exposed a port so I could test it on my mobile phone using my_notebook_ip_address:exposed_port.
Also in the wp-config file the siteurl is defined like this:
define('WP_HOME','https://' . $_SERVER['HTTP_HOST']);
define('WP_SITEURL','https://' . $_SERVER['HTTP_HOST']);
Everything is working how it’s supposed, but I noticed the background pictures of the slides are not loading.
Turn’s out the image src-s are defined with absolute paths.
I was developing this site with a dummy name locally, but when it goes live it will have another address, and may have multiple instances.
My question is it possible in Smart Slider 3 to define the background image src-s as relative paths like: /wp-content/uploads/2018/01/whatever.jpg
?
thanks!
https://www.ads-software.com/plugins/loginizer/
]]>How i do it? and where can i change it?
]]>https://www.ads-software.com/plugins/better-wp-security/
]]>I’m trying to create a custom theme, so I registered one by following the tutorial on the Simple Lightbox website. My theme appears in the plugin settings as an available option, so registration seems to be successful.
I’ve created an HTML file for my custom layout, and included it in my main theme folder (the one that contains my site’s stylesheet). Simple Lightbox however is not picking it up, and I believe it might be because perhaps I’m using the wrong relative path for the ‘layout’ property when registering the theme.
I tried this: ‘layout’ => get_template_directory_uri() . ‘/foto-lightbox.html’
What is the right path? Or am I skipping any other steps?
Thanks in advance!
https://www.ads-software.com/plugins/simple-lightbox/
]]>