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?
]]>I am using ajax in my plugin. My javascript file is in the folder ../wp-content/plugins/myplugin/js/ , and in it i am trying to call a php file, which is in the folder ../wp-content/plugins/myplugin/
jQuery.ajax({
url: “/wp-content/plugins/myplugin/myfile.php?myparam=” + myparam,
context: document.body
});
My question is: How can i get this url reference work independent of, where the user installed the plugin.
Because when for example a user install this plugin in https://localhost/subdir/, the reference is not correct.
Can i somehow create a relative link ?
When using links within the text of a page the URL are function as relative URLs rather than absolute URLS. I am getting www.mywebsite.co.za/about/www.linkurl.co.za instead of just www.link.co.za
how can I correct this?
Thanks,
Deborah
Doing a migration from one platform to the final one, I noticed that the src information in the img-tag (inserted to a post/page) was fully written – http:/example.com/wp-content/uploads/
…
This makes migration from one plattform to another very difficult.. could it not be a relative link like /wp-content/uploads/…. instead, like it is possible in <a>
tags on pages/posts..
Thanks for considering this and very best regards, Oliver
]]><img src="<?php bloginfo(‘stylesheet_directory’); ?>/images/picture.png" alt="seo friendly text">
FOR POSTS/PAGES;
Install the Insert PHP Plugin by WillBontrager, this will allow you insert php into posts and pages with two simple tags [insert_php] php code here… [/insert_php]
https://www.ads-software.com/plugins/insert-php/
<img src="[insert_php] bloginfo(‘stylesheet_directory’); [/insert_php]/images/picture.png" alt="seo friendly text">
we use this code for to link all of our images when designing new templates at [Site link removed]
[Moderator Note: Please post code & markup between backticks or use the code button. Your posted code may now have been permanently damaged by the forum’s parser.]
]]>If I create a tiny form on a test page as below via the editor everything is fine:
<form action=”list”>
<input type=”submit” name=”submit” value=”submit” />
</form>
But if I create the form via a shortcode on a page whose slug is ‘searchform’, with apparently identical code appearing on the resulting page, I get one of those “This is somewhat embarrassing…” messages because the page requested is …/searchform/list.
All the pages are ‘ordinary’ pages with no parents and use the default template.
Anyone know what is happening and how to deal with it?
]]>I was looking for an answer to this on the forums and all the posts I read degenerated into off-topic arguments on the merits of permalinks etc, but nobody ever addressed the how.
As a developer I develop on a test server and often need to move the entire installation later. The efficacy of relative links is obvious.
I’m posting this 1 as a quick answer to something I couldn’t find and 2 to ask if there is any reason not to do this.
The permalink argument seems to me like it would address the URL more than an image as, so long as the site doesn’t move, the URL would remain the same therefore the relative link would still work. Thoughts?
]]>First off, thanks for My Calendar – it’s a great tool.
Feature request: add support for relative URLS in the “Event Link”
Description: when adding a link to “Event Link (Optional)” I would like to request being able to put in a relative link. For example, I should be able to put in “/holiday-mixed-doubles-mixer/” instead of a full URL “https://www.somewebsite.com/holiday-mixed-doubles-mixer/”.
Why: when I am developing a new site for a client I often do it on a preview website URL that is different from the final live URL so that they can see the site as I build it but before it’s launched. Because MyCalendar doesn’t support relative URLs in the Event Link I need to put in a full URL. When I launch the website I then need to go into MyCalendar and manually update all of the links.
https://www.ads-software.com/extend/plugins/my-calendar/
]]>“You have successfully registered to download this voucher, please download the voucher from here:
/?voucher=1b947162b03b7c4fa22ad65242b248e1&guid=b0e88b16b1154b6b5a49f5322ef28f3b”
Does anyone know where and how I change this – so my customers can see an actual live link to click on?
Thank you so much!
]]>