function widget($args, $instance) { extract($args); $title = apply_filters('widget_title', $instance['title']); $testimonial = wpml_t(THEMESLUG, 'Testimonial', $instance['testimonial']); $from = wpml_t(THEMESLUG, 'From', $instance['from']); $addClass = ""; if (empty($title)) { $addClass = "notitle"; } //Content $content = '<blockquote class="testimonial ' . $addClass . '"><p>'; if (!empty($testimonial)) { $content .= '<span class="mark-first"></span>' . $testimonial . '<span class="mark-last"></span>'; } if (!empty($from)) { $content .= '<span class="author">— ' . $from . '</span>'; } $content .= '</p></blockquote>'; echo $before_widget; if ($title) { echo $before_title . $title . $after_title; } echo $content; echo $after_widget; }
function widget($args, $instance) { extract($args); $title = apply_filters('widget_title', $instance['title']); $address = wpml_t(THEMESLUG, 'Address', $instance['address']); $phone_1 = wpml_t(THEMESLUG, 'Phone 1', $instance['phone_1']); $phone_2 = wpml_t(THEMESLUG, 'Phone 2', $instance['phone_2']); $fax_1 = wpml_t(THEMESLUG, 'Fax 1', $instance['fax_1']); $fax_2 = wpml_t(THEMESLUG, 'Fax 2', $instance['fax_2']); $mail_1 = wpml_t(THEMESLUG, 'Email 1', $instance['mail_1']); $mail_2 = wpml_t(THEMESLUG, 'Email 2', $instance['mail_2']); $support_mail_1 = wpml_t(THEMESLUG, 'Support Email 1', $instance['support_mail_1']); $support_mail_2 = wpml_t(THEMESLUG, 'Support Email 2', $instance['support_mail_2']); $map_link = wpml_t(THEMESLUG, 'Map Link', $instance['map_link']); $contact_form_link = wpml_t(THEMESLUG, 'Contact Form Link', $instance['contact_form_link']); $map_link_text = wpml_t(THEMESLUG, 'Map Link Text', $instance['map_link_text']); $contact_form_link_text = wpml_t(THEMESLUG, 'Contact Form Link Text', $instance['contact_form_link_text']); //Contact Info $contactInfo = '<ul class="contact_list">'; if (!empty($address)) { $contactInfo .= '<li class="home">' . $address . '</li>'; } if (!empty($phone_1)) { $contactInfo .= '<li class="phone">' . $phone_1 . '</li>'; } if (!empty($phone_2)) { $contactInfo .= '<li class="phone">' . $phone_2 . '</li>'; } if (!empty($fax_1)) { $contactInfo .= '<li class="fax">' . $fax_1 . '</li>'; } if (!empty($fax_2)) { $contactInfo .= '<li class="fax">' . $fax_2 . '</li>'; } if (!empty($mail_1)) { $contactInfo .= '<li class="mail"><a href="mailto:' . $mail_1 . '">' . $mail_1 . '</a></li>'; } if (!empty($mail_2)) { $contactInfo .= '<li class="mail"><a href="mailto:' . $mail_2 . '">' . $mail_2 . '</a></li>'; } if (!empty($support_mail_1)) { $contactInfo .= '<li class="help"><a href="mailto:' . $support_mail_1 . '">' . $support_mail_1 . '</a></li>'; } if (!empty($support_mail_2)) { $contactInfo .= '<li class="help"><a href="mailto:' . $support_mail_2 . '">' . $support_mail_2 . '</a></li>'; } if (!empty($map_link)) { $contactInfo .= '<li class="map"><a href="' . $map_link . '" title="' . $map_link_text . '">' . $map_link_text . '</a></li>'; } if (!empty($contact_form_link)) { $contactInfo .= '<li class="contact_form_icon"><a href="' . $contact_form_link . '" title="' . $contact_form_link_text . '">' . $contact_form_link_text . '</a></li>'; } $contactInfo .= '</ul>'; echo $before_widget; if ($title) { echo $before_title . $title . $after_title; } echo $contactInfo; echo $after_widget; }
function widget($args, $instance) { extract($args); wp_enqueue_script('jquery-forms', THEME_ADMIN_JS_URI . '/jqueryforms.js'); wp_enqueue_script('jquery-validate', THEME_JS . '/jquery.validate.min.js', array('jquery-forms')); require_once THEME_ADMIN . '/interfaces/wonder-forms/formbuilder-front.php'; $fb = new Formbuilder(); global $wpdb; $table = $wpdb->prefix . 'ultimatum_forms'; $query = "SELECT * FROM {$table} WHERE `id`='{$instance['form']}'"; $form = $wpdb->get_row($query, ARRAY_A); if ($form) { $fields = unserialize($form['fields']); foreach ($fields['properties'] as $field => $data) { foreach ($data as $key => $value) { if ($key == 'label') { $fields['properties'][$field][$key] = wpml_t('Ultimatum Forms', 'Form-' . $form['name'] . '- Label (' . $value . ')', $value); } if ($key == 'values') { $fields['properties'][$field][$key] = wpml_t('Ultimatum Forms', 'Form-' . $form['name'] . '- Values (' . $data['label'] . ')', $value); } } } $items = $fb->build($fields); $html = ''; // Start the form and put in hidden fields for referral tracking if (stripos($form['thank'], 'http')) { $html .= '<div class="uforms"><form id="uform_' . $form['id'] . '" method="post" action="' . THEME_AJAX . '/sendmail.php">'; } else { $html .= '<div class="uforms"><form id="uform_' . $form['id'] . '" method="post" action="' . THEME_AJAX . '/sendmail.php" class="ultimate_form">'; } if ($items) { foreach ($items as $id => $item) { if ($item['type'] != 'text') { // $item['label']=wpml_t('Ultimatum Forms', 'Form-'.$form[name].'- Label ('.$item['label'].')', $item['label']); $html .= '<div class="' . $id . ' ' . $item['type'] . '"><label for="' . $item['label'] . '">' . $item['label'] . '</label><br />'; } $html .= str_replace($id, $item['label'], $item['html']); if ($item['type'] != 'text') { $html .= '</div>'; } } } $html .= '<div class="form-submit"><input type="hidden" name="uformid" value="' . $form["id"] . '" />'; $html .= '<input type="submit" class="button hover" value="' . $form["button"] . '" /></div>'; $html .= '</form></div>'; $html = str_replace('"', "'", $html); $html = str_replace('\\n', "", $html); echo $before_widget; if ($instance["title"]) { echo $before_title . $instance["title"] . $after_title; } echo $html; echo $after_widget; } }
function shortcode_form($atts, $content = null, $code) { extract(shortcode_atts(array('id' => ''), $atts)); wp_enqueue_script('jquery-forms', THEME_ADMIN_JS_URI . '/jqueryforms.js'); wp_enqueue_script('jquery-validate', THEME_JS . '/jquery.validate.min.js', array('jquery-forms')); require_once THEME_ADMIN . '/interfaces/wonder-forms/formbuilder-front.php'; $fb = new Formbuilder(); global $wpdb; $table = $wpdb->prefix . 'ultimatum_forms'; $query = "SELECT * FROM {$table} WHERE `id`='{$id}'"; $form = $wpdb->get_row($query, ARRAY_A); if ($form) { $fields = unserialize($form['fields']); foreach ($fields['properties'] as $field => $data) { foreach ($data as $key => $value) { if ($key == 'label') { $fields['properties'][$field][$key] = wpml_t('Ultimatum Forms', 'Form-' . $form['name'] . '- Label (' . $value . ')', $value); } if ($key == 'values') { $fields['properties'][$field][$key] = wpml_t('Ultimatum Forms', 'Form-' . $form['name'] . '- Values (' . $data['label'] . ')', $value); } } } $items = $fb->build($fields); $html = ''; if (stripos($form['thank'], 'http')) { $html .= '<div class="uforms"><form id="uform_' . $form['id'] . '" method="post" action="' . THEME_AJAX . '/sendmail.php">'; } else { $html .= '<div class="uforms"><form id="uform_' . $form['id'] . '" method="post" action="' . THEME_AJAX . '/sendmail.php" class="ultimate_form">'; } if ($items) { foreach ($items as $id => $item) { if ($item['type'] != 'text') { $html .= '<div class="' . $id . ' ' . $item['type'] . '"><label for="' . wpml_t('Ultimatum Forms', 'Form-' . $form["name"] . '- Label (' . $item['label'] . ')', $item['label']) . '">' . wpml_t('Ultimatum Forms', 'Form-' . $form["name"] . '- Label (' . $item['label'] . ')', $item['label']) . '</label><br />'; } $html .= str_replace($id, $item["label"], $item['html']); if ($item['type'] != 'text') { $html .= '</div>'; } } } $html .= '<div class="form-submit"><input type="hidden" name="uformid" value="' . $form["id"] . '" />'; $html .= '<input type="submit" class="button hover" value="' . $form["button"] . '" /></div>'; $html .= '</form>'; $html .= '</div>'; $html = str_replace('"', "'", $html); $html = str_replace('\\n', "", $html); return $html; } }
function widget($args, $instance) { global $wpdb; $uslider = false; extract($args); $instance["Width"] = $grid_width; if (eregi('ptype-', $instance["slide"])) { $post_type = str_replace('ptype-', '', $instance["slide"]); $query = array('post_type' => $post_type, 'showposts' => $instance["number"], 'orderby' => 'date', 'order' => 'DESC', 'meta_key' => '_thumbnail_id'); $loop = new WP_Query($query); $images = array(); while ($loop->have_posts()) { $loop->the_post(); $image_id = get_post_thumbnail_id(); $images[] = array('image_id' => $image_id, 'id' => get_the_ID(), 'title' => get_the_title(), 'text' => wp_html_excerpt(get_the_excerpt(), $instance["exlen"]) . '...', 'link' => get_permalink(), 'video' => get_post_meta(get_the_ID(), 'ultimatum_video', true), 'target' => '_self'); } } elseif (eregi('cat-', $instance["slide"])) { $catid = str_replace('cat-', '', $instance["slide"]); $query = array('post_type' => 'post', 'showposts' => $instance[number], 'orderby' => 'date', 'order' => 'DESC', 'meta_key' => '_thumbnail_id', 'cat' => $catid); $loop = new WP_Query($query); $images = array(); while ($loop->have_posts()) { $loop->the_post(); $image_id = get_post_thumbnail_id(); $images[] = array('image_id' => $image_id, 'id' => get_the_ID(), 'title' => get_the_title(), 'text' => wp_html_excerpt(get_the_excerpt(), $instance["exlen"]) . '...', 'link' => get_permalink(), 'target' => '_self', 'video' => get_post_meta(get_the_ID(), 'ultimatum_video', true)); } } elseif (eregi('taxonomy-', $instance[slide])) { $prop = explode('|', str_replace('taxonomy-', '', $instance["slide"])); $query = array('post_type' => $prop[0], 'showposts' => $instance["number"], 'orderby' => 'date', 'order' => 'DESC'); global $wp_version; if (version_compare($wp_version, "3.1", '>=')) { $query['tax_query'] = array(array('taxonomy' => $prop[1], 'field' => 'slug', 'terms' => explode(',', $prop[2]))); } else { $query['taxonomy'] = $prop[1]; $query['term'] = $prop[2]; } $loop = new WP_Query($query); $images = array(); while ($loop->have_posts()) { $loop->the_post(); $image_id = get_post_thumbnail_id(); $images[] = array('image_id' => $image_id, 'id' => get_the_ID(), 'title' => get_the_title(), 'text' => wp_html_excerpt(get_the_excerpt(), $instance["exlen"]) . '...', 'link' => get_permalink(), 'target' => '_self', 'video' => get_post_meta(get_the_ID(), 'ultimatum_video', true)); } } else { $table = $wpdb->prefix . 'ultimatum_slides'; $slide_id = $instance["slide"]; $sel = "SELECT * FROM {$table} WHERE id='{$slide_id}'"; $result = $wpdb->get_row($sel, ARRAY_A); $imagez = unserialize($result['images']); // WPML if (count($result) != 0) { foreach ($imagez as $imag) { $imag["title"] = wpml_t('Ultimatum Slideshow', 'Slide-' . $result["name"] . '- Title ' . $imag["title"], $imag["title"]); $imag["text"] = wpml_t('Ultimatum Slideshow', 'Slide-' . $result["name"] . '- Text ' . $imag["title"], $imag["text"]); $imag["link"] = wpml_t('Ultimatum Slideshow', 'Slide-' . $result["name"] . '- Link ' . $imag["title"], $imag["link"]); $imag["video"] = wpml_t('Ultimatum Slideshow', 'Slide-' . $result["name"] . '- Video ' . $imag["title"], $imag["video"]); $images[] = $imag; } } // WPML $uslider = true; } if (count($images) > 0) { } else { return; } echo $before_widget; if ($instance["title"]) { echo $before_title . $instance["title"] . $after_title; } if ($instance["Slider"] == 'nivo') { include THEME_WIDGETS . '/sliders/nivo.php'; } elseif ($instance["Slider"] == 's3') { include THEME_WIDGETS . '/sliders/s3.php'; } elseif ($instance["Slider"] == 'slidedeck') { include THEME_WIDGETS . '/sliders/slidedeck.php'; } elseif ($instance["Slider"] == 'anything') { include THEME_WIDGETS . '/sliders/anything.php'; } elseif ($instance["Slider"] == 'flex') { include THEME_WIDGETS . '/sliders/flex.php'; } elseif ($instance["Slider"] == 'zaccordion') { include THEME_WIDGETS . '/sliders/zaccordion.php'; } elseif ($instance["Slider"] == 'supersized') { include THEME_WIDGETS . '/sliders/supersized.php'; } echo $after_widget; }
$group_id = $template->group_id; if ($layout != "one") { if ($transparent) { echo '<div id="code_box_' . $template->group_id . '" class="template_builder codebox ' . $addCSS1 . ' ' . $addCSS2 . ' box ' . $layout . ' ' . $firstBox . ' ' . $lastBox . '">'; } else { echo '<div id="code_box_' . $template->group_id . '" class="template_builder ' . $addCSS2 . ' codebox box-shadow box ' . $layout . ' ' . $firstBox . ' ' . $lastBox . '">'; } } else { if ($transparent) { echo '<div id="code_box_' . $template->group_id . '" class="template_builder codebox ' . $addCSS1 . ' ' . $addCSS2 . ' ' . $layout . ' ' . $firstBox . ' ' . $lastBox . '">'; } else { echo '<div id="code_box_' . $template->group_id . '" class="template_builder ' . $addCSS2 . ' box-shadow box codebox ' . $layout . ' ' . $firstBox . ' ' . $lastBox . '">'; } } echo $template->heading ? '<h3>' . wpml_t(THEMESLUG, 'Title for Code Box ' . $selectedTemplate->templateID . $group_id, stripslashes($template->heading)) . '</h3><div class="space margin-b10"></div>' : ""; echo $template->code_space ? wpml_t(THEMESLUG, 'Description for Code Box ' . $selectedTemplate->templateID . $group_id, apply_filters('the_content', stripslashes($template->code_space))) : ""; echo '</div>'; } if ($reset) { //end fixed row holder if ($template->content_type != "default_content" && $template->content_type != "blog_box") { echo '</div>'; } //end fix and space if (isset($woo_module_used_in_template) && $woo_module_used_in_template == "TRUE" && $layout == "one") { echo '<div class="space margin-b10"></div>'; $woo_module_used_in_template = ""; } else { echo '<div class="space margin-b30"></div>'; } }
/** * Gets the link to the Home Page. This is compatible with WPML. * * @param $position * @return string */ function suffusion_get_home_link_html($position) { global $suffusion_options, $suffusion_interactive_text_fields; $retStr = ""; $option_name = $position == 'top' ? 'suf_navt_show_home' : 'suf_show_home'; if (!isset($suffusion_options[$option_name])) { $suf_show_home = "none"; } else { $suf_show_home = $suffusion_options[$option_name]; } $show_on_front = get_option('show_on_front'); $class = ""; if (is_front_page()) { $class = " class='current_page_item' "; } else { if (is_home() && $show_on_front == 'posts') { $class = " class='current_page_item' "; } } $option_name = $position == 'top' ? 'suf_navt_home_text' : 'suf_home_text'; $home_link = home_url(); if (function_exists('icl_get_home_url')) { $home_link = icl_get_home_url(); } if ($suf_show_home == "text") { if ($suffusion_options[$option_name] === FALSE || $suffusion_options[$option_name] == null) { $suf_home_text = "Home"; } else { if (trim($suffusion_options[$option_name]) == "") { $suf_home_text = "Home"; } else { if (function_exists('icl_t')) { // $suf_home_text = trim($suffusion_options[$option_name]); $suf_home_text = wpml_t('suffusion-interactive', $suffusion_interactive_text_fields[$option_name] . "|{$option_name}", trim($suffusion_options[$option_name])); } else { $suf_home_text = trim($suffusion_options[$option_name]); } } } $retStr .= "\n\t\t\t\t\t" . "<li {$class}><a href='" . $home_link . "'>" . $suf_home_text . "</a></li>"; } else { if ($suf_show_home == "icon") { $retStr .= "\n\t\t\t\t\t" . "<li {$class}><a href='" . $home_link . "'><img src='" . get_template_directory_uri() . "/images/home-light.png' alt='Home' class='home-icon'/></a></li>"; } } return $retStr; }
function theme_shortcode_portfolio($atts, $content = null, $code) { global $wp_filter; $the_content_filter_backup = $wp_filter['the_content']; extract(shortcode_atts(array('column' => 4, 'cat' => '', 'max' => 12, 'nopaging' => 'false', 'sortable' => 'false'), $atts)); switch ($column) { case 1: $column_class = 'one_column'; $size = array(600, (int) theme_get_option('portfolio', '1_column_height')); break; case 2: $column_class = 'two_columns'; $size = array(450, (int) theme_get_option('portfolio', '2_columns_height')); break; case 3: $column_class = 'three_columns'; $size = array(292, (int) theme_get_option('portfolio', '3_columns_height')); break; case 4: default: $column_class = 'four_columns'; $size = array(217, (int) theme_get_option('portfolio', '4_columns_height')); } $group = 'portfolio_' . rand(1, 1000); //for lightbox group if ($sortable != 'false') { //print scripts for sortable wp_print_scripts('jquery-quicksand'); wp_print_scripts('jquery-easing'); $output = '<section class="portfolios sortable">'; $output .= '<header class="sort_by_cat">'; $output .= '<span>' . __('Show:', 'striking_front') . '</span>'; $output .= '<a data-value="all" href="#">' . __('All', 'striking_front') . '</a>'; $terms = array(); if ($cat != '') { foreach (explode(',', $cat) as $term_slug) { $terms[] = get_term_by('slug', $term_slug, 'portfolio_category'); } } else { $terms = get_terms('portfolio_category', 'hide_empty=1'); } foreach ($terms as $term) { $output .= '<a data-value="' . $term->slug . '" href="#">' . $term->name . '</a>'; } $output .= '</header>'; $nopaging = 'true'; } else { $output = '<section class="portfolios">'; } $output .= '<ul class="portfolio_' . $column_class . '">'; if ($nopaging == 'false') { $paged = get_query_var('paged') ? get_query_var('paged') : 1; query_posts(array('post_type' => 'portfolio', 'posts_per_page' => $max, 'taxonomy' => 'portfolio_category', 'term' => $cat, 'paged' => $paged, 'orderby' => 'menu_order', 'order' => 'ASC')); } else { query_posts(array('post_type' => 'portfolio', 'taxonomy' => 'portfolio_category', 'showposts' => -1, 'term' => $cat, 'orderby' => 'menu_order', 'order' => 'ASC')); } $i = 1; if ($column == 1) { global $more; $more = 0; } while (have_posts()) { the_post(); $terms = get_the_terms(get_the_id(), 'portfolio_category'); $terms_slug = array(); if (is_array($terms)) { foreach ($terms as $term) { $terms_slug[] = $term->slug; } } if ($i % $column == 0 && $column != 1) { $output .= '<li data-id="' . get_the_id() . '" data-type="' . implode(',', $terms_slug) . '">'; } else { $output .= '<li data-id="' . get_the_id() . '" data-type="' . implode(',', $terms_slug) . '">'; } $i++; if (has_post_thumbnail()) { $image = wp_get_attachment_image_src(get_post_thumbnail_id(get_the_id()), 'full', true); $type = get_post_meta(get_the_id(), '_type', true); if ($type == 'image') { $href = get_post_meta(get_the_id(), '_video', true); $href = get_post_meta(get_the_id(), '_image', true); if (empty($href)) { $href = $image[0]; } $icon = 'zoom'; $lightbox = ' lightbox'; $rel = ' rel="' . $group . '"'; } elseif ($type == 'video') { $href = get_post_meta(get_the_id(), '_video', true); if (empty($href)) { $href = $image[0]; } $icon = 'play'; $lightbox = ' lightbox'; $rel = ' rel="' . $group . '"'; } elseif ($type == 'link') { $link = get_post_meta(get_the_ID(), '_link', true); $href = theme_get_superlink($link); $link_target = get_post_meta(get_the_ID(), '_link_target', true); $link_target = $link_target ? $link_target : '_self'; $icon = 'link'; $lightbox = ''; $rel = ''; } else { $href = get_permalink(); $icon = 'doc'; $lightbox = ''; $rel = ''; } $override_icon = get_post_meta(get_the_ID(), '_icon', true); if ($override_icon && $override_icon != 'default') { $icon = $override_icon; } $output .= '<div class="image_styled portfolio_image">'; $output .= '<span class="image_frame" style="height:' . $size[1] . 'px">'; $output .= '<a class="image_icon_' . $icon . $lightbox . '" ' . (isset($link_target) ? 'target="' . $link_target . '" ' : '') . ' href="' . $href . '"' . $rel . '>'; $output .= '<img src="' . THEME_INCLUDES . '/timthumb.php?src=' . get_image_src($image[0]) . '&h=' . $size[1] . '&w=' . $size[0] . '&zc=1' . '" title="' . get_the_title() . '" alt="' . get_the_title() . '" />'; $output .= '</a>'; $output .= '</span>'; $output .= '<img src="' . THEME_IMAGES . '/image_shadow.png" class="image_shadow">'; $output .= '</div>'; } $output .= '<div class="portfolio_details">'; if (theme_get_option('portfolio', 'display_title') || $column == 1) { $output .= '<div class="portfolio_title">' . get_the_title() . '</div>'; } if (theme_get_option('portfolio', 'display_excerpt') || $column == 1) { if ($column == 1) { $output .= '<div class="portfolio_desc">' . apply_filters('the_content', get_the_content()) . '</div>'; } else { $output .= '<div class="portfolio_desc">' . get_the_excerpt() . '</div>'; } } $more = get_post_meta(get_the_id(), '_more', true); if (theme_get_option('portfolio', 'display_more_button') && $more != '-1') { $more_link = theme_get_superlink(get_post_meta(get_the_id(), '_more_link', true), get_permalink()); $more_link_target = get_post_meta(get_the_ID(), '_link_target', true); $more_link_target = $more_link_target ? $more_link_target : '_self'; $output .= '<div class="portfolio_more_button"><a href="' . $more_link . '" target="' . $more_link_target . '"><span>' . wpml_t(THEME_NAME, 'Portfolio More Button Text', theme_get_option('portfolio', 'more_button_text')) . '</span></a></div>'; } $output .= '</div>'; $output .= '</li>'; } $output .= '</ul>'; if ($nopaging == 'false') { ob_start(); theme_portfolio_pagenavi('', '', $paged); $output .= ob_get_clean(); } $output .= '</section>'; wp_reset_query(); $wp_filter['the_content'] = $the_content_filter_backup; return $output; }
function rt_breadcrumb() { global $taxonomy, $term_slug, $post, $delimiter; if (!get_option('rttheme_breadcrumb_menus')) { return false; } //Markup $before = '<div class="breadcrumb">' . wpml_t(THEMESLUG, 'Breadcrumb Menu Text', get_option(THEMESLUG . '_breadcrumb_text')) . ' '; $after = '</div>'; $delimiter = ' | '; /* WooCommerce Breadcrumb */ if (function_exists('woocommerce_breadcrumb')) { if (is_woocommerce()) { $defaults = array('delimiter' => $delimiter, 'wrap_before' => $before, 'wrap_after' => $after, 'before' => '', 'after' => '', 'home' => null); woocommerce_breadcrumb($defaults); return false; } } echo $before; //Home Page echo "<a href=\"" . BLOGURL . "\" title=\"" . get_bloginfo('name') . "\">" . __('Home', 'rt_theme') . "</a>"; // page parents function function page_parents($parent_page_id, $child_pages) { global $delimiter; $parent_page = get_page($parent_page_id); $page_parents = $delimiter . "<a href=\"" . get_permalink($parent_page->ID) . "\" title=\"" . get_the_title($parent_page->ID) . "\" >" . get_the_title($parent_page->ID) . "</a>" . $child_pages; if ($parent_page->post_parent) { page_parents($parent_page->post_parent, $page_parents); } else { echo $page_parents; } } // term parents function function term_parents($term_id, $child_terms) { global $taxonomy, $delimiter; $parent_term = get_term_by('ID', $term_id, $taxonomy); $term_parents = $delimiter . "<a href=\"" . get_term_link($parent_term->slug, $taxonomy) . "\" title=\"" . $parent_term->name . "\" >" . $parent_term->name . "</a>" . $child_terms; if ($parent_term->parent) { term_parents($parent_term->parent, $term_parents); } else { echo $term_parents; } } //get start page function get_start_page($start_page) { global $delimiter; //start page parents $get_start_page = get_page($start_page); if ($get_start_page->post_parent) { page_parents($get_start_page->post_parent, ''); } //start page if ($start_page && !get_query_var('lang')) { echo $delimiter . "<a href=\"" . get_permalink($start_page) . "\" title=\"" . get_the_title($start_page) . "\" >" . get_the_title($start_page) . "</a>"; } } //terms function term_links() { global $taxonomy, $post_type, $term_slug, $delimiter; //Find start page and define taxonomy names if ($taxonomy == "product_categories") { $start_page = get_option('rttheme_product_list'); } elseif ($taxonomy == "portfolio_categories") { $start_page = get_option('rttheme_portf_page'); } //get start page if ($start_page) { get_start_page($start_page); } $term = get_term_by('slug', $term_slug, $taxonomy); //parent terms if (is_object($term) && $term->parent) { echo term_parents($term->parent, ''); } //current term if (is_object($term) && $term->slug) { echo $delimiter . "<a href=\"" . get_term_link($term->slug, $taxonomy) . "\" title=\"" . $term->name . "\" >" . $term->name . "</a>"; } } //Pages if (is_page()) { //parent pages if ($post->post_parent) { page_parents($post->post_parent, ''); } //current page echo $delimiter . "" . $post->post_title; } elseif (is_single() && !is_attachment()) { // Get post type $post_type = get_post_type(); //Taxonomies if ($post_type == 'products' || $post_type == 'portfolio') { term_links(); //current page echo $delimiter . "<a href=\"" . get_permalink() . "\" title=\"" . get_the_title() . "\" >" . get_the_title() . "</a>"; } else { //Categories //start page $start_page = get_option('rttheme_blog_page'); //get start page if ($start_page) { get_start_page($start_page); } $category_id = get_the_category(); $category_id = $category_id[0]->cat_ID; //only one category can be show in the list - the first one echo $delimiter; if ($category_id) { echo get_category_parents($category_id, TRUE, $delimiter, FALSE); } echo $post->post_title; } //Category } elseif (is_category()) { //start page $start_page = get_option('rttheme_blog_page'); //get start page if ($start_page) { get_start_page($start_page); } echo $delimiter . "" . get_category_parents(get_query_var('cat'), TRUE, $delimiter, FALSE); //Taxonomy } elseif (is_tax()) { term_links(); } else { echo $delimiter . ""; wp_title(''); } echo $after; wp_reset_query(); }
/** * Core header file, invoked by the get_header() function * * @package Suffusion * @subpackage Templates */ global $suffusion_unified_options, $suffusion_interactive_text_fields, $suffusion_translatable_fields, $suffusion_skin_dependence, $suf_color_scheme; if (function_exists('icl_t')) { foreach ($suffusion_unified_options as $id => $value) { /** * Some strings are set interactively in the admin screens of Suffusion. If you have WPML installed, then there may be translations of such strings. * This code ensures that such translations are picked up, then the unified options array is rewritten so that subsequent calls can pick it up. */ if (function_exists('icl_t') && in_array($id, $suffusion_translatable_fields) && isset($suffusion_interactive_text_fields[$id])) { $value = wpml_t('suffusion-interactive', $suffusion_interactive_text_fields[$id] . "|" . $id, $value); } global ${$id}; ${$id} = $value; $suffusion_unified_options[$id] = $value; } } ?> <!DOCTYPE html> <!--[if IE 6]> <html id="ie6" <?php language_attributes(); ?> > <![endif]--> <!--[if IE 7]>
// hash -> number $hash_num = ord($hash[0]) + ord($hash[1]) + ord($hash[2]); // Calculate key $link_key = $hash_num % count($links); } $link = $links[$link_key]; // Print msg with json vars added echo $msg[0] . $link->url . $msg[1] . $link->name . $msg[2]; ?> </div> <?php $footer_right_area_type = theme_get_option('footer', 'footer_right_area_type'); switch ($footer_right_area_type) { case 'html': echo '<div id="footer_right_area">'; echo apply_filters('the_content', wpml_t(THEME_NAME, 'Footer Right Area Html Code', stripslashes(theme_get_option('footer', 'footer_right_area_html')))); echo '</div>'; break; case 'menu': wp_nav_menu(array('theme_location' => 'footer-menu', 'container' => 'nav', 'container_id' => 'footer_menu', 'fallback_cb' => '')); break; } ?> <div class="clearboth"></div> </div> </div> </footer> <?php if (theme_get_option('font', 'enable_cufon')) { theme_add_cufon_code_footer(); }
if (class_exists('Woocommerce') && (is_archive() || is_product())) { $woo_page_id = ""; $woo_page_id = is_woocommerce() ? woocommerce_get_page_id('shop') : $woo_page_id; // Use WooCommerce Shop Base page header background image for WooCommerce categories and tags also // If current page is a WooCommerce Product page use the Shop Base header background image for the product if there is not just for this one if (is_archive() || is_product() && !$header_background_image && !$header_text) { if ($woo_page_id) { $header_background_image = @get_post_meta($woo_page_id, THEMESLUG . "_header_background_image", true); $header_text = @get_post_meta($woo_page_id, THEMESLUG . "_header_text", true); } } } // if meta values are blank use default options if (!$header_background_image && !$header_text) { $header_background_image = @get_option(THEMESLUG . "_header_background_image"); $header_text = wpml_t(THEMESLUG, 'Free code space for advanced users ', get_option(THEMESLUG . "_header_text")); } } if (trim($header_text) || $header_background_image) { ?> <!-- sub page header--> <?php if ($info_bar) { ?> <div id="sub_page_header" class="content-<?php echo $post->ID; ?> <?php if (!$logo_container) { echo "no-logo-container";
</div> <!-- End row --> </div> <!-- End container --> </footer> <!-- End footer --> <?php } if (wt_get_option('footer', 'sub_footer')) { wt_theme_generator('wt_footerBottom', $post->ID); ?> <?php if (wt_get_option('footer', 'copyright')) { ?> <div id="copyright"> <p class="copyright"> <?php echo wpml_t(THEME_NAME, 'Copyright Footer Text', stripslashes(wt_get_option('footer', 'copyright'))); ?> </div> <?php } ?> <?php dynamic_sidebar(__('Footer Bottom Area', 'wt_admin')); ?> </div> <!-- End container --> </footer> <!-- End footerBottom --> <?php } ?> </div> <!-- End footerWrapper -->
<div id="site_description"><?php bloginfo('description'); ?> </div> <?php } } ?> </div> <?php } $top_area_type = theme_get_option('general', 'top_area_type'); switch ($top_area_type) { case 'html': if (theme_get_option('general', 'top_area_html')) { echo '<div id="top_area">'; echo apply_filters('the_content', wpml_t(THEME_NAME, 'Top Area Html Code', stripslashes(theme_get_option('general', 'top_area_html')))); echo '</div>'; } break; case 'wpml_flags': theme_generator('wpml_flags'); break; } ?> <?php theme_generator('menu'); ?> </div> </header>