Posts

Showing posts from October, 2015

How to add a custom or new order status in woocommerce wordpress

For add a custom or new order status in woocommerce store. just copy and paste below code into your theme's functions.php or in your custom plugins file. For example i am add a shipping order status for order . // register post status wc-shipping add_action('init','register_shipping_post_status'); function register_shipping_post_status(){         register_post_status( 'wc-shipping', array(             'label'                     => 'Shipping',             'public'                    => true,             'exclude_from_search'       => false,          ...

How to allow html tags in the_excerpt post function in wordpress

Just copy and paste below code into your theme's functions.php file or in your custom plugin file. and change according to your need. function rj_wp_trim_excerpt($text) { $raw_excerpt = $text; if ( '' == $text ) {     $text = get_the_content('');     $text = strip_shortcodes( $text );     $text = apply_filters('the_content', $text);     $text = str_replace(']]>', ']]&gt;', $text);          $allowed_tags = '<p>,<a>'; // write your tags here for allow them in excerpt with comma seprated     $text = strip_tags($text, $allowed_tags);          $excerpt_word_count = 55; // change length of excerpt according to your need     $excerpt_length = apply_filters('excerpt_length', $excerpt_word_count);          $excerpt_end = '[...]';     $excerpt_more = apply_filters('ex...