Menu Cart Pro shortcode

Menu Cart Pro comes with a shortcode to let you easily add your shopping cart to any page or post. If you don’t already have Menu Cart Pro and would like to use it, you can purchase it in our shop.

Setting up the shortcode #

  • style: accepts any CSS styles. Ex: style="background-color:blue;font-size:18px"
  • flyout: accepts 'yes', 'no', or 'hover' (default). 'yes' always displays flyout, 'no' never displays, and 'hover' displays on hover. E.g.: flyout="hover"
  • before: accepts any text or HTML and places it before the primary, E.g.: before='mylink'
  • after: accepts any text or HTML and places it after the primary, E.g.: after='this is my favorite'

Simple shortcode with default attributes #


Shortcode with all attributes customized #

[wpmenucart style="background-color:blue;font-size:18px" flyout="hover" before='<a href="">mylink</a>' after='<span class="span1">this is my favorite</span>']

As you can see, simple implementation is just to add [wpmenucart] to a page or post, or you can add the custom attributes.

Inserting the shortcode a PHP file #

If you’re working directly in template files, you can also use this PHP code:

<?php echo do_shortcode('[wpmenucart]'); ?>