WooCommerce 'shop' page | get post meta?
-
Hey,
i’ve bought a template which doesn’t support woocommerce out of the box and tried to implement them by myself. It works fine so far, but the main shop-page which is linked in woocommerce settings as product-page don’t provide the meta from native added page ‘shop’. It’s only, when it is linked as product-page, otherwise i received all meta correctly.
The theme use a build-in plugin that calls “option tree” from themeforest.net.
That is what it looks like, what the theme uses to get an meta option
$ut_hero_caption_slogan_color = get_post_meta( $post->ID,'ut_page_caption_slogan_color' , true);
Found here in search results very helpful lines of code, but didn’t get them work. After taking a better look at the functions.php in main theme, i found some lines, who should ensure to get the right ID.
global $post, $wp_query; // woo commerce shop ID if( function_exists('is_shop') ) { if( is_shop() ) { $pageID = get_option('woocommerce_shop_page_id'); } }
So, if i’m right this can’t work without if/else for every option, when the correct ID from woocommerce shop page is stored in $pageID?
Sorry for broken english ??
- The topic ‘WooCommerce 'shop' page | get post meta?’ is closed to new replies.