WooCommer Product Category Loop – How to change the display order of the rating and price?

For example you just want to swap rating and price where price would come before rating, you would do the following. remove_action( ‘woocommerce_after_shop_loop_item_title’, ‘woocommerce_template_loop_price’, 10 ); remove_action( ‘woocommerce_after_shop_loop_item_title’, ‘woocommerce_template_loop_rating’, 5 ); add_action( ‘woocommerce_after_shop_loop_item_title’, ‘woocommerce_template_loop_price’, 11 ); add_action( ‘woocommerce_after_shop_loop_item_title’, ‘woocommerce_template_loop_rating’, 12 ); Put these lines of code in your theme’s functions.php file.

Translating (WooCommerce) placeholder text

You can filter gettext: add_filter( ‘gettext’, function( $translation, $text, $domain ) { if ( ‘woocommerce’ === $domain and ‘Select a state…’ === $text ) return ‘Select a province…’; return $translation; }, 10, 3 ); Note the 3 as last parameter. This ensures you get all three variables passed, so you can replace exactly the text … Read more

My widget won’t update its values when save is clicked

In $control_ops = array( ‘width’ => 300, ‘height’ => 350, ‘id_base’ => ‘example-widget’ ); id_base should be without space and in your rollover image, your name is wrong, you have the name set to echo $this->get_field_name( ‘image’ ); when it should be echo $this->get_field_name( ‘rollover_image’ ); add_action ( ‘widgets_init’ , ‘my_widget’ ) ; function my_widget … Read more

The “Child Pages Shortcode” plugin, block template

Try this: // Wrap <li> tags around each template item. add_filter( ‘child-pages-shortcode-template’, ‘wpse_113253_child_pages_shortcode_template’ ); // Wrap <div> and <ul> tags around everything. add_filter( ‘child-pages-shortcode-output’, ‘wpse_113253_child_pages_shortcode_output’ ); /** * Wrap <li> tags around each template item. */ function wpse_113253_child_pages_shortcode_template( $template ) { return “<li>$template</li>\n”; } /** * Wrap a <div> and <ul> tags around everything. */ … Read more

display link to a custom plugin in admin menu bar

if you want to add a top level menu page then you need to use add_menu_page() function more details on codex add_action( ‘admin_menu’, ‘register_my_custom_menu_page’ ); function register_my_custom_menu_page(){ add_menu_page( ‘my plugin’, ‘plugin settings’, ‘manage_options’, ‘my-plugin-settings’, ‘my_plugin_custom_function’, plugins_url( ‘myplugin/images/icon.png’ ), 66 ); }

Passing value as hidden parameter to next page

Simply use a $_POST variable to set the terms to the page that handle the recomendations and use an hook into pre_get_posts to set the query. I write a function that output the link, and you can use it as a template tag. Add this function in a plugin or in your functions.php function more_recomentation_link() … Read more