Community Forums › Forums › Archived Forums › General Discussion › Need to convert this Single Post Template to Genesis Framework?
Tagged: convert, post template
- This topic has 2 replies, 2 voices, and was last updated 8 years, 8 months ago by
rogger.
-
AuthorPosts
-
June 13, 2016 at 11:23 pm #187507
rogger
MemberDear Genesis Devs, I am in trouble of converting this page template to Genesis Framework. I tried a lot but not successful, until now i realized that it's almost impossible without devs.
I hope someone can do it. Thanks in advance.<?php if (!defined('APS_VER')) exit('restricted access'); /* * @package WordPress * @subpackage APS Products */ get_header(); // get aps design settings $design = get_aps_settings('design'); $template = 'single-product'; ?> <div class="aps-container"> <div class="aps-row clearfix"> <div class="aps-content aps-content-<?php echo $design['content']; ?>"> <?php // get compare page link $comp_link = get_compare_page_link(); // get settings $settings = get_aps_settings('settings'); // start the loop if ( have_posts() ) : while ( have_posts() ) : the_post(); $title = get_the_title(); $pid = $post->ID; update_aps_views_count($pid); // index page title $index_id = $settings['index-page']; $index_title = get_the_title($index_id); $index_link = get_permalink($index_id); $product_cats = get_product_cats($pid); if ($design['breadcrumbs'] == '1') { ?> <div class="apscrumbs"> <a href="<?php echo $index_link; ?>"><?php echo $index_title; ?> / <?php foreach ($product_cats as $product_cat) { echo '<a href="' .get_term_link($product_cat) .'">' .$product_cat->name .'</a> / '; } echo $title; ?> </div> <?php } ?> <h1 class="aps-main-title"><?php echo $title; ?></h1> <?php // call after title hook do_action('aps_single_after_title'); ?> <div class="aps-row"> <?php // get product image $image = get_product_image(800, 800); // get cat id $cat = $product_cats[0]; $cat_id = $cat->term_id; $comp_list = aps_get_compare_list(); $comp_count = count($comp_list); ?> <div class="aps-product-pic"> <img class="image-zoom" src="<?php echo $image['url']; ?>" alt="<?php the_title_attribute(); ?>" data-zoom-image="<?php echo $image['url']; ?>" /> <div class="aps-buttons-box"> <a class="aps-btn-boxed aps-add-compare" href="#" data-pid="<?php echo $pid; ?>" data-title="<?php echo $title; ?>"><i class="aps-icon-compare"></i> <?php _e('Add to Compare', 'aps-text'); ?></a> <a class="aps-btn-boxed aps-compare" href="<?php echo $comp_link; ?>"><i class="aps-icon-shuffle"></i> <?php _e('Compare', 'aps-text'); ?> <span class="aps-comp-count"><?php if ($comp_count > 0) echo '(' .$comp_count .')'; ?></span></a> </div> </div> <div class="aps-main-features"> <?php // get main features attributes $features = get_aps_product_features($pid); if (aps_is_array($features)) { ?> <ul class="<?php echo ($design['features'] == 'list') ? 'aps-features-list' : 'aps-features aps-row clearfix'; ?>"> <?php foreach ($features as $feature) { $feature_name = $feature['name']; $feature_icon = $feature['icon']; $feature_val = $feature['value']; ?> <li> <?php if ($design['features'] == 'list') { ?> <div class="aps-feature-anim"> <span class="aps-list-icon aps-icon-<?php echo $feature_icon; ?>"></span> <div class="aps-feature-info"> <strong><?php echo $feature_name; ?></strong>: <span><?php echo $feature_val; ?></span> </div> </div> <?php } else { ?> <div class="aps-flipper"> <div class="flip-front"> <span class="aps-flip-icon aps-icon-<?php echo $feature_icon; ?>"></span> </div> <div class="flip-back"> <span class="aps-back-icon aps-icon-<?php echo $feature_icon; ?>"></span><br /> <strong><?php echo $feature_name; ?></strong><br /> <span><?php echo $feature_val; ?></span> </div> </div> <?php } ?> </li> <?php } ?> </ul> <?php } ?> </div> </div> <?php // call after features hook do_action('aps_single_after_features'); // get tabs data from options $tabs = get_aps_settings('tabs'); $tabs_data = get_aps_product_tabs($pid); // get attributes groups by category $groups = get_aps_cat_groups($cat_id); $groups_data = get_aps_groups_data(); // get aps videos data $videos = get_aps_product_videos($pid); // get aps gallery data $images = get_aps_product_gallery($pid); // get aps offers data $offers = get_aps_product_offers($pid); $tabs_display = array( 'overview' => true, 'specs' => (aps_is_array($groups)) ? true : false, 'reviews' => true, 'videos' => (aps_is_array($videos)) ? true : false, 'gallery' => (aps_is_array($images)) ? true : false, 'offers' => (aps_is_array($offers)) ? true : false, 'custom1' => (!empty($tabs_data['tab1'])) ? true : false, 'custom2' => (!empty($tabs_data['tab2'])) ? true : false, 'custom3' => (!empty($tabs_data['tab3'])) ? true : false ); if (is_array($tabs)) { if ($design['sections'] != 'flat') { ?> <ul class="aps-tabs"> <?php $tb = 0; foreach ($tabs as $tb_key => $tab) { if (($tab['display'] == 'yes') && ($tabs_display[$tb_key] == true)) { $tb++; ?> <li<?php if ($tb == 1) echo ' class="active"'; ?>><a href="#aps-<?php echo $tb_key; ?>"><?php echo $tab['name']; ?></a></li> <?php } } ?> </ul> <?php } ?> <div class="aps-tab-container"> <?php foreach ($tabs as $tb_key => $tab) { if (($tab['display'] == 'yes') && ($tabs_display[$tb_key] == true)) { ?> <div id="aps-<?php echo $tb_key; ?>" class="aps-tab-content<?php if ($design['sections'] == 'flat') echo ' aps-flat-content'; ?>"> <?php if ($tb_key == 'overview') { // call before overview hook do_action('aps_single_before_overview'); // get product rating $product_rating = get_product_rating($pid); $rating_display = (isset($product_rating['show_panel'])) ? $product_rating['show_panel'] : 'yes'; if ($rating_display == 'yes') { ?> <div class="aps-column"> <?php // product rating $total_bar = get_product_rating_total($pid); $total_color = aps_rating_bar_color(round($total_bar)); ?> <div class="aps-rating-card"> <div class="aps-rating-text-box"> <h3 class="no-margin uppercase"><?php echo $settings['rating-title']; ?></h3> <p><em><?php echo $settings['rating-text']; ?></em></p> </div> <div class="aps-rating-bar-box"> <div class="aps-overall-rating" data-bar="true" data-rating="<?php echo $total_bar; ?>"> <span class="aps-total-wrap"> <span class="aps-total-bar <?php echo $total_color; ?>" data-type="bar"></span> </span> <span class="aps-rating-total" data-type="num"><?php echo $total_bar; ?></span> </div> </div> <div class="clear"></div> <ul class="aps-pub-rating aps-row clearfix"> <?php // get category rating bars terms $rating_bars = get_aps_cat_bars($cat_id); $bars_data = get_aps_rating_bars_data(); if (aps_is_array($rating_bars)) { foreach ($rating_bars as $bar) { $bar_data = $bars_data[$bar]; $bar_slug = $bar_data['slug']; $rating = (!empty($product_rating[$bar_slug])) ? $product_rating[$bar_slug] : $bar_data['val']; $color = aps_rating_bar_color($rating); ?> <li> <div class="aps-rating-box" data-bar="true" data-rating="<?php echo $rating; ?>"> <span class="aps-rating-asp"> <strong><?php echo $bar_data['name']; ?></strong> <span class="aps-rating-num"><span class="aps-rating-fig" data-type="num"><?php echo $rating; ?></span> / 10</span> </span> <span class="aps-rating-wrap"> <span class="aps-rating-bar <?php echo $color; ?>" data-type="bar"></span> </span> </div> </li> <?php } } ?> </ul> </div> </div> <?php } // call before content hook do_action('aps_single_before_content'); ?> <div class="aps-column"> <?php the_content(); ?> </div> <?php // call after content hook do_action('aps_single_after_content'); } elseif ($tb_key == 'specs') { // call before specs hook do_action('aps_single_before_specs'); ?> <div class="aps-column"> <h2 class="aps-tab-title"><?php echo $title; ?> - <?php echo $tab['name']; ?></h2> <?php // if groups if (aps_is_array($groups)) { $attrs_data = get_aps_attributes_data(); // start foreach loop foreach ($groups as $group) { $group_data = $groups_data[$group]; $group_attrs = get_aps_group_attributes($group); // get post meta data by key $attributes = get_aps_product_attributes($pid, $group); // check if data is an array if (aps_is_array($group_attrs)) { ?> <div class="aps-group"> <h3 class="aps-group-title"><?php echo $group_data['name']; ?> <?php if ($design['icons'] == '1') { ?><span class="alignright aps-icon-<?php echo $group_data['icon']; ?>"></span><?php } ?></h3> <ul class="aps-specs-list"> <?php foreach ($group_attrs as $attr_id) { // get attribute data $attr_data = $attrs_data[$attr_id]; $attr_meta = $attr_data['meta']; $attr_info = $attr_data['desc']; $value = $attributes[$attr_id]; if ($value) { // check if value is date if ($attr_meta['type'] == 'date') { $value = date_i18n('d F Y', strtotime($value)); } elseif ($attr_meta['type'] == 'check') { $value = ($value == 'Yes') ? '<i class="aps-icon-check"></i>' : '<i class="aps-icon-cancel aps-icon-cross"></i>'; } ?> <li> <strong class="aps-term<?php if (!empty($attr_info)) echo ' aps-tooltip'; ?>"><?php echo $attr_data['name']; ?></strong> <?php if (!empty($attr_info)) echo '<span class="aps-tooltip-data">' .str_replace(array('<p>', '</p>'), '', $attr_info) .'</span>'; ?> <div class="aps-attr-value"> <span class="aps-1co"><?php echo nl2br(htmlspecialchars_decode($value)); ?></span> </div> </li> <?php } } ?> </ul> </div> <?php } } // end foreach loop } // end if ?> </div> <?php // call after specs hook do_action('aps_single_after_specs'); } elseif ($tb_key == 'reviews') { // call before reviews hook do_action('aps_single_before_reviews'); ?> <h2 class="aps-tab-title"><?php echo $title; ?> - <?php echo $tab['name']; ?></h2> <?php // include reviews include_once(APS_DIR .'/inc/aps-reviews.php'); // call after reviews hook do_action('aps_single_after_reviews'); } elseif ($tb_key == 'videos') { // call before videos hook do_action('aps_single_before_videos'); ?> <h2 class="aps-tab-title"><?php echo $title; ?> - <?php echo $tab['name']; ?></h2> <?php // check if videos if (aps_is_array($videos)) { ?> <div class="aps-product-videos aps-row"> <?php foreach ($videos as $video) { $host = $video['host']; $vid = $video['vid']; switch ($host) { case 'youtube': $video_url = '//www.youtube.com/watch?v=' .$vid; break; case 'vimeo': $video_url = '//www.vimeo.com/' .$vid; break; case 'dailymotion': $video_url = '//www.dailymotion.com/embed/video/' .$vid; break; } ?> <div class="aps-video-col"> <div class="aps-video-box"> <div class="aps-video"> <a class="aps-lightbox" href="<?php echo $video_url; ?>"<?php if ($host == 'dailymotion') echo ' data-lightbox-type="iframe"'; ?> data-lightbox-gallery="video"> <img src="<?php echo $video['img']; ?>" alt="Video Thumbnail" /> <span class="aps-video-play"></span> </a> </div> </div> </div> <?php } ?> </div> <?php } // call after videos hook do_action('aps_single_after_videos'); } elseif ($tb_key == 'gallery') { // call before gallery hook do_action('aps_single_before_gallery'); ?> <h2 class="aps-tab-title"><?php echo $title; ?> - <?php echo $tab['name']; ?></h2> <?php // check if images if (aps_is_array($images)) { ?> <div class="aps-gallery-container"> <ul class="aps-gallery-thumbs aps-row clearfix"> <?php foreach ($images as $image) { $img = get_product_image(800, 800, '', (int) $image); $thumb = get_product_image(220, 220, '', (int) $image); $alt = get_post_meta((int) $image, '_wp_attachment_image_alt', true); $alt = ($alt) ? $alt : $title; ?> <li> <a class="aps-lightbox" href="<?php echo $img['url']; ?>" title="<?php echo $alt; ?>" data-lightbox-gallery="gallery"> <img class="aps-gallery-thumb" src="<?php echo $thumb['url']; ?>" alt="<?php echo $alt; ?>" /> <span class="aps-gallery-zoom"> <span class="aps-icon-search"></span> <strong class="aps-image-title"><?php echo $alt; ?></strong> </span> </a> </li> <?php } ?> </ul> </div> <?php } // call after gallery hook do_action('aps_single_after_gallery'); } elseif ($tb_key == 'offers') { // call before offers hook do_action('aps_single_before_offers'); ?> <div class="aps-column"> <h2 class="aps-tab-title"><?php echo $title; ?> - <?php echo $tab['name']; ?></h2> <?php // loop offers if (aps_is_array($offers)) { // get aps affiliate stores $stores = get_aps_affiliates(); ?> <ul class="aps-offers-list clearfix"> <?php foreach ($offers as $offer) { ?> <li> <span class="aps-offer-thumb"> <img src="<?php echo $stores[$offer['store']]['logo']; ?>" alt="<?php echo $stores[$offer['store']]['name']; ?>" /> </span> <span class="aps-offer-title"><?php echo $offer['title']; ?></span> <span class="aps-offer-price"> <?php echo $offer['price']; ?> </span> <span class="aps-offer-link"><br /> <a class="aps-button aps-btn-skin" href="<?php echo $offer['url']; ?>" target="_blank" rel="nofollow"><?php _e('View Offer', 'aps-text'); ?></a> </span> </li> <?php } ?> </ul> <?php } ?> </div> <?php // call after offers hook do_action('aps_single_after_offers'); } elseif ($tb_key == 'custom1') { // call before custom1 hook do_action('aps_single_before_custom1'); ?> <div class="aps-column"> <h2 class="aps-tab-title"><?php echo $title; ?> - <?php echo $tab['name']; ?></h2> <?php echo wpautop(do_shortcode($tabs_data['tab1'])); ?> </div> <?php // call after custom1 hook do_action('aps_single_after_custom1'); } elseif ($tb_key == 'custom2') { // call before custom2 hook do_action('aps_single_before_custom2'); ?> <div class="aps-column"> <h2 class="aps-tab-title"><?php echo $title; ?> - <?php echo $tab['name']; ?></h2> <?php echo wpautop(do_shortcode($tabs_data['tab2'])); ?> </div> <?php // call after custom2 hook do_action('aps_single_after_custom2'); } elseif ($tb_key == 'custom3') { // call before custom3 hook do_action('aps_single_before_custom3'); ?> <div class="aps-column"> <h2 class="aps-tab-title"><?php echo $title; ?> - <?php echo $tab['name']; ?></h2> <?php echo wpautop(do_shortcode($tabs_data['tab3'])); ?> </div> <?php // call after custom3 hook do_action('aps_single_after_custom3'); } ?> </div> <?php } } ?> </div> <?php } endwhile; // call before related hook do_action('aps_single_before_related'); // get product brand $brand = get_product_brand($pid); $brand_link = get_term_link($brand); // get more products by same brand $args = array( 'post_type' => 'aps-products', 'posts_per_page' => $settings['more-num'], 'orderby' => 'rand', 'aps-brands' => $brand->slug, 'post__not_in' => array($pid) ); $related = new WP_Query($args); if ($related->have_posts()) { ?> <div class="aps-column"> <h3><?php _e('More Products from', 'aps-text'); ?> <a href="<?php echo $brand_link; ?>"><?php echo $brand->name; ?></a></h3> <ul class="aps-related-products aps-row clearfix"> <?php while ($related->have_posts()) { $related->the_post(); ?> <li> <?php // get related product thumbnail $rd_thumb = get_product_image(60, 60); // get related product reviews $rd_reviews = get_comments_number($post->ID); ?> <div class="aps-rd-box"> <a class="aps-rd-thumb" href="<?php the_permalink(); ?>"> <img src="<?php echo $rd_thumb['url']; ?>" alt="<?php the_title_attribute(); ?>" /> </a> <span class="aps-rd-title"><a href="<?php the_permalink(); ?>"><strong><?php the_title(); ?></strong></a></span><br /> <span class="aps-rd-reviews"><?php echo $rd_reviews; ?> <?php echo ($rd_reviews == 1) ? __('Review', 'aps-text') : __('Reviews', 'aps-text'); ?></span><br /> <span class="aps-rd-specs"><a href="<?php the_permalink(); ?>"><?php _e('View specs', 'aps-text'); ?> →</a></span> </div> </li> <?php } ?> </ul> </div> <?php } // rest query data wp_reset_postdata(); // call after related hook do_action('aps_single_after_related'); // get zoom settings $zoom = get_aps_settings('zoom'); // get gallery (lightbox) settings $lightbox = get_aps_settings('gallery') ?> <script type="text/javascript"> jQuery(document).ready(function($) { <?php if ($design['sections'] != 'flat') { ?> // aps tabs $(".aps-tab-content:first").show(); $("ul.aps-tabs li").click(function(e) { $(this).addClass("active"); $(this).siblings().removeClass("active"); //$(".aps-tab-content").hide(); var activeTab = $(this).find("a").attr("href"); $(activeTab).fadeIn(300); $(".aps-tab-content").not(activeTab).hide(); $(window).trigger("rating"); e.preventDefault(); }); <?php } if ($zoom['enable']) { ?> // zoom images on mouseover $(".image-zoom").elevateZoom({ lensShape: '<?php echo $zoom['lensShape']; ?>', lensSize: <?php echo $zoom['lensSize']; ?>, lensBorder: <?php echo $zoom['lensBorder']; ?>, zoomType : '<?php echo $zoom['zoomType']; ?>', scrollZoom : <?php echo ($zoom['scrollZoom'] ? 'true' : 'false'); ?>, easing : <?php echo ($zoom['easing'] ? 'true' : 'false'); ?>, easingAmount : <?php echo $zoom['easingAmount']; ?>, responsive : <?php echo ($zoom['responsive'] ? 'true' : 'false'); ?>, zoomWindowWidth : <?php echo $zoom['zoomWindowWidth']; ?>, zoomWindowHeight : <?php echo $zoom['zoomWindowHeight']; ?> }); <?php } ?> <?php if ($lightbox['enable']) { ?> // nivo lightbox $(".aps-lightbox").nivoLightbox({ effect: '<?php echo $lightbox['effect']; ?>', keyboardNav: <?php echo ($lightbox['nav'] ? 'true' : 'false'); ?>, clickOverlayToClose: <?php echo ($lightbox['close'] ? 'true' : 'false'); ?> }); <?php } ?> }); </script> <?php endif; ?> </div> <div class="aps-sidebar"> <?php aps_get_sidebar($template); ?> </div> </div> </div> <?php get_footer(); ?>
June 14, 2016 at 2:11 am #187511Victor Font
ModeratorQuestions on this forum are answered by volunteers who enjoy helping to support Studio Press themes and the Genesis Framework. It is not a job board to post work orders. The template you posted is full of functions that are not found in WordPress. This means the functions are custom coded. Without all the code this template depends upon for functionality, no one will be able to convert this to a Genesis template because it's not possible to know what those functions do or the functionality you want from looking at the source code you posted.
You would be much better seeking a paid developer. I doubt you will find anyone that will convert this for you for free even if you found someone willing to try. There's a lot of work to this, maybe even a couple of days. Perhaps a better approach is to describe the functionality you want along with screen shots or wire frames of the functionality you want and hire a developer to create it for you. Try a site like codeable.io. You may get lucky and find someone that will do this for less than $500, but with the amount of work you are asking for, don't be surprised if you need a budget of $500 or more. Good luck!
Regards,
Victor
https://victorfont.com/
Call us toll free: 844-VIC-FONT (842-3668)
Have you requested your free website audit yet?June 14, 2016 at 4:53 pm #187546rogger
MemberThanks Victor, I do understand. I was just looking around if anybody can guide me. I will try codeable.
-
AuthorPosts
- The forum ‘General Discussion’ is closed to new topics and replies.