Shortcodes not working?
-
I see here that redirection supports the use of shortcodes. I am using a multisite and wanting to create a shortcode that picks out the current site URL so I can use the same rules on every multisite. So I have created one however it does not seem to insert anything in the URL when used. I also tried some of the example shortcodes and they did not seem to work either.
Or is it possible to create a redirect that is relative to the multisite URL and not the base URL? i.e. if I am on this multisite https://www.example.com/site1 when I create a redirect that starts with a / then it makes it relative to example.com and not example.com/site1function output_current_site_url( $atts ) {
$output = ”;
$output .= esc_url(get_site_url());
return $output;
}
add_shortcode( ‘current_site_url’, ‘output_current_site_url’ );
- The topic ‘Shortcodes not working?’ is closed to new replies.