Forum Replies Created
-
AuthorPosts
-
December 31, 2015 at 12:47 pm in reply to: displaying first product gallery image individualy on product page #558701
Well actually I’m not good at coding that much. Just a bit brave to play with things to achieve my goals.
In this case, what I’m trying to achieve is to create a product page template using your advanced layout editor. I want to create a box in this template that shows the actual products logo image, name, price, purchase button and a note about the purchase process. I know I can do this manually for each product. But I want to automate things to eliminate human error.
So far I achieved this with php codes in text blocks:
[insert_php] the_post_thumbnail( array(256, 256)); [/insert_php] –> displays the featured image on top.
[insert_php] the_title(); [/insert_php] –> displays the product name
$ [insert_php] $bcprice = get_post_meta( get_the_ID(), ‘_regular_price’, true ); echo esc_html( $bcprice ); [/insert_php] –> gets the product price and displays in h1 tag.And I use product purchase button element below them.
These all takes the data from database. So when I load this box as a template from the advanced layout editor I do not need to change any value manually.
My problem is the image as I told. I want to seperate the featured image and product logo image. So in the shop page I want to see the featured img. But in the product page I need to see the logo image in this purchase box I created. I thought the easiest way to get this to add the product logo img as the first product gallery image and call this with a php code to display in the purchase box.
I tried the code you gave me. But it needs a defined ID at the beginning so this will not be automated. What I need is to call the ID of the first gallery image from database and display it.
I don’t know that much coding. And I’m not sure if this is an advanced customization request. All I need is a little help only with this code.
Thanks so much.
I’m using masonry to show my woocommerce products but it uses 705×306 size to show both landscape and portrait product images. So when using 2 or 3 columns full-width layout thumbnails on masonry becomes blurry. I want to change this:
$avia_config[‘imgSize’][‘masonry’] = array(‘width’=>705, ‘height’=>705 , ‘crop’ => false); // images for fullscreen masonryto this:
$avia_config[‘imgSize’][‘masonry’] = array(‘width’=>1440, ‘height’=>1440 , ‘crop’ => false); // images for fullscreen masonry
How to do it via enfold child theme?
Update:
Sorry I found the solution here
https://kriesi.at/support/topic/modify-post-image-size/#post-432178.- This reply was modified 8 years, 11 months ago by brandedcoms. Reason: Found the solution
-
AuthorPosts