• Resolved caffeinehigh

    (@zaphan58)


    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/site1

    function output_current_site_url( $atts ) {

        $output = ”;

        $output .= esc_url(get_site_url());

        return $output;

    }

    add_shortcode( ‘current_site_url’, ‘output_current_site_url’ );

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author John Godley

    (@johnny5)

    Or is it possible to create a redirect that is relative to the multisite URL and not the base URL

    It is not possible.

    I see here?that redirection supports the use of shortcodes

    No, the plugin doesn’t support shortcodes. It uses the shortcode syntax to provide dynamic URLs, but you cannot just use the standard WordPress shortcodes.

    You might want to look at the developer information: https://redirection.me/developer/wordpress-hooks/

    Thread Starter caffeinehigh

    (@zaphan58)

    Ok fair enough thanks for the reply. I will look at those hooks.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Shortcodes not working?’ is closed to new replies.