function sitesettings_get_header_css($id) { $shortlinks = get_field('sitesetting-header-shortlinks', $id); if (!$shortlinks || $shortlinks == '') { return ''; } $css = ''; $i = 1; while (has_sub_fields('sitesetting-header-shortlinks', $id)) { if (get_sub_field('sitesetting-header-shortlink-appearance')) { $bg_color = get_sub_field('sitesetting-header-shortlink-bgcolor'); $bg_color_hover = get_sub_field('sitesetting-header-shortlink-bgcolor-hover'); $text_color = get_sub_field('sitesetting-header-shortlink-color'); $text_color_hover = get_sub_field('sitesetting-header-shortlink-color-hover'); $css .= <<<CSS #link{$i}.top-menu-link { background: {$bg_color}; color: {$text_color}; } a#link{$i}.top-menu-link:hover { background: {$bg_color_hover}; color: {$text_color_hover}; } CSS; } $i++; } return $css; }
static function get_average_score() { if (get_field('enable_post_review') && get_field('score_breakdown')) { $average = 0; $scores = 0; while (has_sub_fields('score_breakdown')) { $average = $average + get_sub_field('score'); $scores++; } $average = round($average / $scores, 1); return $average; } return false; }
function sitesettings_shortlinks() { if (!($id = sitesettings_check_current_setting())) { return ''; } else { $shortlinks = get_field('sitesetting-header-shortlinks', $id); if (!$shortlinks || $shortlinks == '') { return ''; } else { ?> <div class="header-shortlinks pull-right"> <?php $i = 1; while (has_sub_fields('sitesetting-header-shortlinks', $id)) { $text = get_sub_field('sitesetting-header-shortlink-text'); $type = get_sub_field('sitesetting-header-shortlink-type'); if ($type == 'phone') { $url = 'tel:' . get_sub_field('sitesetting-header-shortlink-phone'); } elseif ($type == 'external') { $url = get_sub_field('sitesetting-header-shortlink-url'); } elseif ($type == 'internal') { $url = get_sub_field('sitesetting-header-shortlink-page'); } elseif ($type == 'email') { $url = 'mailto:' . get_sub_field('sitesetting-header-shortlink-email'); } $target = get_sub_field('sitesetting-header-shortlink-target'); $icon = false; if (get_sub_field('sitesetting-header-shortlink-appearance')) { $shortlink_icon = get_sub_field('sitesetting-header-shortlink-icon'); if ($shortlink_icon && $shortlink_icon != '') { $icon = true; } } $target = get_sub_field('sitesetting-header-shortlink-target'); ?> <a id="link<?php echo $i; ?> " href="<?php echo $url; ?> " target="<?php echo $target; ?> " class="top-menu-link"><?php if ($icon) { ?> <i class="ion <?php echo $shortlink_icon; ?> "></i> <?php } echo $text; ?> </a> <?php $i++; } ?> </div> <?php } } }
?> <?php if (get_field('score_breakdown') && count(get_field('score_breakdown')) > 1) { ?> <div class="heading"> <h3 class="page-title"><?php _e('The Breakdown', BW_THEME); ?> </h3> </div> <div class="the-breakdown"> <?php while (has_sub_fields('score_breakdown')) { ?> <div class="review-score"> <div class="score-label bb"><?php echo get_sub_field('label'); ?> </div> <span class="badge bb"><?php echo get_sub_field('score'); ?> </span> <div class="bar">
<ul> <?php while (has_sub_fields('technologies')) { ?> <li><?php the_sub_field('technology'); ?> </li> <?php } //end technologies while loop ?> </ul> <div class="portfolio-items"> <?php while (has_sub_fields('images')) { ?> <div class="portfolio-item"> <?php $image = get_sub_field('image'); ?> <img src="<?php echo $image['sizes']['medium']; ?> " alt=""> <p><?php the_sub_field('caption'); ?> </p> </div> <!-- portfolio-items --> <?php