Title: Changing HTML
Last modified: September 2, 2016

---

# Changing HTML

 *  Resolved [Dmitry_Demir](https://wordpress.org/support/users/dmitry_demir/)
 * (@dmitry_demir)
 * [9 years, 7 months ago](https://wordpress.org/support/topic/changing-html-2/)
 * Hi,
 * First of all, thank you for this easy-to-setup plugin, it’s almost exactly what
   I need for my custom website. However I need to change a few things.
 * Is there a way to change the HTML of this plugin for the front-end without editing
   the plugin itself? Basically I need to change the contents of `products_per_page_dropdown()`
   function of WPPP_Front_End class. For example, I need the option name “products
   per page” outside of the select box. Also I would like to change the order in
   which the form is hooked into `woocommerce_before_shop_loop` (to customize where
   exactly this form is outputted). So I tried to first remove the function from
   the hook, but it didn’t work. Here’s the code I tried:
 *     ```
       add_action('woocommerce_before_shop_loop', 'remove_page_dropdown');
       function remove_page_dropdown() {
       	remove_action('woocommerce_before_shop_loop', array('WPPP_Front_End', 'products_per_page_dropdown'), 30);
       }
       ```
   
 * I’ve also tried without the class:
 *     ```
       add_action('woocommerce_before_shop_loop', 'remove_page_dropdown');
       function remove_page_dropdown() {
       	remove_action('woocommerce_before_shop_loop', 'products_per_page_dropdown', 30);
       }
       ```
   
 * But no result. Am I doing something wrong or changing the plugin’s source is 
   the only way to do this?
    -  This topic was modified 9 years, 7 months ago by [Dmitry_Demir](https://wordpress.org/support/users/dmitry_demir/).

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Thread Starter [Dmitry_Demir](https://wordpress.org/support/users/dmitry_demir/)
 * (@dmitry_demir)
 * [9 years, 7 months ago](https://wordpress.org/support/topic/changing-html-2/#post-7722223)
 * As for changing the HTML, I thought of making a new class that would extend WPPP_Front_End
   and overwrite the products_per_page_dropdown function the way I need it, then
   I’d hook it instead of the default. But I’m not sure if that’d actually work.
 *  Plugin Author [Jeroen Sormani](https://wordpress.org/support/users/sormano/)
 * (@sormano)
 * [9 years, 6 months ago](https://wordpress.org/support/topic/changing-html-2/#post-8172530)
 * Hi,
 * Sorry for not hearing from me before, I sometimes don’t get notifications of 
   the support threads 🙁
 * To remove the hook: (untested)
 *     ```
       add_action('woocommerce_before_shop_loop', 'remove_page_dropdown');
       function remove_page_dropdown() {
       	remove_action('woocommerce_before_shop_loop', array( Woocommerce_Products_Per_Page()->fronte_end, 'products_per_page_dropdown'), 30);
       }
       ```
   
 * You don’t need to extend the class per se, you can just use a function and add
   your own HTML there.
    Also note that there are certain action hooks in place 
   that allow you to add additional parts (HTML) to the plugin.
 * Hope that helps 🙂
 * Cheers,
    Jeroen
 *  Thread Starter [Dmitry_Demir](https://wordpress.org/support/users/dmitry_demir/)
 * (@dmitry_demir)
 * [9 years, 6 months ago](https://wordpress.org/support/topic/changing-html-2/#post-8172720)
 * Hi, Jeroen!
 * Thanks a lot for showing me the right direction 🙂 There is a typo in your example
   in `fronte_end` and it doesn’t work with priority 30 (I’m a bit puzzled with 
   why though), but it works with priority 25 (same as the hook was added in the
   plugin). So here’s what I ended up with:
 *     ```
       add_action('woocommerce_before_shop_loop', 'remove_page_dropdown');
       function remove_page_dropdown() {
       	remove_action('woocommerce_before_shop_loop', array( Woocommerce_Products_Per_Page()->front_end, 'products_per_page_dropdown'), 25);
       }
       ```
   
 * Now I copied `products_per_page_dropdown` function to my function’s php and added
   it after removing the original one, it works like a charm with just one change–
   I had to replace `$this` with `Woocommerce_Products_Per_Page()->front_end`. That’s
   kind of a side note if someone is going to do the same and comes across this 
   thread.
 * Thanks again for helping out and good luck with further development!
 *  Plugin Author [Jeroen Sormani](https://wordpress.org/support/users/sormano/)
 * (@sormano)
 * [9 years, 6 months ago](https://wordpress.org/support/topic/changing-html-2/#post-8175493)
 * Hi Dmitri,
 * The priority 25 is required because it needs to be the same as the priority which
   is set to the ‘add_action’.
 * I did notice that, but must’ve missed it when changing the code..
 * Have a great day!
    Jeroen Sormani

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Changing HTML’ 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

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

 * 4 replies
 * 2 participants
 * Last reply from: [Jeroen Sormani](https://wordpress.org/support/users/sormano/)
 * Last activity: [9 years, 6 months ago](https://wordpress.org/support/topic/changing-html-2/#post-8175493)
 * Status: resolved