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’ );

Changing appearance of WooCommerce product layout [closed]

This is indeed something that you need to make a specific page template for. Just CSS won’t do the trick because you need to add a function to your functions.php file (in your theme or child-theme folder) to display the excerpt. You could do something like this: add_action( ‘wp’ , ‘add_excerpt’, 20); function add_excerpt() { … Read more

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

Narrow Down a Shop Page Results Based on a Product Tag in WooCommerce

I passed query strings to the URL of the category page to display the tags within that category. This is what I did to solve the same problem function displayLocationDropdown() { if(!is_product_tag()){ $html=””; $html .= ‘<form class=”location-select” method=”post”>’; $html .= ‘<select id=”location-selector” name=”location” class=”location”>’; $tag = wp_tag_cloud( array( ‘format’ => ‘array’, ‘taxonomy’ => ‘product_tag’ ) … Read more

How do I unset all of the select boxes for pages

I’m not sure if I understand your problem correctly. But I think you should click on ‘x’ in every select on this page. When you do it, this select box will have no selected value any more (it will only contain placeholder saying “Select a page…”). Just look at attached image. I marked this ‘x’ … Read more