I want to Add My Product Image to Admin Order Email in Woocommerece [closed]

The default admin email can be found in woocommerce/templates/emails/admin-new-order.php the order items table is called in line 28, with a function called email_order_items_table. This function also takes an argument for including the thumbnail (see the class-wc-order.php, line 1052). if you copy the email templates to your theme folder, you can edit the admin-new-order.php file and … Read more

How to use Facebox in WordPress theme?

// UPDATE This should work (it does for me, at least): in your theme’s folder, create the subfolder facebox put only the content of the src folder into your facebox folder (i.e., closelabel.png, facebox.css, facebox.js, loading.gif). put the following in your functions.php: function my_facebox_scripts() { wp_enqueue_style( ‘facebox’, get_template_directory_uri().’/facebox/facebox.css’, array(), false, ‘screen’ ); wp_enqueue_script( ‘facebox’, get_template_directory_uri().’/facebox/facebox.js’, … Read more

Include WooCommerce 2’s prettyphoto scripts on all site pages

Try adding this to your theme’s function.php. It worked for me, hope it helps. // PRETTY PHOTO // add_action( ‘wp_enqueue_scripts’, ‘lightbox’ ); function lightbox() { global $woocommerce; $suffix = defined( ‘SCRIPT_DEBUG’ ) && SCRIPT_DEBUG ? ” : ‘.min’; { wp_enqueue_script( ‘prettyPhoto’, $woocommerce->plugin_url() . ‘/assets/js/prettyPhoto/jquery.prettyPhoto’ . $suffix . ‘.js’, array( ‘jquery’ ), $woocommerce->version, true ); wp_enqueue_script( … Read more

Random Featured Image Based on Category

First of all when you call the get_image function pass the post categories slugs as param. Edit your autoset_featured function replacing … } else { set_post_thumbnail($post->ID, get_image()); } … with: … } else { $cat_slugs = wp_get_post_terms($post->ID, ‘event-categories’, array(“fields” => “slugs”)); $image = get_image( $cat_slugs ); if ( image ) set_post_thumbnail($post->ID, $image); } … Then … Read more

Where is the right place to store custom images?

WordPress has a core function wp_upload_dir that return info for the current upload folder. Using this function you can retrieve all info on uploads folder base on current configuration. E.g. if you set WP_CONTENT_DIR and/or WP_CONTENT_URL or UPLOADS constants that function will return the direcory according to this settings. If you have checked the option … Read more

Why are featured images sometimes cropped, and sometimes not

Image sizes are generated when the original is uploaded. If you add an image size after files have already been uploaded, those old images won’t have the new sizes, and will default to displaying the original. If you search the WordPress Plugin repository for “regenerate images” you’ll find some plugins that will simplify fixing this.

how to put image and text on same line [closed]

This is most likely due to differing line-heights and font-sizes between the editor, and the live site. You can try setting the vertical-align on the image (middle), or css position: relative, and setting bottom or top plus or minus a number of pixels. If you do this often, it would be easiest to define a … Read more