Title: Shortcode
Last modified: January 27, 2017

---

# Shortcode

 *  Plugin Author [Jeroen Sormani](https://wordpress.org/support/users/sormano/)
 * (@sormano)
 * [9 years, 4 months ago](https://wordpress.org/support/topic/shortcode-482/)
 * Once in a while I get the question for a shortcode for the dropdown. I created
   a small code snippet that adds this shortcode, but because there are mixed results
   expected with different themes and locations I cannot provide any support on 
   this shortcode (hence why it isn’t in the plugin itself).
 * It is not expected to work on a page where you’re showing the products through
   a WC shortcode, though I must admit I haven’t tested it either 😉
 *     ```
       function custom_wppp_shortcode() {
       	if ( method_exists( Woocommerce_Products_Per_Page()->front_end, 'products_per_page_dropdown' ) ) {
       		Woocommerce_Products_Per_Page()->front_end->products_per_page_dropdown();
       	}
       }
       add_shortcode( 'wppp', 'custom_wppp_shortcode' );
       ```
   

Viewing 1 replies (of 1 total)

 *  Plugin Author [Jeroen Sormani](https://wordpress.org/support/users/sormano/)
 * (@sormano)
 * [9 years, 4 months ago](https://wordpress.org/support/topic/shortcode-482/#post-8710135)
 * I found a mistake with the above code snippet, not doing a proper check if the
   WPPP plugin is active, and giving an error when it wasn’t.
 * With this code snippet it should work properly, and not give the error when the
   plugin is not active.
 *     ```
       function custom_wppp_shortcode() {
       	if ( function_exists( 'Woocommerce_Products_Per_Page' ) ) {
       		Woocommerce_Products_Per_Page()->front_end->products_per_page_dropdown();
       	}
       }
       add_shortcode( 'wppp', 'custom_wppp_shortcode' );
       ```
   

Viewing 1 replies (of 1 total)

The topic ‘Shortcode’ is closed to new replies.

 * ![](https://ps.w.org/woocommerce-products-per-page/assets/icon-256x256.jpg?rev
   =1090359)
 * [Products Per Page for WooCommerce](https://wordpress.org/plugins/woocommerce-products-per-page/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/woocommerce-products-per-page/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/woocommerce-products-per-page/)
 * [Active Topics](https://wordpress.org/support/plugin/woocommerce-products-per-page/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woocommerce-products-per-page/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woocommerce-products-per-page/reviews/)

## Tags

 * [shortcode](https://wordpress.org/support/topic-tag/shortcode/)

 * 1 reply
 * 1 participant
 * Last reply from: [Jeroen Sormani](https://wordpress.org/support/users/sormano/)
 * Last activity: [9 years, 4 months ago](https://wordpress.org/support/topic/shortcode-482/#post-8710135)
 * Status: not a support question