Show image depending on the number in the custom fields

Better will be when you use css to change status colors. WooCommerce Hooks: Actions and filters Action and Filter Hook Reference woocommerce/templates/content-single-product.php function woocommerce_stock_badge() { global $product; if ( !$product->is_in_stock() ) { echo ‘<div class=”stock red”>no stock</div>’; } else if ( $product->is_in_stock() && 5 >= $product->get_stock_quantity() ) { echo ‘<div class=”stock orange”>low stock</div>’; } else … Read more

Image is missing on site homepage

Looks to me like you transferred this site from another domain. For instance, the image on https://www.fileour.com/test-post-2/ is being pulled from http://www.livetvshow24.ga/wp-content/uploads/2018/07/RX-Entertainment-youtube-cover-photo-300×169.jpg did you work on this site on another domain and then migrate it? You need to change the db references so the site knows where to pull them from.

How to wrap image tag into div for post only?

You have the global WP_Post object available so you can look the post type like this: function wrap_post_images_to_div( $content ) { if ( get_post()->post_type === ‘post’ ) { $pattern = ‘/(<img([^>]*)>)/i’; $replacement=”<div class=”well text-center”>$1</div>”; $content = preg_replace( $pattern, $replacement, $content ); } return $content; } add_filter( ‘the_content’, ‘wrap_post_images_to_div’ ); You can use the preg_replace_callback instead … Read more

Adding custom html/css/images to Theme

If your HTML is displaying but the images aren’t that normally points to a path issue – doublecheck it by opening your browser’s dev tools and checking whether the requested path to the images is correct. Make sure you’re using get_stylesheet_directory_uri() to get the URI to the root of the child theme, as get_template_directory_uri() will … Read more