function avada_add_search_to_main_nav($items, $args)
 {
     $ubermenu = false;
     if (function_exists('ubermenu_get_menu_instance_by_theme_location') && ubermenu_get_menu_instance_by_theme_location($args->theme_location)) {
         // disable woo cart on ubermenu navigations
         $ubermenu = true;
     }
     if ($ubermenu == false) {
         if ($args->theme_location == 'main_navigation' || $args->theme_location == 'sticky_navigation') {
             if (fusion_get_theme_option('main_nav_search_icon')) {
                 $items .= '<li class="fusion-custom-menu-item fusion-main-menu-search">';
                 $items .= '<a class="fusion-main-menu-icon"></a>';
                 $items .= '<div class="fusion-custom-menu-item-contents">';
                 $items .= get_search_form(false);
                 $items .= '</div>';
                 $items .= '</li>';
             }
         }
     }
     return $items;
 }
 /**
  * Return the post content, either excerpted or in full length
  * @param  string	$page_id		The id of the current page or post
  * @param  string 	$excerpt		Can be either 'blog' (for main blog page), 'portfolio' (for portfolio page template) or 'yes' (for shortcodes)
  * @param  integer	$excerpt_length Length of the excerpts
  * @param  boolean	$strip_html		Can be used by shortcodes for a custom strip html setting
  *
  * @return string Post content
  **/
 function fusion_get_post_content($page_id = '', $excerpt = 'blog', $excerpt_length = 55, $strip_html = FALSE)
 {
     $content_excerpted = FALSE;
     // Main blog page
     if ($excerpt == 'blog') {
         // Check if the content should be excerpted
         if (strtolower(fusion_get_theme_option('content_length')) == 'excerpt') {
             $content_excerpted = TRUE;
             // Get the excerpt length
             $excerpt_length = fusion_get_theme_option('excerpt_length_blog');
         }
         // Check if HTML should be stripped from contant
         if (fusion_get_theme_option('strip_html_excerpt')) {
             $strip_html = TRUE;
         }
         // Portfolio page templates
     } elseif ($excerpt == 'portfolio') {
         // Check if the content should be excerpted
         if (fusion_get_option('portfolio_content_length', 'portfolio_content_length', $page_id) == 'excerpt') {
             $content_excerpted = TRUE;
             // Determine the correct excerpt length
             if (fusion_get_page_option('portfolio_excerpt', $page_id)) {
                 $excerpt_length = fusion_get_page_option('portfolio_excerpt', $page_id);
             } else {
                 $excerpt_length = fusion_get_theme_option('excerpt_length_portfolio');
             }
         } else {
             if (!$page_id && fusion_get_theme_option('portfolio_content_length') == 'Excerpt') {
                 $content_excerpted = TRUE;
                 $excerpt_length = fusion_get_theme_option('excerpt_length_portfolio');
             }
         }
         // Check if HTML should be stripped from contant
         if (fusion_get_theme_option('portfolio_strip_html_excerpt')) {
             $strip_html = TRUE;
         }
         // Shortcodes
     } elseif ($excerpt == 'yes') {
         $content_excerpted = TRUE;
     }
     // Sermon specific additional content
     if ('wpfc_sermon' == get_post_type(get_the_ID())) {
         $sermon_content = '';
         $sermon_content .= avada_get_sermon_content(true);
         return $sermon_content;
     }
     // Return excerpted content
     if ($content_excerpted) {
         $stripped_content = fusion_get_post_content_excerpt($excerpt_length, $strip_html);
         return $stripped_content;
         // Return full content
     } else {
         ob_start();
         the_content();
         return ob_get_clean();
     }
 }
/**
 * Custom Excerpt function for Sermon Manager
 */
function avada_get_sermon_content($archive = false)
{
    global $post;
    $sermon_content = '';
    ob_start();
    ?>

	<p>
		<?php 
    _e('Date: ', 'Avada');
    wpfc_sermon_date(get_option('date_format'), '<span class="sermon_date">', '</span> ');
    echo the_terms($post->ID, 'wpfc_service_type', ' <span class="service_type">(', ' ', ')</span>');
    ?>
</p><p><?php 
    wpfc_sermon_meta('bible_passage', '<span class="bible_passage">' . __('Bible Text: ', 'Avada'), '</span> | ');
    echo the_terms($post->ID, 'wpfc_preacher', '<span class="preacher_name">', ', ', '</span>');
    echo the_terms($post->ID, 'wpfc_sermon_series', '<p><span class="sermon_series">' . __('Series: ', 'Aavada'), ' ', '</span></p>');
    ?>
	</p>

	<?php 
    if ($archive) {
        $sermonoptions = get_option('wpfc_options');
        if (isset($sermonoptions['archive_player']) == '1') {
            ?>
			<div class="wpfc_sermon cf">
				<?php 
            wpfc_sermon_files();
            ?>
			</div>
		<?php 
        }
    }
    ?>

	<?php 
    if (!$archive) {
        ?>

	<?php 
        wpfc_sermon_files();
        ?>

	<?php 
        wpfc_sermon_description();
        ?>

	<?php 
        wpfc_sermon_attachments();
        ?>

	<?php 
        echo the_terms($post->ID, 'wpfc_sermon_topics', '<p class="sermon_topics">' . __('Topics: ', 'sermon-manager'), ',', '', '</p>');
        ?>

	<?php 
    }
    $sermon_content = ob_get_clean();
    if ($archive) {
        $description = '';
        ob_start();
        wpfc_sermon_description();
        $description .= ob_get_clean();
        $excerpt_length = fusion_get_theme_option('excerpt_length_blog');
        $sermon_content .= Avada()->blog->get_content_stripped_and_excerpted($excerpt_length, $description);
    }
    return $sermon_content;
}
Exemple #4
0
 function avada_mobile_main_menu()
 {
     if (fusion_get_theme_option('header_position') != 'Top' || fusion_get_theme_option('header_layout') != 'v4' && fusion_get_theme_option('header_layout') != 'v5') {
         echo avada_modern_menu();
     }
     echo '<div class="fusion-mobile-nav-holder"></div>';
     if (has_nav_menu('sticky_navigation')) {
         echo '<div class="fusion-mobile-nav-holder fusion-mobile-sticky-nav-holder"></div>';
     }
 }
</td>
						<td class="help"><?php 
        echo '<a href="#" class="help_tip" data-tip="' . esc_attr__('The maximum number of variables your server can use for a single function to avoid overloads.', 'Avada') . '">[?]</a>';
        ?>
</td>
						<?php 
        $registered_navs = get_nav_menu_locations();
        $menu_items_count = array("0" => "0");
        foreach ($registered_navs as $handle => $registered_nav) {
            $menu = wp_get_nav_menu_object($registered_nav);
            if ($menu) {
                $menu_items_count[] = $menu->count;
            }
        }
        $max_items = max($menu_items_count);
        if (!fusion_get_theme_option('disable_megamenu')) {
            $required_input_vars = $max_items * 20;
        } else {
            $required_input_vars = ini_get('suhosin.request.max_vars');
        }
        ?>
						<td><?php 
        $max_input_vars = ini_get('suhosin.request.max_vars');
        $required_input_vars = $required_input_vars + (500 + 1000);
        if ($max_input_vars < $required_input_vars) {
            echo '<mark class="error">' . sprintf(__('%s - Recommended Value: %s.<br />Max input vars limitation will truncate POST data such as menus. See: <a href="%s" target="_blank">Increasing max input vars limit.</a>', 'Avada'), $max_input_vars, '<strong>' . ($required_input_vars + (500 + 1000)) . '</strong>', 'http://sevenspark.com/docs/ubermenu-3/faqs/menu-item-limit') . '</mark>';
        } else {
            echo '<mark class="yes">' . $max_input_vars . '</mark>';
        }
        ?>
</td>
Exemple #6
0
 /** Purge Varnish Cache **/
 public function purge_cache($url)
 {
     // Parse the URL for proxy proxies
     $p = parse_url($url);
     if (isset($p['query']) && $p['query'] == 'vhp=regex') {
         $pregex = '.*';
         $varnish_x_purgemethod = 'regex';
     } else {
         $pregex = '';
         $varnish_x_purgemethod = 'default';
     }
     // Build a varniship
     if (fusion_get_theme_option('cache_server_ip')) {
         $varniship = fusion_get_theme_option('cache_server_ip');
     } else {
         if (defined('VHP_VARNISH_IP') && VHP_VARNISH_IP != false) {
             $varniship = VHP_VARNISH_IP;
         } else {
             $varniship = get_option('vhp_varnish_ip');
         }
     }
     if (isset($p['path'])) {
         $path = $p['path'];
     } else {
         $path = '';
     }
     // If we made varniship, let it sail
     if (isset($varniship) && $varniship != null) {
         $purgeme = $varniship;
     } else {
         $purgeme = $p['host'];
     }
     wp_remote_request('http://' . $purgeme, array('method' => 'PURGE', 'headers' => array('host' => $p['host'], 'X-Purge-Method' => $varnish_x_purgemethod)));
 }
 /**
  * Return the post content, either excerpted or in full length
  * @param  string	$page_id		The id of the current page or post
  * @param  string 	$excerpt		Can be either 'blog' (for main blog page), 'portfolio' (for portfolio page template) or 'yes' (for shortcodes)
  * @param  integer	$excerpt_length Length of the excerpts
  * @param  boolean	$strip_html		Can be used by shortcodes for a custom strip html setting
  *
  * @return string Post content
  **/
 function fusion_get_post_content($page_id = '', $excerpt = 'blog', $excerpt_length = 55, $strip_html = FALSE)
 {
     global $smof_data;
     $content_excerpted = FALSE;
     // Main blog page
     if ($excerpt == 'blog') {
         // Check if the content should be excerpted
         if (strtolower(fusion_get_theme_option('content_length')) == 'excerpt') {
             $content_excerpted = TRUE;
             // Get the excerpt length
             $excerpt_length = fusion_get_theme_option('excerpt_length_blog');
         }
         // Check if HTML should be stripped from contant
         if (fusion_get_theme_option('strip_html_excerpt')) {
             $strip_html = TRUE;
         }
         // Portfolio page templates
     } elseif ($excerpt == 'portfolio') {
         // Check if the content should be excerpted
         if (fusion_get_option('portfolio_content_length', 'portfolio_content_length', $page_id) == 'excerpt') {
             $content_excerpted = TRUE;
             // Determine the correct excerpt length
             if (fusion_get_page_option('portfolio_excerpt', $page_id)) {
                 $excerpt_length = fusion_get_page_option('portfolio_excerpt', $page_id);
             } else {
                 $excerpt_length = fusion_get_theme_option('excerpt_length_portfolio');
             }
         }
         // Check if HTML should be stripped from contant
         if (fusion_get_theme_option('portfolio_strip_html_excerpt')) {
             $strip_html = TRUE;
         }
         // Shortcodes
     } elseif ($excerpt == 'yes') {
         $content_excerpted = TRUE;
     }
     // Return excerpted content
     if ($content_excerpted) {
         $stripped_content = fusion_get_post_content_excerpt($excerpt_length, $strip_html);
         return $stripped_content;
         // Return full content
     } else {
         ob_start();
         the_content();
         return ob_get_clean();
     }
 }