WordPress Codesnippets

get_post_gallery image woocommerce


This code retrieves the images associated with a post and displays them using HTML img tags, specifying the full and thumbnail size of the images. The post meta is retrieved using the get_post_meta function and the images are retrieved using the wp_get_attachment_image_src function, which returns the image source, width, and height. The images are then echoed in the form of HTML img tags.

Was this code snippet helpful?

Leave a Reply

Your email address will not be published. Required fields are marked *

Programmatically save post

This code creates a WordPress post with the values of the ‘post_title’ and ‘post_content’ variables. It sets the post status to ‘publish’ and the author

Read More »

Create order programmatically

This code creates a new post in the WordPress database with post type ‘shop_order’, post title ‘Order #12345’, post status ‘wc-processing’, and ping status ‘closed’.

Read More »