Remove Unused Javascript

//This has been syncronised 123// function wp_remove_scripts() { // check if user is admina if (current_user_can( ‘update_core’ )) { return; } else { // Check for the page you want to target if ( is_page( ‘homepage’ ) ) { //…Continue reading

Delete Woocommerce images after deleting product

// Automatically Delete Woocommerce Images After Deleting a Product add_action( ‘before_delete_post’, ‘delete_product_images’, 10, 1 ); function delete_product_images( $post_id ) { // Check if user has the capability to delete products if ( !current_user_can( ‘delete_products’ ) ) { return; } $product…Continue reading

Social Share Buttons

$post_url = urlencode( get_permalink() ); $post_title = urlencode( get_the_title() ); $facebook_url = “https://www.facebook.com/sharer/sharer.php?u=$post_url”; $x_url = “https://twitter.com/intent/tweet?url=$post_url&text=$post_title”; $linkedin_url = “https://www.linkedin.com/shareArticle?mini=true&url=$post_url&title=$post_title”; $social_buttons = ‘ ‘; echo $social_buttons; // Styles for the social sharing buttons. echo ‘ ‘;Continue reading

Change a currency symbol AMD to Դրամ

/** * Change a currency symbol */ add_filter(‘woocommerce_currency_symbol’, ‘change_existing_currency_symbol’, 10, 2); function change_existing_currency_symbol( $currency_symbol, $currency ) { switch( $currency ) { case ‘AMD’: $currency_symbol = ‘֏’; break; } return $currency_symbol; }Continue reading

Inline Spoiler Shortcode (copy)

// Hide text using the shortcode like this: [spoiler]hidden text here[/spoiler]. add_shortcode(‘spoiler’, ‘inline_spoiler_shortcode’); function inline_spoiler_shortcode($atts, $content = null) { // Start output buffering ob_start(); // Output the spoiler content with the necessary styles ?> .inline-spoiler { color: transparent; background-color: #333;…Continue reading