/** * * Constructor that sets the grid variables * */ function avia_responsive_mega_menu($options = array()) { $this->grid_array = array(1 => "three units", 2 => "six units", 3 => "nine units", 4 => "twelve units", 5 => "twelve units", 6 => "twelve units"); $this->top_menu = avia_get_option('header_position', 'header_top') == 'header_top' ? true : false; if (isset($options['megamenu']) && $options['megamenu'] == "disabled") { $this->mega_allowed = false; } }
function portfolio_register() { global $avia_config; $labels = array('name' => _x('Portfolio Items', 'post type general name', 'avia_framework'), 'singular_name' => _x('Portfolio Entry', 'post type singular name', 'avia_framework'), 'add_new' => _x('Add New', 'portfolio', 'avia_framework'), 'add_new_item' => __('Add New Portfolio Entry', 'avia_framework'), 'edit_item' => __('Edit Portfolio Entry', 'avia_framework'), 'new_item' => __('New Portfolio Entry', 'avia_framework'), 'view_item' => __('View Portfolio Entry', 'avia_framework'), 'search_items' => __('Search Portfolio Entries', 'avia_framework'), 'not_found' => __('No Portfolio Entries found', 'avia_framework'), 'not_found_in_trash' => __('No Portfolio Entries found in Trash', 'avia_framework'), 'parent_item_colon' => ''); $slugRule = avia_get_option('portfolio-slug'); $args = array('labels' => $labels, 'public' => true, 'show_ui' => true, 'capability_type' => 'post', 'hierarchical' => false, 'rewrite' => array('slug' => $slugRule, 'with_front' => true), 'query_var' => true, 'show_in_nav_menus' => true, 'taxonomies' => array('post_tag'), 'supports' => array('title', 'thumbnail', 'excerpt', 'editor', 'comments')); $avia_config['custom_post']['portfolio']['args'] = $args; register_post_type('portfolio', $args); register_taxonomy("portfolio_entries", array("portfolio"), array("hierarchical" => true, "label" => "Portfolio Categories", "singular_label" => "Portfolio Categories", "rewrite" => true, "query_var" => true)); }
/** * Create the config array for the shortcode button */ function shortcode_insert_button() { $this->api_key = avia_get_option('mailchimp_api'); $this->config['name'] = __('Mailchimp Signup', 'avia_framework'); $this->config['tab'] = __('Content Elements', 'avia_framework'); $this->config['icon'] = AviaBuilder::$path['imagesURL'] . "sc-contact.png"; $this->config['order'] = 10; $this->config['target'] = 'avia-target-insert'; $this->config['shortcode'] = 'av_mailchimp'; $this->config['shortcode_nested'] = array('av_mailchimp_field'); $this->config['tooltip'] = __('Creates a mailschimp signup form', 'avia_framework'); }
<!-- ####### END FOOTER CONTAINER ####### --> </div> <?php } //endif nofooterwidgets ?> <?php //copyright $copyright = do_shortcode(avia_get_option('copyright', "© " . __('Copyright', 'avia_framework') . " - <a href='" . home_url('/') . "'>" . get_bloginfo('name') . "</a>")); // you can filter and remove the backlink with an add_filter function // from your themes (or child themes) functions.php file if you dont want to edit this file // you can also just keep that link. I really do appreciate it ;) $kriesi_at_backlink = kriesi_backlink(get_option(THEMENAMECLEAN . "_initial_version")); //you can also remove the kriesi.at backlink by adding [nolink] to your custom copyright field in the admin area if ($copyright && strpos($copyright, '[nolink]') !== false) { $kriesi_at_backlink = ""; $copyright = str_replace("[nolink]", "", $copyright); } if ($footer_widget_setting != 'nosocket') { ?> <footer class='container_wrap socket_color' id='socket' <?php avia_markup_helper(array('context' => 'footer')); ?>
/** * checks which page we are viewing and if the page got a custom widget */ function avia_check_custom_widget($area, $return = 'title') { $special_id_string = ""; if ($area == 'page') { $id_array = avia_get_option('widget_pages'); } else { if ($area == 'cat') { $id_array = avia_get_option('widget_categories'); } else { if ($area == 'dynamic_template') { global $avia; $dynamic_widgets = array(); foreach ($avia->options as $option_parent) { foreach ($option_parent as $element_data) { if (isset($element_data[0]) && is_array($element_data) && in_array('widget', $element_data[0])) { for ($i = 1; $i <= $element_data[0]['dynamic_column_count']; $i++) { if ($element_data[0]['dynamic_column_content_' . $i] == 'widget') { $dynamic_widgets[] = $element_data[0]['dynamic_column_content_' . $i . '_widget']; } } } } } return $dynamic_widgets; } } } //first build the id string if (is_array($id_array)) { foreach ($id_array as $special) { if (isset($special['widget_' . $area]) && $special['widget_' . $area] != "") { $special_id_string .= $special['widget_' . $area] . ","; } } } //if we got a valid string remove the last comma $special_id_string = trim($special_id_string, ','); $clean_id_array = explode(',', $special_id_string); //if we dont want the title just return the id array if ($return != 'title') { return $clean_id_array; } if (is_page($clean_id_array)) { return get_the_title(); } else { if (is_category($clean_id_array)) { return single_cat_title("", false); } } }
function avia_woocommerce_cart_placement() { $position = avia_get_option('header_position', 'header_top') == "header_top" ? "ava_main_header" : "ava_inside_main_menu"; add_action($position, 'avia_woocommerce_cart_dropdown', 10); }
function avia_backend_admin_bar_menu() { if (!current_user_can('manage_options')) { return; } global $avia, $wp_admin_bar; $real_id = is_admin() ? false : avia_get_the_ID(); //home edit button for frontpage if (is_front_page()) { $front_id = avia_get_option('frontpage'); $parent = ""; if ($front_id && $real_id == $front_id) { $menu = array('id' => 'edit', 'title' => __('Edit Frontpage', 'avia_framework'), 'href' => admin_url('post.php?post=' . $real_id . '&action=edit'), 'meta' => array('target' => 'blank')); $wp_admin_bar->add_menu($menu); } } //dynamic tempalte edit for current entry, in case a dynamic tempalte is applied if ($real_id && ($template = avia_is_dynamic_template())) { $safeSlug = avia_backend_safe_string($template); $menu = array('id' => 'avia_edit', 'title' => __('Edit this entry', 'avia_framework'), 'href' => admin_url('post.php?post=' . $real_id . '&action=edit'), 'meta' => array('target' => 'blank'), 'parent' => 'edit'); $wp_admin_bar->add_menu($menu); $menu = array('id' => 'avia_edit_dynamic', 'title' => __('Edit Dynamic Template of this entry', 'avia_framework'), 'href' => admin_url("admin.php?page=templates#goto_" . $safeSlug), 'meta' => array('target' => 'blank'), 'parent' => 'edit'); $wp_admin_bar->add_menu($menu); } // add all option pages if (empty($avia->option_pages)) { return; } $urlBase = admin_url('admin.php'); foreach ($avia->option_pages as $avia_page) { $safeSlug = avia_backend_safe_string($avia_page['title']); $menu = array('id' => $avia_page['slug'], 'title' => strip_tags($avia_page['title']), 'href' => $urlBase . "?page=" . $avia_page['slug'], 'meta' => array('target' => 'blank')); if ($avia_page['slug'] != $avia_page['parent']) { $menu['parent'] = $avia_page['parent']; $menu['href'] = $urlBase . "?page=" . $avia_page['parent'] . "#goto_" . $avia_page['slug']; } if (is_admin()) { $menu['meta'] = array('onclick' => 'self.location.replace(encodeURI("' . $menu['href'] . '")); window.location.reload(true); '); } $wp_admin_bar->add_menu($menu); } }
public static function backend_html() { $username = trim(avia_get_option('updates_username')); $apikey = trim(avia_get_option('updates_api_key')); $output = ""; $version = self::get_version(); $themename = self::get_themename(); $parent_string = is_child_theme() ? "Parent Theme (" . ucfirst($themename) . ")" : "Theme"; silverwp_debug_var($themename); silverwp_debug_var($apikey); if (empty($username) || empty($apikey)) { $output = "<div class='avia_backend_theme_updates'><h3>Theme Updates</h3>"; $output .= "Once you have entered and saved your Username and API Key WordPress will check for updates every 12 Hours and notify you here, if one is available <br/><br/> Your current " . $parent_string . " Version Number is <strong>" . $version . "</strong></div>"; echo $output; } else { if ($update = self::check_for_theme_update()) { $target = network_admin_url('update-core.php?action=do-theme-upgrade'); $new = $update['new_version']; //$themename = 'Platform'; //testing theme ob_start(); wp_nonce_field('upgrade-core'); $nonce = ob_get_clean(); $output = "<div class='avia_backend_theme_updates'>"; $output .= "<h3>Update Available!</h3>"; $output .= "A new Version (" . $new . ") of your " . $parent_string . " is available! You are using Version " . $version . ". <br/>Do you want to update?<br/><br/>"; //$output .= ""; $output .= '<span class="avia_style_wrap"><a href="#" data-avia-popup="avia-tmpl-theme-update" class="avia_button">Update Now!</a></span></div>'; $form = '<form method="post" action="' . $target . '" name="upgrade-themes" class="upgrade"> <input type="hidden" name="checked[]" value="' . $themename . '" /> ' . $nonce . ' <input type="hidden" name="_wp_http_referer" value="/wp-admin/update-core.php?action=do-theme-upgrade" /> <p> <strong>Attention: Any modifications made to the <u>Theme Files</u> will be lost when updating. If you did change any files (Custom CSS rules or PHP file modifications for example) make sure to create a theme backup.</strong><br/><br/>Your backend settings, posts and pages wont be affected by the update.<br/> </p> <p class="avia-popup-button-container"> <input id="upgrade-themes" class="button" type="submit" value="Update Theme" name="upgrade"/> <input id="upgrade-themes-close" class="button button-2nd script-close-avia-popup" type="submit" value="Don\'t Update" name="close"/> </p> </form>'; $output .= "<script type='text/html' id='avia-tmpl-theme-update'>\n{$form}\n</script>\n\n"; } else { $target = network_admin_url('update-core.php?force-check=1'); $output = "<div class='avia_backend_theme_updates'><h3>Theme Updates</h3>"; $output .= "No Updates available. You are running the latest version! ({$version})"; $output .= "<br/><br/> <a href='{$target}'>Check Manually</a> </div>"; } } return $output; }
echo avia_title(array('title' => avia_which_archive())); ?> <div class='container_wrap main_color <?php avia_layout_class('main'); ?> '> <div class='container template-blog '> <div class='content <?php avia_layout_class('content'); ?> units'> <?php if (avia_get_option('blog_style', 'multi-big') == 'blog-grid') { global $posts; $post_ids = array(); foreach ($posts as $post) { $post_ids[] = $post->ID; } $atts = array('type' => 'grid', 'items' => get_option('posts_per_page'), 'columns' => 3, 'class' => 'avia-builder-el-no-sibling', 'paginate' => 'yes', 'use_main_query_pagination' => 'yes', 'custom_query' => array('post__in' => $post_ids, 'post_type' => get_post_types())); $blog = new avia_post_slider($atts); $blog->query_entries(); echo "<div class='entry-content'>" . $blog->html() . "</div>"; } else { /* Run the loop to output the posts. * If you want to overload this in a child theme then include a file * called loop-index.php and that will be used instead. */ $more = 0;
/** * @see Walker::start_el() * * @param string $output Passed by reference. Used to append additional content. * @param object $item Menu item data object. * @param int $depth Depth of menu item. Used for padding. * @param int $current_page Menu item ID. * @param object $args */ function start_el(&$output, $item, $depth = 0, $args = array(), $current_object_id = 0) { global $wp_query; //set maxcolumns if (!isset($args->max_columns)) { $args->max_columns = 6; } $item = apply_filters('avf_menu_items', $item); $item_output = $li_text_block_class = $column_class = ""; if ($depth === 0) { $this->first_level_count++; $this->mega_active = get_post_meta($item->ID, '_menu-item-avia-megamenu', true); $style = get_post_meta($item->ID, '_menu-item-avia-style', true); } if ($depth === 1 && $this->mega_active && $this->mega_allowed) { $this->columns++; //check if we have more than $args['max_columns'] columns or if the user wants to start a new row if ($this->columns > $args->max_columns || get_post_meta($item->ID, '_menu-item-avia-division', true) && $this->columns != 1) { $this->columns = 1; $this->rows++; $output .= "\n</ul><ul class=\"sub-menu avia_mega_hr\">\n"; $output = str_replace("{last_item}", "avia_mega_menu_columns_last", $output); } else { $output = str_replace("{last_item}", "", $output); } $this->rowsCounter[$this->rows] = $this->columns; if ($this->max_columns < $this->columns) { $this->max_columns = $this->columns; } $title = apply_filters('the_title', $item->title, $item->ID); if ($title != "–" && trim($title) != "-" && $title != '"-"') { $heading_title = do_shortcode($title); if (!empty($item->url) && $item->url != "#" && $item->url != 'http://') { $heading_title = "<a href='" . $item->url . "'>{$title}</a>"; } $item_output .= "<span class='mega_menu_title heading-color av-special-font'>" . $heading_title . "</span>"; } $column_class = ' {current_row_' . $this->rows . '} {last_item}'; if ($this->columns == 1) { $column_class .= " avia_mega_menu_columns_first"; } } else { if ($depth >= 2 && $this->mega_active && $this->mega_allowed && get_post_meta($item->ID, '_menu-item-avia-textarea', true)) { $li_text_block_class = 'avia_mega_text_block '; $item_output .= do_shortcode($item->post_content); } else { $attributes = !empty($item->attr_title) ? ' title="' . esc_attr($item->attr_title) . '"' : ''; $attributes .= !empty($item->target) ? ' target="' . esc_attr($item->target) . '"' : ''; $attributes .= !empty($item->xfn) ? ' rel="' . esc_attr($item->xfn) . '"' : ''; $attributes .= !empty($item->url) ? ' href="' . esc_attr($item->url) . '"' : ''; if ('inactive' != avia_get_option('markup')) { $attributes .= ' itemprop="url"'; } $item_output .= $args->before; $item_output .= '<a' . $attributes . '><span class="avia-bullet"></span>'; $item_output .= $args->link_before . '<span class="avia-menu-text">' . do_shortcode(apply_filters('the_title', $item->title, $item->ID)) . "</span>" . $args->link_after; if ($depth === 0) { if (!$this->top_menu && !empty($item->description)) { $item_output .= '<span class="avia-menu-subtext">' . do_shortcode($item->description) . "</span>"; } $item_output .= '<span class="avia-menu-fx"><span class="avia-arrow-wrap"><span class="avia-arrow"></span></span></span>'; } $item_output .= '</a>'; $item_output .= $args->after; } } $class_names = $value = ''; $indent = $depth ? str_repeat("\t", $depth) : ''; $classes = empty($item->classes) ? array() : (array) $item->classes; if (isset($style)) { $classes[] = $style; } if ($depth === 0 && ($key = array_search('current-menu-item', $classes))) { if ($this->active_item) { unset($classes[$key]); } else { $this->active_item = true; } } $class_names = join(' ', apply_filters('nav_menu_css_class', array_filter($classes), $item)); if ($depth === 0 && $this->mega_active && $this->mega_allowed) { $class_names .= " menu-item-mega-parent "; } if ($depth === 0) { $class_names .= " menu-item-top-level menu-item-top-level-" . $this->first_level_count; } //highlight correct blog page if ($depth === 0 && $this->blog_id && $this->blog_id == $item->object_id && is_singular('post')) { $class_names .= " current-menu-item"; } $class_names = ' class="' . $li_text_block_class . esc_attr($class_names) . $column_class . '"'; $output .= $indent . '<li id="menu-item-' . $item->ID . '"' . $value . $class_names . '>'; $output .= apply_filters('walker_nav_menu_start_el', $item_output, $item, $depth, $args); }
<?php global $avia_config, $post_loop_count; if (empty($post_loop_count)) { $post_loop_count = 1; } $blog_style = !empty($avia_config['blog_style']) ? $avia_config['blog_style'] : avia_get_option('blog_style', 'multi-big'); if (is_single()) { $blog_style = avia_get_option('single_post_style', 'single-big'); } $blog_content = !empty($avia_config['blog_content']) ? $avia_config['blog_content'] : "content"; // check if we got posts to display: if (have_posts()) { while (have_posts()) { the_post(); /* * get the current post id, the current post class and current post format */ $current_post = array(); $current_post['post_loop_count'] = $post_loop_count; $current_post['the_id'] = get_the_ID(); $current_post['parity'] = $post_loop_count % 2 ? 'odd' : 'even'; $current_post['last'] = count($wp_query->posts) == $post_loop_count ? " post-entry-last " : ""; $current_post['post_class'] = "post-entry-" . $current_post['the_id'] . " post-loop-" . $post_loop_count . " post-parity-" . $current_post['parity'] . $current_post['last'] . " " . $blog_style; $current_post['post_format'] = get_post_format() ? get_post_format() : 'standard'; /* * retrieve slider, title and content for this post,... */ $size = strpos($blog_style, 'big') ? strpos(avia_layout_class('main', false), 'sidebar') ? 'entry_with_sidebar' : 'entry_without_sidebar' : 'square'; if (!empty($avia_config['preview_mode']) && !empty($avia_config['image_size']) && $avia_config['preview_mode'] == 'custom') { $size = $avia_config['image_size'];
break; case '.socket_color': $output .= "\n\n\t\t\thtml, #scroll-top-link{ background-color: {$bg}; }\n\t\t\t#scroll-top-link{ color: {$color}; border:1px solid {$border}; }\n\t\t\t\n\t\t\t.html_stretched #wrap_all{\n\t\t\tbackground-color:{$bg};\n\t\t\t}\n\t\t\t"; break; } //unset all vars with the help of variable vars :) foreach ($colors as $key => $val) { unset(${$key}); } } //filter to plug in, in case a plugin/extension/config file wants to make use of it $output = apply_filters('avia_dynamic_css_output', $output, $color_set); ###################################################################### # DYNAMIC ICONFONT CHARACTERS ###################################################################### //forum topic icons $output .= "\n.bbp-topics .bbp-body .bbp-topic-title:before{ " . av_icon_css_string('one_voice') . " }\n.bbp-topics .bbp-body .topic-voices-multi .bbp-topic-title:before { " . av_icon_css_string('multi_voice') . " }\n.bbp-topics .bbp-body .super-sticky .bbp-topic-title:before { " . av_icon_css_string('supersticky') . " }\n.bbp-topics .bbp-body .sticky .bbp-topic-title:before { " . av_icon_css_string('sticky') . " }\n.bbp-topics .bbp-body .status-closed .bbp-topic-title:before { " . av_icon_css_string('closed') . " }\n.bbp-topics .bbp-body .super-sticky.status-closed .bbp-topic-title:before{ " . av_icon_css_string('supersticky_closed') . " }\n.bbp-topics .bbp-body .sticky.status-closed .bbp-topic-title:before{ " . av_icon_css_string('sticky_closed') . " }\n"; //layerslider nav icons $output .= "\n#top .avia-layerslider .ls-nav-prev:before{ " . av_icon_css_string('prev_big') . " }\n#top .avia-layerslider .ls-nav-next:before{ " . av_icon_css_string('next_big') . " }\n#top .avia-layerslider .ls-nav-start:before, #top .avia_playpause_icon.av-play:before{ " . av_icon_css_string('play') . " }\n#top .avia-layerslider .ls-nav-stop:before, #top .avia_playpause_icon.av-pause:before{ " . av_icon_css_string('pause') . " }\n"; //image hover overlay icons $output .= "\n.image-overlay .image-overlay-inside:before{ " . av_icon_css_string('ov_image') . " }\n.image-overlay.overlay-type-extern .image-overlay-inside:before{ " . av_icon_css_string('ov_external') . " }\n.image-overlay.overlay-type-video .image-overlay-inside:before{ " . av_icon_css_string('ov_video') . " }\n"; //lightbox next/prev icons $output .= "\ndiv.avia-popup button.mfp-arrow:before\t\t{ " . av_icon_css_string('next_big') . " }\ndiv.avia-popup button.mfp-arrow-left:before { " . av_icon_css_string('prev_big') . "}\n"; ###################################################################### # OUTPUT THE DYNAMIC CSS RULES ###################################################################### //compress output $output = preg_replace('/\\r|\\n|\\t/', '', $output); //todo: if the style are generated for the wordpress header call the generating script, otherwise create a simple css file and link to that file $avia_config['style'] = array(array('key' => 'direct_input', 'value' => $output), array('key' => 'direct_input', 'value' => ".html_header_transparency #top .avia-builder-el-0 .container, .html_header_transparency #top .avia-builder-el-0 .slideshow_inner_caption{padding-top:" . avia_get_header_scroll_offset() . "px;}"), array('elements' => 'h1, h2, h3, h4, h5, h6, #top .title_container .main-title, tr.pricing-row td, #top .portfolio-title, .callout .content-area, .avia-big-box .avia-innerbox, .av-special-font, .av-current-sort-title', 'key' => 'google_webfont', 'value' => avia_get_option('google_webfont')), array('elements' => 'body', 'key' => 'google_webfont', 'value' => avia_get_option('default_font')), array('key' => 'direct_input', 'value' => avia_get_option('quick_css'))); do_action('ava_generate_styles', $options, $color_set, $styles);
<div class='container'> <?php /* * display the themes social media icons, defined in the wordpress backend * the avia_social_media_icons function is located in includes/helper-social-media-php */ if (strpos($headerS, 'bottom_nav_header') === false) { avia_social_media_icons($social_args); } //display the small submenu echo "<div class='sub_menu'>"; $args = array('theme_location' => 'avia2', 'fallback_cb' => '', 'container' => '', 'echo' => false); $nav = wp_nav_menu($args); echo $nav; $phone = avia_get_option('phone'); $phone_class = !empty($nav) ? "with_nav" : ""; if ($phone) { echo "<div class='phone-info {$phone_class}'><span>{$phone}</span></div>"; } /* * Hook that can be used for plugins and theme extensions (currently: the wpml language selector) */ do_action('avia_meta_header'); echo "</div>"; ?> </div> </div> <?php }
<main class='content <?php avia_layout_class('content'); ?> units' <?php avia_markup_helper(array('context' => 'content', 'post_type' => 'post')); ?> > <div class="category-term-description"> <?php echo term_description(); ?> </div> <?php $avia_config['blog_style'] = apply_filters('avf_blog_style', avia_get_option('blog_style', 'multi-big'), 'archive'); if ($avia_config['blog_style'] == 'blog-grid') { global $posts; $post_ids = array(); foreach ($posts as $post) { $post_ids[] = $post->ID; } if (!empty($post_ids)) { $atts = array('type' => 'grid', 'items' => get_option('posts_per_page'), 'columns' => 3, 'class' => 'avia-builder-el-no-sibling', 'paginate' => 'yes', 'use_main_query_pagination' => 'yes', 'custom_query' => array('post__in' => $post_ids, 'post_type' => get_post_types())); $blog = new avia_post_slider($atts); $blog->query_entries(); echo "<div class='entry-content-wrapper'>" . $blog->html() . "</div>"; } else { get_template_part('includes/loop', 'index'); } } else {
<?php global $avia_config, $post_loop_count; if (empty($post_loop_count)) { $post_loop_count = 1; } $blog_style = !empty($avia_config['blog_style']) ? $avia_config['blog_style'] : avia_get_option('blog_style', 'multi-big'); if (is_single()) { $blog_style = avia_get_option('single_post_style', 'single-big'); } $blog_global_style = avia_get_option('blog_global_style', ''); //alt: elegant-blog $initial_id = avia_get_the_ID(); // check if we got posts to display: if (have_posts()) { while (have_posts()) { the_post(); /* * get the current post id, the current post class and current post format */ $url = ""; $current_post = array(); $current_post['post_loop_count'] = $post_loop_count; $current_post['the_id'] = get_the_ID(); $current_post['parity'] = $post_loop_count % 2 ? 'odd' : 'even'; $current_post['last'] = count($wp_query->posts) == $post_loop_count ? " post-entry-last " : ""; $current_post['post_type'] = get_post_type($current_post['the_id']); $current_post['post_class'] = "post-entry-" . $current_post['the_id'] . " post-loop-" . $post_loop_count . " post-parity-" . $current_post['parity'] . $current_post['last'] . " " . $blog_style; $current_post['post_class'] .= $current_post['post_type'] == "post" ? '' : ' post'; $current_post['post_format'] = get_post_format() ? get_post_format() : 'standard'; $current_post['post_layout'] = avia_layout_class('main', false);
<?php global $avia_config, $post_loop_count; if (empty($post_loop_count)) { $post_loop_count = 1; } $blog_style = !empty($avia_config['blog_style']) ? $avia_config['blog_style'] : avia_get_option('blog_style', 'multi-big'); $blog_content = !empty($avia_config['blog_content']) ? $avia_config['blog_content'] : "content"; // check if we got posts to display: if (have_posts()) { while (have_posts()) { the_post(); /* * get the current post id, the current post class and current post format */ $the_id = get_the_ID(); $parity = $post_loop_count % 2 ? 'odd' : 'even'; $last = count($wp_query->posts) == $post_loop_count ? " post-entry-last " : ""; $post_class = "post-entry-" . $the_id . " post-loop-" . $post_loop_count . " post-parity-" . $parity . $last . " " . $blog_style; $post_format = get_post_format() ? get_post_format() : 'standard'; /* * retrieve slider, title and content for this post,... */ $size = strpos($blog_style, 'big') ? strpos(avia_layout_class('main', false), 'sidebar') ? 'entry_with_sidebar' : 'entry_without_sidebar' : 'square'; if (!empty($avia_config['preview_mode']) && !empty($avia_config['image_size']) && $avia_config['preview_mode'] == 'custom') { $size = $avia_config['image_size']; } $current_post['slider'] = get_the_post_thumbnail($the_id, $size); $current_post['title'] = get_the_title(); $current_post['content'] = $blog_content == "content" ? get_the_content(__('Read more', 'avia_framework') . '<span class="more-link-arrow"> →</span>') : get_the_excerpt(); $current_post['content'] = $blog_content == "excerpt_read_more" ? $current_post['content'] . '<div class="read-more-link"><a href="' . get_permalink() . '" class="more-link">' . __('Read more', 'avia_framework') . '<span class="more-link-arrow"> →</span></a></div>' : $current_post['content'];
function create_wizard_styles() { if (empty($this->stylewizardIDs)) { return; } global $avia_config; foreach ($this->stylewizardIDs as $id) { $options = avia_get_option($id); if (empty($options)) { continue; } foreach ($options as $style) { if (empty($this->stylewizard[$style['id']]['selector'])) { continue; } //first of all we need to build the selector string $selectorArray = $this->stylewizard[$style['id']]['selector']; $sectionCheck = $this->stylewizard[$style['id']]['sections']; foreach ($selectorArray as $selector => $ruleset) { $temp_selector = ""; $rules = ""; $sectionActive = strpos($selector, '[sections]') !== false ? true : false; //hover check if (isset($style['hover_active']) && $style['hover_active'] != 'disabled') { $selector = str_replace("[hover]", ":hover", $selector); } else { $selector = str_replace("[hover]", "", $selector); } //if sections are enabled make sure that the selector string gets generated for each section if ($sectionActive && $sectionCheck && isset($avia_config['color_sets'])) { foreach ($avia_config['color_sets'] as $key => $name) { if (isset($style[$key]) && $style[$key] != 'disabled') { if (!empty($temp_selector)) { $temp_selector .= ", "; } $temp_selector .= str_replace("[sections]", "." . $key, $selector); } } if (empty($temp_selector)) { continue; } } //apply modified rules to the selector if (!empty($temp_selector)) { $selector = $temp_selector; } //we got the selector stored in $selector, now we need to generate the rules foreach ($style as $key => $value) { if ($value != "" && $value != "true" && $value != "disabled" && $key != "id") { if (is_array($ruleset)) { foreach ($ruleset as $rule_key => $rule_val) { if ($rule_key == $key) { $rules .= str_replace("%{$key}%", $value, $rule_val); } } } else { $key = str_replace('_', '-', $key); switch ($key) { case "font-family": $font = explode(':', $value); $font_family = $font[0]; $font_size = isset($font[1]) ? $font[1] : ""; $this->add_google_font($font_family, $font_size); $rules .= "font-family:'{$font_family}', 'Helvetica Neue', Helvetica, Arial, sans-serif;"; break; default: $rules .= "{$key}:{$value};"; break; } } } } if (!empty($rules)) { $this->output .= $selector . '{' . $rules . '}'; } } } } }
register_sidebar(array('name' => 'Sidebar Blog', 'before_widget' => '<section id="%1$s" class="widget clearfix %2$s">', 'after_widget' => '<span class="seperator extralight-border"></span></section>', 'before_title' => '<h3 class="widgettitle">', 'after_title' => '</h3>')); } foreach ($sidebars_to_show as $sidebar) { register_sidebar(array('name' => 'Sidebar Pages', 'before_widget' => '<section id="%1$s" class="widget clearfix %2$s">', 'after_widget' => '<span class="seperator extralight-border"></span></section>', 'before_title' => '<h3 class="widgettitle">', 'after_title' => '</h3>')); } if (class_exists('woocommerce')) { foreach ($sidebars_to_show as $sidebar) { register_sidebar(array('name' => 'Shop Overview Page', 'before_widget' => '<section id="%1$s" class="widget clearfix %2$s">', 'after_widget' => '<span class="seperator extralight-border"></span></section>', 'before_title' => '<h3 class="widgettitle">', 'after_title' => '</h3>')); } foreach ($sidebars_to_show as $sidebar) { register_sidebar(array('name' => 'Single Product Pages', 'before_widget' => '<section id="%1$s" class="widget clearfix %2$s">', 'after_widget' => '<span class="seperator extralight-border"></span></section>', 'before_title' => '<h3 class="widgettitle">', 'after_title' => '</h3>')); } } //dynamic widgets #footer $footer_columns = avia_get_option('footer_columns', '5'); for ($i = 1; $i <= $footer_columns; $i++) { register_sidebar(array('name' => 'Footer - column' . $i, 'before_widget' => '<section id="%1$s" class="widget clearfix %2$s">', 'after_widget' => '<span class="seperator extralight-border"></span></section>', 'before_title' => '<h3 class="widgettitle">', 'after_title' => '</h3>')); } //dummy widgets function avia_dummy_widget($number) { switch ($number) { case 1: $title = apply_filters('widget_title', __('Interesting links', 'avia_framework')); ?> <section class='widget'> <h3 class='widgettitle'><?php echo $title; ?> </h3>
case '.footer_color': $output .= "\n\n\t\t\t#footer .widgettitle{ color: {$meta}; }\n\n\t\t\t"; break; case '.socket_color': $output .= "\n\n\t\t\thtml, #scroll-top-link{ background-color: {$bg}; }\n\t\t\t#scroll-top-link{ color: {$color}; border:1px solid {$border}; }\n\t\t\t"; break; } //unset all vars with the help of variable vars :) foreach ($colors as $key => $val) { unset(${$key}); } } //filter to plug in, in case a plugin/extension/config file wants to make use of it $output = apply_filters('avia_dynamic_css_output', $output, $color_set); ###################################################################### # DYNAMIC ICONFONT CHARACTERS ###################################################################### //forum topic icons $output .= "\n.bbp-topics .bbp-body .bbp-topic-title:before{ " . av_icon_css_string('one_voice') . " }\n.bbp-topics .bbp-body .topic-voices-multi .bbp-topic-title:before { " . av_icon_css_string('multi_voice') . " }\n.bbp-topics .bbp-body .super-sticky .bbp-topic-title:before { " . av_icon_css_string('supersticky') . " }\n.bbp-topics .bbp-body .sticky .bbp-topic-title:before { " . av_icon_css_string('sticky') . " }\n.bbp-topics .bbp-body .status-closed .bbp-topic-title:before { " . av_icon_css_string('closed') . " }\n.bbp-topics .bbp-body .super-sticky.status-closed .bbp-topic-title:before{ " . av_icon_css_string('supersticky_closed') . " }\n.bbp-topics .bbp-body .sticky.status-closed .bbp-topic-title:before{ " . av_icon_css_string('sticky_closed') . " }\n"; //layerslider nav icons $output .= "\n#top .avia-layerslider .ls-nav-prev:before{ " . av_icon_css_string('prev_big') . " }\n#top .avia-layerslider .ls-nav-next:before{ " . av_icon_css_string('next_big') . " }\n#top .avia-layerslider .ls-nav-start:before, #top .avia_playpause_icon.av-play:before{ " . av_icon_css_string('play') . " }\n#top .avia-layerslider .ls-nav-stop:before, #top .avia_playpause_icon.av-pause:before{ " . av_icon_css_string('pause') . " }\n"; //image hover overlay icons $output .= "\n.image-overlay .image-overlay-inside:before{ " . av_icon_css_string('ov_image') . " }\n.image-overlay.overlay-type-extern .image-overlay-inside:before{ " . av_icon_css_string('ov_external') . " }\n.image-overlay.overlay-type-video .image-overlay-inside:before{ " . av_icon_css_string('ov_video') . " }\n"; ###################################################################### # OUTPUT THE DYNAMIC CSS RULES ###################################################################### //compress output $output = preg_replace('/\\r|\\n|\\t/', '', $output); //todo: if the style are generated for the wordpress header call the generating script, otherwise create a simple css file and link to that file $avia_config['style'] = array(array('key' => 'direct_input', 'value' => $output), array('key' => 'direct_input', 'value' => avia_get_option('quick_css')), array('elements' => 'h1, h2, h3, h4, h5, h6, #top .title_container .main-title, tr.pricing-row td, #top .portfolio-title, .callout .content-area, .avia-big-box .avia-innerbox, .av-special-font', 'key' => 'google_webfont', 'value' => avia_get_option('google_webfont')), array('elements' => 'body', 'key' => 'google_webfont', 'value' => avia_get_option('default_font')));
/** * This function display the content of a html post or page. by default the current entry is displayed. * * @param array $element is an array with all the data necessary for creating the html code (it contains the element data and the saved values for the element) * @uses avia_slideshow * @return string $output the string returned contains the html code generated within the method */ function post_page($element) { extract($element['saved_value'][0]); $output = ""; switch ($dynamic_which_post_page) { case 'post': $query_id = $dynamic_post_id; $type = 'post'; break; case 'page': $query_id = $dynamic_page_id; $type = 'page'; break; case 'self': $query_id = $this->post_id; $type = get_post_type($this->post_id); break; } $query_post = array('p' => $query_id, 'posts_per_page' => 1, 'post_type' => $type); $additional_loop = new WP_Query($query_post); if ($additional_loop->have_posts()) { $output .= "<div class='post-entry post-entry-dynamic '>"; $output .= "<div class='entry-content'>"; while ($additional_loop->have_posts()) { $additional_loop->the_post(); if ($dynamic_which_post_page != 'self' && $query_id != $this->post_id) { global $more; $more = 0; } if ($dynamic_which_post_page_title == 'yes') { $output .= "<h1 class='post-title'>" . get_the_title() . "</h1>"; } if (!$additional_loop->post->post_excerpt || $query_id == $this->post_id) { $content = get_the_content('<span class="inner_more">' . __('Read more →', 'avia_framework') . '</span>'); $content = apply_filters('the_content', $content); $content = str_replace(']]>', ']]>', $content); } else { $content = apply_filters('the_excerpt', get_the_excerpt()); $content .= '<p><a class="more-link" href="' . get_permalink() . '"><span class="inner_more">' . __('Read more →', 'avia_framework') . '</span></a></p>'; } $output .= $content; $contact_page_id = avia_get_option('email_page'); //wpml prepared if (function_exists('icl_object_id')) { $contact_page_id = icl_object_id($contact_page_id, 'page', true); } if ($contact_page_id == $query_id) { ob_start(); get_template_part('includes/contact-form'); $output .= ob_get_contents(); ob_end_clean(); } } $output .= "</div></div>"; } wp_reset_query(); return $output; }
<?php global $avia_config; /* * get_header is a basic wordpress function, used to retrieve the header.php file in your theme directory. */ get_header(); $title = __('Blog - Latest News', 'avia_framework'); //default blog title $t_link = home_url('/'); $t_sub = ""; if (avia_get_option('frontpage') && ($new = avia_get_option('blogpage'))) { $title = get_the_title($new); //if the blog is attached to a page use this title $t_link = get_permalink($new); $t_sub = avia_post_meta($new, 'subtitle'); } if (get_post_meta(get_the_ID(), 'header', true) != 'no') { echo avia_title(array('heading' => 'strong', 'title' => $title, 'link' => $t_link, 'subtitle' => $t_sub)); } ?> <div class='container_wrap container_wrap_first main_color <?php avia_layout_class('main'); ?> '> <div class='container template-blog template-single-blog '> <main class='content units <?php avia_layout_class('content');
function avia_woocommerce_cart_dropdown() { global $woocommerce, $avia_config; $cart_subtotal = $woocommerce->cart->get_cart_subtotal(); $link = $woocommerce->cart->get_cart_url(); $id = ""; $added = wc_get_notices('success'); $trigger = !empty($added) ? "av-display-cart-on-load" : ""; if (avia_get_option('cart_icon') == "always_display_menu") { $id = 'id="menu-item-shop"'; } $output = ""; $output .= "<ul {$id} class = 'cart_dropdown {$trigger}' data-success='" . __('was added to the cart', 'avia_framework') . "'><li class='cart_dropdown_first'>"; $output .= "<a class='cart_dropdown_link' href='" . $link . "'><span " . av_icon_string('cart') . "></span><span class='av-cart-counter'>0</span><span class='avia_hidden_link_text'>" . __('Shopping Cart', 'avia_framework') . "</span></a><!--<span class='cart_subtotal'>" . $cart_subtotal . "</span>-->"; $output .= "<div class='dropdown_widget dropdown_widget_cart'><div class='avia-arrow'></div>"; $output .= '<div class="widget_shopping_cart_content"></div>'; $output .= "</div>"; $output .= "</li></ul>"; echo $output; }
public function html() { global $avia_config; $output = ""; if (empty($this->entries) || empty($this->entries->posts)) { return $output; } avia_post_slider::$slide++; extract($this->atts); if ($preview_mode == 'auto') { $image_size = 'portfolio'; } $extraClass = 'first'; $grid = 'one_third'; $post_loop_count = 1; $loop_counter = 1; $autoplay = $autoplay == "no" ? false : true; $total = $columns % 2 ? "odd" : "even"; $blogstyle = function_exists('avia_get_option') ? avia_get_option('blog_global_style', '') : ""; $excerpt_length = 60; if ($blogstyle !== "") { $excerpt_length = 240; } switch ($columns) { case "1": $grid = 'av_fullwidth'; if ($preview_mode == 'auto') { $image_size = 'large'; } break; case "2": $grid = 'av_one_half'; break; case "3": $grid = 'av_one_third'; break; case "4": $grid = 'av_one_fourth'; if ($preview_mode == 'auto') { $image_size = 'portfolio_small'; } break; case "5": $grid = 'av_one_fifth'; if ($preview_mode == 'auto') { $image_size = 'portfolio_small'; } break; } $data = AviaHelper::create_data_string(array('autoplay' => $autoplay, 'interval' => $interval, 'animation' => $animation, 'show_slide_delay' => 90)); $thumb_fallback = ""; $markup = avia_markup_helper(array('context' => 'blog', 'echo' => false, 'custom_markup' => $custom_markup)); $output .= "<div {$data} class='avia-content-slider avia-content-{$type}-active avia-content-slider" . avia_post_slider::$slide . " avia-content-slider-{$total} {$class}' {$markup}>"; $output .= "<div class='avia-content-slider-inner'>"; foreach ($this->entries->posts as $entry) { $the_id = $entry->ID; $parity = $loop_counter % 2 ? 'odd' : 'even'; $last = $this->entries->post_count == $post_loop_count ? " post-entry-last " : ""; $post_class = "post-entry post-entry-{$the_id} slide-entry-overview slide-loop-{$post_loop_count} slide-parity-{$parity} {$last}"; $link = get_permalink($the_id); $excerpt = ""; $title = ''; $show_meta = !is_post_type_hierarchical($entry->post_type); $commentCount = get_comments_number($the_id); $thumbnail = get_the_post_thumbnail($the_id, $image_size); $format = get_post_format($the_id); if (empty($format)) { $format = "standard"; } if ($thumbnail) { $thumb_fallback = $thumbnail; $thumb_class = "real-thumbnail"; } else { $thumbnail = "<span class=' fallback-post-type-icon' " . av_icon_string($format) . "></span><span class='slider-fallback-image'>{{thumbnail}}</span>"; $thumb_class = "fake-thumbnail"; } $permalink = '<div class="read-more-link"><a href="' . get_permalink($the_id) . '" class="more-link">' . __('Read more', 'avia_framework') . '<span class="more-link-arrow"> →</span></a></div>'; $prepare_excerpt = !empty($entry->post_excerpt) ? $entry->post_excerpt : avia_backend_truncate($entry->post_content, apply_filters('avf_postgrid_excerpt_length', $excerpt_length), apply_filters('avf_postgrid_excerpt_delimiter', " "), "…", true, ''); if ($format == 'link') { $current_post = array(); $current_post['content'] = $entry->post_content; $current_post['title'] = $entry->post_title; if (function_exists('avia_link_content_filter')) { $current_post = avia_link_content_filter($current_post); } $link = $current_post['url']; } switch ($contents) { case "excerpt": $excerpt = $prepare_excerpt; $title = $entry->post_title; break; case "excerpt_read_more": $excerpt = $prepare_excerpt; $excerpt .= $permalink; $title = $entry->post_title; break; case "title": $excerpt = ''; $title = $entry->post_title; break; case "title_read_more": $excerpt = $permalink; $title = $entry->post_title; break; case "only_excerpt": $excerpt = $prepare_excerpt; $title = ''; break; case "only_excerpt_read_more": $excerpt = $prepare_excerpt; $excerpt .= $permalink; $title = ''; break; case "no": $excerpt = ''; $title = ''; break; } if ($loop_counter == 1) { $output .= "<div class='slide-entry-wrap'>"; } $post_format = get_post_format($the_id) ? get_post_format($the_id) : 'standard'; $markup = avia_markup_helper(array('context' => 'entry', 'echo' => false, 'id' => $the_id, 'custom_markup' => $custom_markup)); $output .= "<article class='slide-entry flex_column {$style} {$post_class} {$grid} {$extraClass} {$thumb_class}' {$markup}>"; $output .= $thumbnail ? "<a href='{$link}' data-rel='slide-" . avia_post_slider::$slide . "' class='slide-image' title=''>{$thumbnail}</a>" : ""; if ($post_format == "audio") { $current_post = array(); $current_post['content'] = $entry->post_content; $current_post['title'] = $entry->post_title; $current_post = apply_filters('post-format-' . $post_format, $current_post); if (!empty($current_post['before_content'])) { $output .= '<div class="big-preview single-big audio-preview">' . $current_post['before_content'] . '</div>'; } } $output .= "<div class='slide-content'>"; $markup = avia_markup_helper(array('context' => 'entry_title', 'echo' => false, 'id' => $the_id, 'custom_markup' => $custom_markup)); $output .= '<header class="entry-content-header">'; if (!empty($title)) { if ($show_meta) { $taxonomies = get_object_taxonomies(get_post_type($the_id)); $cats = ''; $excluded_taxonomies = array_merge(get_taxonomies(array('public' => false)), array('post_tag', 'post_format')); $excluded_taxonomies = apply_filters('avf_exclude_taxonomies', $excluded_taxonomies, get_post_type($the_id), $the_id); if (!empty($taxonomies)) { foreach ($taxonomies as $taxonomy) { if (!in_array($taxonomy, $excluded_taxonomies)) { $cats .= get_the_term_list($the_id, $taxonomy, '', ', ', '') . ' '; } } } if (!empty($cats)) { $output .= '<span class="blog-categories minor-meta">'; $output .= $cats; $output .= '</span>'; } } $output .= "<h3 class='slide-entry-title entry-title' {$markup}><a href='{$link}' title='" . esc_attr(strip_tags($title)) . "'>" . $title . "</a></h3>"; $output .= '<span class="av-vertical-delimiter"></span>'; } $output .= '</header>'; if ($show_meta && !empty($excerpt)) { $meta = "<div class='slide-meta'>"; if ($commentCount != "0" || comments_open($the_id) && $entry->post_type != 'portfolio') { $link_add = $commentCount === "0" ? "#respond" : "#comments"; $text_add = $commentCount === "1" ? __('Comment', 'avia_framework') : __('Comments', 'avia_framework'); $meta .= "<div class='slide-meta-comments'><a href='{$link}{$link_add}'>{$commentCount} {$text_add}</a></div><div class='slide-meta-del'>/</div>"; } $markup = avia_markup_helper(array('context' => 'entry_time', 'echo' => false, 'id' => $the_id, 'custom_markup' => $custom_markup)); $meta .= "<time class='slide-meta-time updated' {$markup}>" . get_the_time(get_option('date_format'), $the_id) . "</time>"; $meta .= "</div>"; if ($blogstyle !== "elegant-blog") { $output .= $meta; $meta = ""; } } $markup = avia_markup_helper(array('context' => 'entry_content', 'echo' => false, 'id' => $the_id, 'custom_markup' => $custom_markup)); $excerpt = apply_filters('avf_post_slider_entry_excerpt', $excerpt, $prepare_excerpt, $permalink, $entry); $output .= !empty($excerpt) ? "<div class='slide-entry-excerpt entry-content' {$markup}>" . $excerpt . "</div>" : ""; $output .= "</div>"; $output .= '<footer class="entry-footer">'; if (!empty($meta)) { $output .= $meta; } $output .= '</footer>'; $output .= "</article>"; $loop_counter++; $post_loop_count++; $extraClass = ""; if ($loop_counter > $columns) { $loop_counter = 1; $extraClass = 'first'; } if ($loop_counter == 1 || !empty($last)) { $output .= "</div>"; } } $output .= "</div>"; if ($post_loop_count - 1 > $columns && $type == 'slider') { $output .= $this->slide_navigation_arrows(); } if ($use_main_query_pagination == 'yes' && $paginate == "yes") { global $wp_query; $avia_pagination = avia_pagination($wp_query->max_num_pages, 'nav'); } else { if ($paginate == "yes") { $avia_pagination = avia_pagination($this->entries->max_num_pages, 'nav'); } } if (!empty($avia_pagination)) { $output .= "<div class='pagination-wrap pagination-slider'>{$avia_pagination}</div>"; } $output .= "</div>"; $output = str_replace('{{thumbnail}}', $thumb_fallback, $output); wp_reset_query(); return $output; }
function avia_sidebar_menu($echo = true) { $sidebar_menu = ""; $subNav = avia_get_option('page_nesting_nav'); $the_id = @get_the_ID(); $args = array(); global $post; if ($subNav && $subNav != 'disabled' && !empty($the_id) && is_page()) { $subNav = false; $parent = $post->ID; $sidebar_menu = ""; if (!empty($post->post_parent)) { if (isset($post->ancestors)) { $ancestors = $post->ancestors; } if (!isset($ancestors)) { $ancestors = get_post_ancestors($post->ID); } $root = count($ancestors) - 1; $parent = $ancestors[$root]; } $args = array('title_li' => '', 'child_of' => $parent, 'echo' => 0, 'sort_column' => 'menu_order, post_title'); //enables user to change query args $args = apply_filters('avia_sidebar_menu_args', $args, $post); //hide or show child pages in menu - if the class is set to 'widget_nav_hide_child' the child pages will be hidden $display_child_pages = apply_filters('avia_sidebar_menu_display_child', 'widget_nav_hide_child', $args, $post); $children = wp_list_pages($args); if ($children) { $default_sidebar = false; $sidebar_menu .= "<nav class='widget widget_nav_menu {$display_child_pages}'><ul class='nested_nav'>"; $sidebar_menu .= $children; $sidebar_menu .= "</ul></nav>"; } } $sidebar_menu = apply_filters('avf_sidebar_menu_filter', $sidebar_menu, $args, $post); if ($echo == true) { echo $sidebar_menu; } else { return $sidebar_menu; } }
function avia_disable_alb_drag_drop($disable) { if (!current_user_can('switch_themes') || avia_get_option('lock_alb_for_admins', 'disabled') != "disabled") { $disable = avia_get_option('lock_alb', 'disabled') != "disabled" ? true : false; } return $disable; }
function avia_set_layout_array($post_type = false, $post_id = false) { global $avia_config; //check which string to use $result = false; $layout = 'blog_layout'; if (empty($post_id)) { $post_id = avia_get_the_ID(); } if (is_page() || is_search() || is_404() || is_attachment()) { $layout = 'page_layout'; } if (is_archive()) { $layout = 'archive_layout'; } if (is_single()) { $layout = 'single_layout'; } //on a single page check if the layout is overwritten if (is_singular()) { $result = get_post_meta($post_id, 'layout', true); } //if we got no result from the previous get_pst_meta query or we are not on a single post get the setting defined on the option page if (!$result) { $result = avia_get_option($layout); } //if we stil got no result, probably because no option page was saved if (!$result) { $result = 'sidebar_right'; } if ($result) { $avia_config['layout']['current'] = $avia_config['layout'][$result]; $avia_config['layout']['current']['main'] = $result; } $avia_config['layout'] = apply_filters('avia_layout_filter', $avia_config['layout'], $post_id); }
function form($instance) { //widgetform in backend $instance = wp_parse_args((array) $instance, array('rss' => avia_get_option('feedburner'), 'twitter' => avia_get_option('twitter'))); $twitter = empty($instance['twitter']) ? '' : strip_tags($instance['twitter']); $rss = empty($instance['rss']) ? '' : strip_tags($instance['rss']); ?> <p> <label for="<?php echo $this->get_field_id('twitter'); ?> ">Twitter Username: <input class="widefat" id="<?php echo $this->get_field_id('twitter'); ?> " name="<?php echo $this->get_field_name('twitter'); ?> " type="text" value="<?php echo esc_attr($twitter); ?> " /></label></p> <p><label for="<?php echo $this->get_field_id('rss'); ?> ">Enter your feed url: <input class="widefat" id="<?php echo $this->get_field_id('rss'); ?> " name="<?php echo $this->get_field_name('rss'); ?> " type="text" value="<?php echo esc_attr($rss); ?> " /></label></p> <?php }
function __construct($args = array(), $options = false) { $default_arguments = array('facebook' => array("encode" => true, "encode_urls" => false, "pattern" => "http://www.facebook.com/sharer.php?u=[permalink]&t=[title]"), 'twitter' => array("encode" => true, "encode_urls" => false, "pattern" => "http://twitter.com/home?status=[title]%20[shortlink]"), 'gplus' => array("encode" => true, "encode_urls" => false, "pattern" => "https://plus.google.com/share?url=[permalink]", 'label' => __("Share on Google+", 'avia_framework')), 'pinterest' => array("encode" => true, "encode_urls" => true, "pattern" => "http://pinterest.com/pin/create/button/?url=[permalink]&description=[title]&media=[thumbnail]"), 'linkedin' => array("encode" => true, "encode_urls" => false, "pattern" => "http://linkedin.com/shareArticle?mini=true&url=[permalink]&title=[title]"), 'tumblr' => array("encode" => true, "encode_urls" => true, "pattern" => "http://www.tumblr.com/share/link?url=[permalink]&name=[title]&description=[excerpt]"), 'vk' => array("encode" => true, "encode_urls" => false, "pattern" => "http://vk.com/share.php?url=[permalink]"), 'reddit' => array("encode" => true, "encode_urls" => false, "pattern" => "http://reddit.com/submit?url=[permalink]&title=[title]"), 'mail' => array("encode" => true, "encode_urls" => false, "pattern" => "mailto:?subject=[title]&body=[permalink]", 'label' => __("Share by Mail", 'avia_framework'))); $this->args = array_merge($default_arguments, apply_filters('avia_social_share_link_arguments', $args)); if (empty($options)) { $options = avia_get_option(); } $this->options = $options; $this->build_share_links(); }
static function set_video_slide($video_url, $service = false, $meta = false) { $video = ""; if (empty($service)) { $service = self::which_video_service($video_url); } $uid = 'player_' . get_the_ID() . '_' . mt_rand() . '_' . mt_rand(); $controls = empty($meta['video_controls']) ? 1 : 0; $loop = empty($meta['video_loop']) ? 0 : 1; switch ($service) { case "html5": $video = "<div class='av-click-overlay'></div>" . avia_html5_video_embed($video_url); break; case "iframe": $video = $video_url; break; case "youtube": $explode_at = strpos($video_url, 'youtu.be/') !== false ? "/" : "v="; $video_url = explode($explode_at, trim($video_url)); $video_url = end($video_url); $video_id = $video_url; //if parameters are appended make sure to create the correct video id if (strpos($video_url, '?') !== false || strpos($video_url, '?') !== false) { preg_match('!(.+)[&?]!', $video_url, $video_id); $video_id = isset($video_id[1]) ? $video_id[1] : $video_id[0]; } $video_data = apply_filters('avf_youtube_video_data', array('autoplay' => 0, 'videoid' => $video_id, 'hd' => 1, 'rel' => 0, 'wmode' => 'opaque', 'playlist' => $uid, 'loop' => 0, 'version' => 3, 'autohide' => 1, 'color' => 'white', 'controls' => $controls, 'showinfo' => 0)); $data = AviaHelper::create_data_string($video_data); $video = "<div class='av-click-overlay'></div><div class='mejs-mediaelement'><div height='1600' width='900' class='av_youtube_frame' id='{$uid}' {$data}></div></div>"; break; case "vimeo": $color = ltrim(avia_get_option('colorset-main_color-primary'), '#'); $autopause = empty($meta['video_section_bg']) ? 1 : 0; //pause if another vimeo video plays? $video_url = explode('/', trim($video_url)); $video_url = end($video_url); $video_url = add_query_arg(array('portrait' => 0, 'byline' => 0, 'title' => 0, 'badge' => 0, 'loop' => $loop, 'autopause' => $autopause, 'api' => 1, 'rel' => 0, 'player_id' => $uid, 'color' => $color), 'http://player.vimeo.com/video/' . $video_url); $video_url = apply_filters('avf_vimeo_video_url', $video_url); $video = "<div class='av-click-overlay'></div><div class='mejs-mediaelement'><iframe src='{$video_url}' height='1600' width='900' frameborder='' class='av_vimeo_frame' id='{$uid}'></iframe></div>"; break; } return $video; }
?> </title> <?php /* * outputs a rel=follow or nofollow tag to circumvent google duplicate content for archives * located in framework/php/function-set-avia-frontend.php */ if (function_exists('avia_set_follow')) { echo avia_set_follow(); } /* * outputs a favicon if defined */ if (function_exists('avia_favicon')) { echo avia_favicon(avia_get_option('favicon')); } ?> <!-- mobile setting --> <?php if (strpos($responsive, 'responsive') !== false) { echo '<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">'; } ?> <!-- Scripts/CSS and wp_head hook --> <?php /* Always have wp_head() just before the closing </head>