Shortcode return is printing a 1 afterward

You are returning the result of calling include. You want to grab the output of the included file and return than instead. Use output buffering to do that. function build_total_search_method( $atts ) { ob_start(); include( dirname(__FILE__) . “/includes/total_search.php” ); $shorcode_php_function = ob_get_clean(); return $shorcode_php_function; } add_shortcode( ‘total_search’, ‘build_total_search_method’ );

Output dropdown results into Woocommerce Order details

Take a look at the WooCommerce docs here: Tutorial – Customising checkout fields using actions and filters your code would look something like this: function my_custom_checkout_field( $checkout ) { woocommerce_form_field( ‘my_field_name’, array( ‘type’ => ‘select’, ‘class’ => array(‘my-field-class form-row-wide’), ‘label’ => __(‘Question?’), ‘placeholder’ => __(‘Enter something’), ‘options’ => array( ‘Yes’ => __(‘Yes’, ‘woocommerce’ ), ‘No’ … Read more

woocommerce product categories in menu [closed]

I found the answer. The main problem is: First of all woocommerce plugin has own ID system. And wordpress has own ID system. And it happened that with the same ID was two different items. For example: Woocommerce category name “my category” has ID: 13 And WordPress page “Logout” has ID: 13 So, in woocommerce … Read more

Fatal error with Ultimate Coupon plugin

Both plugins – Premium Coupon Plugin and Ultimate Coupon – declare the poorly named function like_content(). Disable the other plugin before you activate this one. And tell the developer they should prefix their functions.

Creating Features List in WordPress Post

Convert the items in the shortcode into an array, and return a list: add_shortcode( ‘features_list’, ‘shortcode_features_list’ ); function shortcode_features_list( $atts = array(), $content=”” ) { $content = trim( $content ); if ( ” === $content ) return; $items = explode( “\n”, $content ); $items = array_map( ‘trim’, $items ); return ‘<ul class=”features”><li>’ . join( ‘</li><li>’, … Read more