Forcing primary domain URIs in multisite sites
I've noticed that in a multisite install some functions return URIs that don't use the site's primary domain name which possibly means they are "multisite-ignorant functions".
What can I do to ensure the primary domain of a subsite is used in returned URIs when I call these kinds of functions, in an effort towards referencing assets (js, css, img, etc) in a canonical, siloed manner?
A quick example being the following:
$ft_img = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), 'full');
So in this example $ft_img[0] would have the same URI for every subsite in a WPMU network, using the base site's siteurl when it should be subsite-specific.
I've noticed that in a multisite install some functions return URIs that don't use the site's primary domain name which possibly means they are "multisite-ignorant functions".
What can I do to ensure the primary domain of a subsite is used in returned URIs when I call these kinds of functions, in an effort towards referencing assets (js, css, img, etc) in a canonical, siloed manner?
A quick example being the following:
$ft_img = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), 'full');
So in this example $ft_img[0] would have the same URI for every subsite in a WPMU network, using the base site's siteurl when it should be subsite-specific.
No comments:
Post a Comment