• Is there a manual which describe in detail on how to use your plugin cause the examples shown on website are a bit vague ??

    we are trying to integrate our API with our wordpress platform.

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Shea Bunge

    (@bungeshea)

    Hi Roger,

    Can you be a little more specific on the sort of information you are looking for?

    For example I want to follow this link and have a JavaScript and add a few lines of php into functions.php.

    The specific code I want to insert is here

    Thanks.

    Plugin Author Shea Bunge

    (@bungeshea)

    Here’s an example of how you can do that:

    add_action( 'wp_enqueue_scripts', function () {
    
    	if ( ! is_shop() && ! is_product_category() ) {
    		return;
    	}
    
    	$select2_version = '4.0.6-rc.0';
    
    	wp_enqueue_style(
    		'my-select2',
    		"https://cdnjs.cloudflare.com/ajax/libs/select2/{$select2_version}/css/select2.min.css",
    		array(), $select2_version
    	);
    
    	wp_enqueue_script(
    		'my-select2',
    		"https://cdnjs.cloudflare.com/ajax/libs/select2/{$select2_version}/js/select2.min.js",
    		array( 'jquery' ), $select2_version
    	);
    } );
    
    add_action( 'wp_head', function () { ?>
    <script>
    
    	jQuery(document).ready(function ($) {
    		$('.woocommerce-ordering select').select2();
    	});
    
    </script>
    <?php } );

    Let me know if you have any questions.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Help using code snippets’ is closed to new replies.