• I’ve searched the land of google like crazy, but can’t find anything. Hopefully someone here can help me out!
    ————–

    With woocommerce, there’s the shortcode [woocommerce_my_account] which brings up the my-account.php file.

    Let’s say I want to make a my-account-2.php file. How would I go about creating a shortcode to call that? I can’t find anything about creating shortcodes that shows you calling a .php file (like the above one does.)

    So basically I want to duplicate the [woocommerce_my_account] shortcode (we’ll call it [woocommerce_my_account_2] to bring up the php file my-account-2.php (instead of my-account.php).

    Feel the redundancy in my post yet? I’m so lost and confused at this point. ??

    https://www.ads-software.com/plugins/woocommerce/

Viewing 1 replies (of 1 total)
  • It’ll look something like this:

    // goes in functions.php for your child theme
    add_shortcode('woocommerce_my_account_2', 'woocommerce_my_account_2');
    function woocommerce_my_account_2() {
      include 'woocommerce_my_account_2.php';
    }

Viewing 1 replies (of 1 total)
  • The topic ‘My Account shortcode’ is closed to new replies.