Site logo

Archived topic

Using niche theme and having trouble with featured image

3 replies · Started by Edward on January 29, 2020

Viewing posts 1–4 of 4

Hi, I'm having trouble with my featured image with niche image when using woocommerce.

I keep getting this

get_id() ) ) { $attachment_ids[0] = get_post_thumbnail_id( $product->get_id() ); $attachment = wp_get_attachment_image_src( $attachment_ids[0], 'full' ); ?> get_gallery_image_ids(); foreach( $product_image_ids as $product_image_id ) { $image_url = wp_get_attachment_url( $product_image_id, 'full' ); echo ''; } } // Closing div found in Close Summary Wrap element ?>

I have disabled all plugins apart from woo commerce and gpress and still there.

can you help at all?

thanks,
Ed

Hi there,

Niche uses a Hook Element to insert some PHP code to create the stacked gallery on the Single Product page and to insert the Category Navigation on the shop.

You will find them in Appearance > Elements.

Seeing this code on the front end tells me your site has disallowed file editing which means those codes will not run.

Choices:

1. Delete the Gallery Stack , Close Summary Wrap and Woocommerce Shop Category Menu Hook Elements - but this will remove a lot of what Niche was designed for.

or

2. Add this PHP snippet to allow hooks to execute the code:

add_filter( 'generate_hooks_execute_php', '__return_true' );

https://docs.generatepress.com/article/adding-php/

ok, thanks. that's worked

Glad to be of help.
I notice an error on the Shop page - in Appearance > Elements - there is another Hook for the Category Menu - try editing and Checking Execute PHP.

This archived topic is closed to new replies.