<?}else{?> <div><img class="img-responsive big-teaser" src="<?php echo get_option('front-page-image4') ?>"></div> <?} }?> <?php if (get_option('front-page-image5')){ $alttag=get_post_meta(get_attachment_id_from_url(get_option('front-page-image5')), '_wp_attachment_image_alt', true); if ($alttag) {?> <div><img class="img-responsive big-teaser" alt="<?php echo $alttag; ?>" src="<?php echo get_option('front-page-image5') ?>"></div> <?}else{?> <div><img class="img-responsive big-teaser" src="<?php echo get_option('front-page-image5') ?>"></div> <?} }?> <?php if (get_option('front-page-image6')){ $alttag=get_post_meta(get_attachment_id_from_url(get_option('front-page-image6')), '_wp_attachment_image_alt', true); if ($alttag) {?> <div><img class="img-responsive big-teaser" alt="<?php echo $alttag; ?>" src="<?php echo get_option('front-page-image6') ?>"></div> <?}else{?> <div><img class="img-responsive big-teaser" src="<?php echo get_option('front-page-image6') ?>"></div> <?} }?> </div> </div> </div> </div> <div class="row"> <div id="primary" class="content-area front-page-text">
function start_el(&$output, $item, $depth = 0, $args = array(), $id = 0) { $this->curItem = $item; $submenuOutput = ''; $atts = array(); $atts['title'] = !empty($item->attr_title) ? $item->attr_title : ''; $atts['target'] = !empty($item->target) ? $item->target : ''; $atts['rel'] = !empty($item->xfn) ? $item->xfn : ''; $atts['href'] = !empty($item->url) ? $item->url : ''; $atts = apply_filters('nav_menu_link_attributes', $atts, $item, $args); if (isset($item->submenu_category) && $item->submenu_category == 1) { $post = get_post($item->object_id); $template = get_metadata('post', $item->object_id, '_wp_page_template', true); if ($template == 'menu.php' || $template == 'menu2.php' || $template == 'menu3.php') { $categories = get_metadata('post', $item->object_id, 'menu_categories', true); if (!empty($categories)) { $terms = get_terms('berg_menu_categories', array('include' => $categories, 'hide_empty' => false)); $termsArray = array(); foreach ($terms as $term) { $termsArray[$term->term_id] = array('id' => $term->term_id, 'name' => $term->name, 'slug' => $term->slug); } $submenuOutput = "<div class=\"subnav image-subnav\"><ul class=\"subnav-wrapper\">\n"; foreach ($categories as $cat) { $t_id = $termsArray[$cat]['id']; $imgUrl = get_option("taxonomy_{$t_id}"); if (isset($imgUrl['menu_category_icon_image']) && getTemplateName() == 'homepage.php') { $imgUrl = get_attachment_id_from_url($imgUrl['menu_category_icon_image']); $imgUrl = wp_get_attachment_image_src($imgUrl, 'menu_thumb'); $imgUrl = 'background-image: url(' . $imgUrl[0] . ')'; } else { $imgUrl = ''; } $submenuOutput .= '<li><a href="' . esc_url($atts['href']) . '#category-' . $termsArray[$cat]['slug'] . '">' . $termsArray[$cat]['name'] . '</a><div><a href="' . esc_url($atts['href']) . '#category-' . $termsArray[$cat]['slug'] . '" class="menu-img" style="' . $imgUrl . '"></a></div></li>'; } $submenuOutput .= "</ul></div>\n"; $this->excluded[] = $item->ID; } } } $indent = $depth ? str_repeat("\t", $depth) : ''; $class_names = ''; $classes = empty($item->classes) ? array() : (array) $item->classes; $classes[] = 'menu-item-' . $item->ID; $class_names = join(' ', apply_filters('nav_menu_css_class', array_filter($classes), $item, $args)); $class_names = $class_names ? ' class="' . esc_attr($class_names) . '"' : ''; $id = apply_filters('nav_menu_item_id', 'menu-item-' . $item->ID, $item, $args); $id = $id ? ' id="' . esc_attr($id) . '"' : ''; $output .= $indent . '<li' . $id . $class_names . '>'; $attributes = ''; foreach ($atts as $attr => $value) { if (!empty($value)) { $value = 'href' === $attr ? esc_url($value) : esc_attr($value); $attributes .= ' ' . $attr . '="' . $value . '"'; } } $item_output = $args->before; $item_output .= '<a' . $attributes . '>'; /** This filter is documented in wp-includes/post-template.php */ $item_output .= $args->link_before . apply_filters('the_title', $item->title, $item->ID) . $args->link_after; $item_output .= '</a>'; $item_output .= $submenuOutput; $item_output .= $args->after; // $output .= $submenuOutput; if (!in_array($item->menu_item_parent, $this->excluded)) { $output .= apply_filters('walker_nav_menu_start_el', $item_output, $item, $depth, $args); } }
/** * Save field type meta * * Updates meta values for job/resume when updated, or created. * * @since 1.1.9 * * @param string $type Type of custom fields to save meta for * @param integer $job_id Specific ID of job to update/save values for * @param array $values Array of values to use, normally passed from $_POST values */ function save_custom_fields($type, $job_id, $values) { $custom_fields = $this->get_custom_fields(true, $type); // Save Package/Product ID if POSTed from submit page $wcpl_pid = isset($_POST['wcpl_jmfe_product_id']) ? intval($_POST['wcpl_jmfe_product_id']) : false; if ($wcpl_pid) { update_post_meta($job_id, '_wcpl_jmfe_product_id', $wcpl_pid); } if (!empty($custom_fields)) { $custom_enabled_fields = wp_list_filter($custom_fields, array('status' => 'disabled'), 'NOT'); foreach ($custom_enabled_fields as $custom_field => $custom_field_config) { $field_value = isset($values[$type][$custom_field]) ? $values[$type][$custom_field] : false; if (isset($field_value)) { $_meta_key = '_' . $custom_field; // Featured image if ($_meta_key === '_featured_image' && !empty($field_value)) { $attach_id = get_attachment_id_from_url($field_value); if ($attach_id !== get_post_thumbnail_id($job_id)) { set_post_thumbnail($job_id, $attach_id); } elseif ('' == $field_value && has_post_thumbnail($job_id)) { delete_post_thumbnail($job_id); delete_post_meta($job_id, $_meta_key); } } // Don't update post meta for default fields if (isset($custom_field_config['origin']) && $custom_field_config['origin'] != "default") { update_post_meta($job_id, $_meta_key, $field_value); } // Auto save auto populate field to user meta if (isset($custom_field_config['populate_save']) && !empty($custom_field_config['populate_save'])) { // Only update user meta if actual value is different from default value if ($custom_field_config['populate_default'] !== $field_value) { update_user_meta(get_current_user_id(), $_meta_key, $field_value); } } } } } }