Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- add_filter( 'woocommerce_product_tabs', 'edscom_savmestimi_produkti_tab' );
- function edscom_savmestimi_produkti_tab( $tabs ) {
- global $post;
- $my_savmestimi_produkti = get_field( 'savmestimi_produkti', );
- if( ! empty( $my_savmestimi_produkti )) {
- // Adds the new tab
- $tabs['savmestimi-produkti'] = array (
- 'title' => __( 'Съвместими продукти', 'woocommerce' ),
- 'priority' => 12,
- 'callback' => 'edscom_savmestimi_produkti_tab_content'
- );
- }
- return $tabs;
- }
- function edscom_savmestimi_produkti_tab_content() {
- $the_articles = get_field('savmestimi_produkti');
- if( $the_articles ): ?>
- <div class="tab-savmestimi">
- <ul style="list-style-type: none; padding-left: 15px;">
- <?php foreach( $the_articles as $article ): ?>
- <li>
- <a href="<?php echo get_permalink($article->ID); ?>" title="<?php echo __('Още за ') . ' ' . $article->post_title; ?>" target="_blank">
- <img width="50" height="50" class="img_tsprod" src="<?php echo get_the_post_thumbnail_url( $article->ID ); ?>">
- <?php echo $article->post_title; ?>
- </a>
- </li>
- <?php endforeach; ?>
- </ul>
- </div>
- <?php endif;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement