pagination in woocommerce order history page

I have added pagination in order history page and it is working. Replace below code above loop $customer_orders1 = get_posts(apply_filters(‘woocommerce_my_account_my_orders_query’, array( ‘numberposts’ => -1, ‘meta_key’ => ‘_customer_user’, ‘meta_value’ => get_current_user_id(), ‘post_type’ => wc_get_order_types(‘view-orders’), ‘post_status’ => array_keys(wc_get_order_statuses()) ))); $total_records = count($customer_orders1); $posts_per_page = 20; $total_pages = ceil($total_records / $posts_per_page); $paged = ( get_query_var(‘page’) ) ? get_query_var(‘page’) … Read more

Change Default Image HTML

This will do: <?php /* * This filter only works with images, for all kind of media check: media_send_to_editor * The priority is set to 20 and it takes 8 arguments */ add_filter(‘image_send_to_editor’, ‘wpse_53577_img_wrapper’, 20, 8); // We are only working with the $html argument, but you can play with all of them function wpse_53577_img_wrapper($html, … Read more

Removing Image Sizes for Custom Post Type

May be this filter should work intermediate_image_sizes Note: This solution will work if you are uploading an image from post edit screen. (tested on localhost with WP-3.8.1) add_filter( ‘intermediate_image_sizes’, ‘ravs_slider_image_sizes’, 999 ); function ravs_slider_image_sizes( $image_sizes ){ // size for slider $slider_image_sizes = array( ‘your_image_size_1’, ‘your_image_size_2’ ); // for ex: $slider_image_sizes = array( ‘thumbnail’, ‘medium’ ); … Read more

How-to inspect filter-able $vars?

Example Nav menu walker – allows adding eg. css classes to (all) menu items. // copyied from /wp-core/wp-includes/nav-menu-template.php > line 76 (wp 3.1.1) – start_el() function $class_names = join( ‘ ‘, apply_filters( ‘nav_menu_css_class’, array_filter( $classes ), $item, $args ) ); Now let’s check the $var: function wpse15319_check_nav_menu_classes( $classes ) { // You can take any … Read more