コード例 #1
0
 function vw_custom_tiled_gallery($null, $attr = array())
 {
     global $post, $wp_locale;
     static $instance = 0;
     $instance++;
     extract(shortcode_atts(array('order' => 'ASC', 'orderby' => 'menu_order ID', 'id' => $post->ID, 'itemtag' => 'figure', 'captiontag' => 'figcaption', 'columns' => 3, 'size' => VW_CONST_THUMBNAIL_SIZE_CUSTOM_TILED_GALLERY, 'include' => '', 'exclude' => ''), $attr));
     $id = intval($id);
     if ('RAND' == $order) {
         $orderby = 'none';
     }
     if (!empty($include)) {
         $include = preg_replace('/[^0-9,]+/', '', $include);
         $_attachments = get_posts(array('include' => $include, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $order, 'orderby' => $orderby));
         $attachments = array();
         foreach ($_attachments as $key => $val) {
             $attachments[$val->ID] = $_attachments[$key];
         }
     } elseif (!empty($exclude)) {
         $exclude = preg_replace('/[^0-9,]+/', '', $exclude);
         $attachments = get_children(array('post_parent' => $id, 'exclude' => $exclude, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $order, 'orderby' => $orderby));
     } else {
         $attachments = get_children(array('post_parent' => $id, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $order, 'orderby' => $orderby));
     }
     if (empty($attachments)) {
         return '';
     }
     if (is_feed()) {
         $output = "\n";
         foreach ($attachments as $att_id => $attachment) {
             $output .= wp_get_attachment_link($att_id, $size, true) . "\n";
         }
         return $output;
     }
     $itemtag = tag_escape($itemtag);
     $captiontag = tag_escape($captiontag);
     $float = is_rtl() ? 'right' : 'left';
     $gallery_layout = vw_get_theme_option('blog_custom_gallery_layout', '213');
     $output = "<div id='gallery-{$instance}' class='vw-custom-tiled-gallery galleryid-{$id} clearfix' data-gallery-layout='{$gallery_layout}'>";
     if ($itemtag != '' && $captiontag != '') {
         $i = 1;
         foreach ($attachments as $id => $attachment) {
             $link = isset($attr['link']) && 'file' == $attr['link'] ? wp_get_attachment_link($id, $size, false, false) : wp_get_attachment_link($id, $size, false, false);
             $link = str_replace('<a', '<a title="' . esc_attr(wp_strip_all_tags($attachment->post_excerpt)) . '" ', $link);
             $output .= "<{$itemtag} class='gallery-item'>";
             $output .= "{$link}";
             if ($captiontag && trim($attachment->post_excerpt)) {
                 $output .= "\r\r\n\t\t\t\t\t<{$captiontag} class='gallery-caption'>\r\r\n\t\t\t\t\t" . wptexturize($attachment->post_excerpt) . "\r\r\n\t\t\t\t\t</{$captiontag}>";
             }
             $output .= "</{$itemtag}>";
             $i++;
         }
     }
     $output .= "</div>\n";
     return $output;
 }
コード例 #2
0
ファイル: enqueue.php プロジェクト: mathewhtc/cats-old
 function vw_enqueue_scripts()
 {
     wp_enqueue_script('jquery');
     wp_enqueue_script('jquery-ui-tabs');
     wp_enqueue_script('jquery-effects-fade');
     if (is_singular() && comments_open() && get_option('thread_comments')) {
         wp_enqueue_script('comment-reply');
     }
     wp_enqueue_script('vwjs-jquery-easing');
     wp_enqueue_script('vwjs-hoverintent');
     wp_enqueue_script('vwjs-fitvids');
     wp_enqueue_script('vwjs-backstretch');
     wp_enqueue_script('vwjs-flexslider');
     wp_enqueue_script('vwjs-swipebox');
     wp_enqueue_style('vwcss-swipebox');
     if (vw_get_theme_option('site_enable_sticky_menu')) {
         wp_enqueue_script('vwjs-sticky');
     }
     wp_enqueue_script('vwjs-img-liquid');
     wp_enqueue_script('vwjs-debouncer');
     wp_enqueue_script('vwjs-raty');
     wp_enqueue_script('vwjs-newsticker');
     wp_enqueue_script('vwjs-main');
     wp_localize_script('vwjs-main', 'vw_main_js', array('theme_path' => get_template_directory_uri()));
     wp_enqueue_style('vwcss-icon-entypo');
     wp_enqueue_style('vwcss-icon-social');
     if (vw_get_theme_option('icon_elusive')) {
         wp_enqueue_style('vwcss-icon-elusive');
     }
     if (vw_get_theme_option('icon_awesome')) {
         wp_enqueue_style('vwcss-icon-awesome');
     }
     if (vw_get_theme_option('icon_iconic')) {
         wp_enqueue_style('vwcss-icon-iconic');
     }
     if (vw_get_theme_option('icon_typicons')) {
         wp_enqueue_style('vwcss-icon-typicons');
     }
     wp_enqueue_style('vwcss-animate');
     wp_enqueue_style('vwcss-bootstrap');
     if (is_rtl()) {
         if (class_exists('bbpress')) {
             wp_enqueue_style('vwcss-bbpress-rtl');
         }
         wp_enqueue_style('vwcss-flexslider-rtl');
         wp_enqueue_style('vwcss-theme-rtl');
     } else {
         wp_enqueue_style('vwcss-flexslider');
         if (is_child_theme()) {
             wp_enqueue_style('vwcss-theme-root');
         }
         wp_enqueue_style('vwcss-theme');
     }
 }
コード例 #3
0
ファイル: mega-menu.php プロジェクト: mathewhtc/cats-old
 function vw_main_menu_additional_items($content)
 {
     // Nav Logo
     $nav_logo_html = '';
     $nav_logo = vw_get_theme_option('nav_logo');
     if (!empty($nav_logo['url'])) {
         $nav_logo_html .= '<li class="vw-menu-additional-logo">';
         $nav_logo_html .= '<a href="' . home_url() . '">';
         $nav_logo_html .= '<img class="animated" src="' . $nav_logo['url'] . '" alt="' . get_bloginfo('name') . '">';
         $nav_logo_html .= '</a>';
         $nav_logo_html .= '</li>';
     }
     // Menu icons
     $menu_icons_html = '<li class="vw-menu-additional-icons">' . vw_get_the_menu_icons() . '</li>';
     return $nav_logo_html . $menu_icons_html;
 }
コード例 #4
0
ファイル: functions.php プロジェクト: mathewhtc/cats-old
 function vw_get_post_layout()
 {
     global $post;
     $post_layout = get_post_meta($post->ID, 'vw_post_layout', true);
     if ('site_default' == $post_layout) {
         $post_layout = vw_get_theme_option('blog_post_layout');
     }
     return $post_layout;
 }
コード例 #5
0
<div class="sidebar-inner">
	<?php 
dynamic_sidebar(vw_get_theme_option('buddypress_default_sidebar'));
?>

</div>
コード例 #6
0
<div class="sidebar-inner">
	<?php 
$sidebar = '';
if (is_product()) {
    $sidebar = vw_get_theme_option('woocommerce_product_sidebar');
} else {
    $sidebar = vw_get_theme_option('woocommerce_shop_sidebar');
}
dynamic_sidebar($sidebar);
?>

</div>
コード例 #7
0
ファイル: post-views.php プロジェクト: mathewhtc/cats-old
 function vw_ajax_count_post_views()
 {
     if (!vw_get_theme_option('blog_enable_post_views')) {
         return;
     }
     if (!empty($_GET['postviews_id'])) {
         $post_id = intval($_GET['postviews_id']);
         if ($post_id > 0) {
             $count = vw_count_post_views($post_id);
             echo $count;
         }
     }
     exit;
 }
コード例 #8
0
ファイル: template-tags.php プロジェクト: mathewhtc/cats-old
 function vw_the_site_social_profiles()
 {
     echo '<span class="vw-site-social-profile">';
     $url = vw_get_theme_option('social_delicious');
     if (!empty($url)) {
         printf('<a class="vw-site-social-profile-icon vw-site-social-delicious" href="%s" title="Delicious"><i class="icon-social-delicious"></i></a>', $url);
     }
     $url = vw_get_theme_option('social_digg');
     if (!empty($url)) {
         printf('<a class="vw-site-social-profile-icon vw-site-social-digg" href="%s" title="Digg"><i class="icon-social-digg"></i></a>', $url);
     }
     $url = vw_get_theme_option('social_dribbble');
     if (!empty($url)) {
         printf('<a class="vw-site-social-profile-icon vw-site-social-dribbble" href="%s" title="Dribbble"><i class="icon-social-dribbble"></i></a>', $url);
     }
     $url = vw_get_theme_option('social_facebook');
     if (!empty($url)) {
         printf('<a class="vw-site-social-profile-icon vw-site-social-facebook" href="%s" title="Facebook"><i class="icon-social-facebook"></i></a>', $url);
     }
     $url = vw_get_theme_option('social_flickr');
     if (!empty($url)) {
         printf('<a class="vw-site-social-profile-icon vw-site-social-flickr" href="%s" title="Flickr"><i class="icon-social-flickr"></i></a>', $url);
     }
     $url = vw_get_theme_option('social_forrst');
     if (!empty($url)) {
         printf('<a class="vw-site-social-profile-icon vw-site-social-forrst" href="%s" title="Forrst"><i class="icon-social-forrst"></i></a>', $url);
     }
     $url = vw_get_theme_option('social_github');
     if (!empty($url)) {
         printf('<a class="vw-site-social-profile-icon vw-site-social-github" href="%s" title="GitHub"><i class="icon-social-github"></i></a>', $url);
     }
     $url = vw_get_theme_option('social_googleplus');
     if (!empty($url)) {
         printf('<a class="vw-site-social-profile-icon vw-site-social-googleplus" href="%s" title="Google+"><i class="icon-social-gplus"></i></a>', $url);
     }
     $url = vw_get_theme_option('social_instagram');
     if (!empty($url)) {
         printf('<a class="vw-site-social-profile-icon vw-site-social-instagram" href="%s" title="Instagram"><i class="icon-social-instagram"></i></a>', $url);
     }
     $url = vw_get_theme_option('social_linkedin');
     if (!empty($url)) {
         printf('<a class="vw-site-social-profile-icon vw-site-social-linkedin" href="%s" title="LinkedIn"><i class="icon-social-linkedin"></i></a>', $url);
     }
     $url = vw_get_theme_option('social_lastfm');
     if (!empty($url)) {
         printf('<a class="vw-site-social-profile-icon vw-site-social-lastfm" href="%s" title="Last.fm"><i class="icon-social-lastfm"></i></a>', $url);
     }
     $url = vw_get_theme_option('social_pinterest');
     if (!empty($url)) {
         printf('<a class="vw-site-social-profile-icon vw-site-social-pinterest" href="%s" title="Pinterest"><i class="icon-social-pinterest"></i></a>', $url);
     }
     $url = vw_get_theme_option('social_rss');
     if (!empty($url)) {
         printf('<a class="vw-site-social-profile-icon vw-site-social-rss" href="%s" title="RSS"><i class="icon-social-rss"></i></a>', $url);
     }
     $url = vw_get_theme_option('social_skype');
     if (!empty($url)) {
         printf('<a class="vw-site-social-profile-icon vw-site-social-skype" href="%s" title="Skype"><i class="icon-social-skype"></i></a>', $url);
     }
     $url = vw_get_theme_option('social_tumblr');
     if (!empty($url)) {
         printf('<a class="vw-site-social-profile-icon vw-site-social-tumblr" href="%s" title="Tumblr"><i class="icon-social-tumblr"></i></a>', $url);
     }
     $url = vw_get_theme_option('social_twitter');
     if (!empty($url)) {
         printf('<a class="vw-site-social-profile-icon vw-site-social-twitter" href="%s" title="Twitter"><i class="icon-social-twitter"></i></a>', $url);
     }
     $url = vw_get_theme_option('social_vimeo');
     if (!empty($url)) {
         printf('<a class="vw-site-social-profile-icon vw-site-social-vimeo" href="%s" title="Vimeo"><i class="icon-social-vimeo"></i></a>', $url);
     }
     $url = vw_get_theme_option('social_yahoo');
     if (!empty($url)) {
         printf('<a class="vw-site-social-profile-icon vw-site-social-yahoo" href="%s" title="Yahoo"><i class="icon-social-yahoo"></i></a>', $url);
     }
     $url = vw_get_theme_option('social_youtube');
     if (!empty($url)) {
         printf('<a class="vw-site-social-profile-icon vw-site-social-youtube" href="%s" title="Youtube"><i class="icon-social-youtube"></i></a>', $url);
     }
     echo '</span>';
 }
コード例 #9
0
ファイル: shortcodes.php プロジェクト: mathewhtc/cats-old
    function vw_shortcode_logo($atts, $content = null)
    {
        $defaults = array('width' => '');
        extract(shortcode_atts($defaults, $atts));
        $site_logo = vw_get_theme_option('site_logo');
        $site_logo_2x = vw_get_theme_option('site_logo_2x');
        if (empty($site_logo['url'])) {
            return;
        }
        if (!empty($width)) {
            $site_logo['width'] = $width;
        }
        ob_start();
        ?>

		<div class="vw-logo-shortcode">
			<?php 
        if (!empty($site_logo_2x['url'])) {
            ?>
<img class="vw-site-logo-2x" src="<?php 
            echo $site_logo_2x['url'];
            ?>
" width="<?php 
            echo $site_logo['width'];
            ?>
" height="<?php 
            echo $site_logo['height'];
            ?>
" alt="<?php 
            bloginfo('name');
            ?>
"><?php 
        }
        ?>

			<img class="vw-site-logo" src="<?php 
        echo $site_logo['url'];
        ?>
" width="<?php 
        echo $site_logo['width'];
        ?>
" height="<?php 
        echo $site_logo['height'];
        ?>
" alt="<?php 
        bloginfo('name');
        ?>
">
		</div>
		<?php 
        return ob_get_clean();
    }
コード例 #10
0
ファイル: site-footer.php プロジェクト: mathewhtc/cats-old
<?php

$columns = explode(',', vw_get_theme_option('site_footer_layout'));
?>
<footer class="vw-site-footer vw-site-footer-style-default clearfix">
	<div class="container">
		<div class="row">
			<?php 
foreach ($columns as $i => $column_size) {
    $column_number = $i + 1;
    printf('<div class="vw-footer-sidebar vw-footer-sidebar-%s col-md-%s">', $column_number, $column_size);
    if (is_active_sidebar('footer-sidebar-' . $column_number)) {
        dynamic_sidebar('footer-sidebar-' . $column_number);
    } else {
        vw_show_no_widget_warning();
    }
    echo '</div>';
}
?>
		</div>
	</div>
</footer>
コード例 #11
0
ファイル: sidebar.php プロジェクト: mathewhtc/cats-old
<div class="sidebar-inner">
	<?php 
dynamic_sidebar(vw_get_theme_option('blog_default_sidebar'));
?>

</div>
コード例 #12
0
ファイル: 404.php プロジェクト: mathewhtc/cats-old
<?php

get_header();
?>

<div class="vw-page-wrapper clearfix">
	<div class="container">
		<div class="row">
			<div class="vw-page-content col-sm-12" role="main">

				<?php 
$page_404_id = vw_get_theme_option('site_404');
if (!empty($page_404_id)) {
    ?>
					<?php 
    $page_404 = get_post($page_404_id);
    echo apply_filters('the_content', $page_404->post_content);
    ?>

				<?php 
} else {
    ?>
					<div class="vw-404-text">404</div>
					<h1>That page doesn't exist!</h1>
					<p><?php 
    _e("The page you were looking for appears to have been moved, deleted or does not exist.", 'envirra');
    ?>
</p>

				<?php 
}
コード例 #13
0
<div class="vw-post-footer-section-custom-2">
	<?php 
echo do_shortcode(vw_get_theme_option('post_footer_section_custom_2'));
?>
</div>
コード例 #14
0
ファイル: custom-js.php プロジェクト: mathewhtc/cats-old
    function vw_render_default_flexslider()
    {
        ?>

		if ( $.flexslider ) {
			$( '.flexslider' ).flexslider({
				animation: "<?php 
        echo vw_get_theme_option('flexslider_animation');
        ?>
",
				easing: "<?php 
        echo vw_get_theme_option('flexslider_easing');
        ?>
",
				slideshow: <?php 
        echo vw_get_theme_option('flexslider_slideshow') ? 'true' : 'false';
        ?>
,
				slideshowSpeed: <?php 
        echo vw_get_theme_option('flexslider_slideshowspeed');
        ?>
,
				animationSpeed: <?php 
        echo vw_get_theme_option('flexslider_animationspeed');
        ?>
,
				randomize: <?php 
        echo vw_get_theme_option('flexslider_randomize') ? 'true' : 'false';
        ?>
,
				pauseOnHover: <?php 
        echo (bool) vw_get_theme_option('flexslider_pauseonhover') ? 'true' : 'false';
        ?>
,
				prevText: '',
				nextText: '',
				smoothHeight: <?php 
        echo (bool) vw_get_theme_option('flexslider_smooth_height') ? 'true' : 'false';
        ?>
,
			});
		}
	<?php 
    }
コード例 #15
0
ファイル: custom-css.php プロジェクト: mathewhtc/cats-old
 function vw_render_custom_css_option()
 {
     echo vw_get_theme_option('custom_css');
 }
コード例 #16
0
ファイル: custom-font.php プロジェクト: mathewhtc/cats-old
    function vw_render_custom_font()
    {
        ?>

		<style id="vw-custom-font" type="text/css">
			<?php 
        $font_url_format = "url( '%s' )";
        ?>

			<?php 
        $font1_urls = array();
        $custom_font1_ttf = vw_get_theme_option('custom_font1_ttf');
        if (!empty($custom_font1_ttf['url'])) {
            $font1_urls[] = sprintf($font_url_format, $custom_font1_ttf['url']);
        }
        $custom_font1_woff = vw_get_theme_option('custom_font1_woff');
        if (!empty($custom_font1_woff['url'])) {
            $font1_urls[] = sprintf($font_url_format, $custom_font1_woff['url']);
        }
        $custom_font1_svg = vw_get_theme_option('custom_font1_svg');
        if (!empty($custom_font1_svg['url'])) {
            $font1_urls[] = sprintf($font_url_format, $custom_font1_svg['url']);
        }
        $custom_font1_eot = vw_get_theme_option('custom_font1_eot');
        if (!empty($custom_font1_eot['url'])) {
            $font1_urls[] = sprintf($font_url_format, $custom_font1_eot['url']);
        }
        if (!empty($font1_urls)) {
            ?>

			@font-face {
				font-family: 'Custom Font 1';
				src: <?php 
            echo implode(",", $font1_urls);
            ?>
;
			}
			<?php 
        }
        ?>


			<?php 
        $font2_urls = array();
        $custom_font1_ttf = vw_get_theme_option('custom_font2_ttf');
        if (!empty($custom_font2_ttf['url'])) {
            $font2_urls[] = sprintf($font_url_format, $custom_font2_ttf['url']);
        }
        $custom_font2_woff = vw_get_theme_option('custom_font2_woff');
        if (!empty($custom_font2_woff['url'])) {
            $font2_urls[] = sprintf($font_url_format, $custom_font2_woff['url']);
        }
        $custom_font2_svg = vw_get_theme_option('custom_font2_svg');
        if (!empty($custom_font2_svg['url'])) {
            $font2_urls[] = sprintf($font_url_format, $custom_font2_svg['url']);
        }
        $custom_font2_eot = vw_get_theme_option('custom_font2_eot');
        if (!empty($custom_font2_eot['url'])) {
            $font2_urls[] = sprintf($font_url_format, $custom_font2_eot['url']);
        }
        if (!empty($font2_urls)) {
            ?>

			@font-face {
				font-family: 'Custom Font 2';
				src: <?php 
            echo implode(",", $font2_urls);
            ?>
;
			}
			<?php 
        }
        ?>

		</style>
		<?php 
    }
コード例 #17
0
ファイル: header-ads.php プロジェクト: mathewhtc/cats-old
<?php

$ads_banner = vw_get_theme_option('header_ads_banner');
$ads_leaderboard = vw_get_theme_option('header_ads_leaderboard');
if (empty($ads_banner) && empty($ads_leaderboard)) {
    return;
}
$single_ads_class = '';
if (empty($ads_banner) xor empty($ads_leaderboard)) {
    $single_ads_class = 'visible-xs visible-sm visible-md visible-lg';
}
?>
<div class="vw-header-ads-wrapper">

	<?php 
if (!empty($ads_banner)) {
    ?>
	<div class="vw-header-ads-leader-board visible-md visible-lg <?php 
    echo $single_ads_class;
    ?>
">
		<?php 
    echo $ads_banner;
    ?>
	</div>
	<?php 
}
?>

	<?php 
if (!empty($ads_leaderboard)) {
コード例 #18
0
ファイル: logo.php プロジェクト: mathewhtc/cats-old
<div class="vw-site-logo-wrapper">
	<a class="vw-site-logo-link" href="<?php 
echo home_url();
?>
">
		<?php 
$site_logo = vw_get_theme_option('site_logo');
?>
		<?php 
$site_logo_2x = vw_get_theme_option('site_logo_2x');
?>

		<!-- Site Logo -->
		<?php 
if (!empty($site_logo['url'])) {
    ?>

			<!-- Retina Site Logo -->
			<?php 
    if (!empty($site_logo_2x['url'])) {
        ?>
				<img class="vw-site-logo-2x" src="<?php 
        echo $site_logo_2x['url'];
        ?>
" width="<?php 
        echo $site_logo['width'];
        ?>
" height="<?php 
        echo $site_logo['height'];
        ?>
" alt="<?php 
コード例 #19
0
ファイル: related-posts.php プロジェクト: mathewhtc/cats-old
<div class="vw-related-posts vw-related-posts-style-default clearfix">
	<h3 class="vw-related-posts-title"><?php 
_e('Related Posts', 'envirra');
?>
</h3>

	<?php 
get_template_part('templates/post-box/post-layout', vw_get_theme_option('related_post_layout'));
?>

</div>
コード例 #20
0
ファイル: site-meta.php プロジェクト: mathewhtc/cats-old

<?php 
$fav_icon_ipad_url = vw_get_theme_option('fav_icon_ipad_url');
if (!empty($fav_icon_ipad_url['url'])) {
    ?>
<link rel="apple-touch-icon" sizes="72x72" href="<?php 
    echo esc_url($fav_icon_ipad_url['url']);
    ?>
"><?php 
}
?>


<?php 
$fav_icon_ipad_retina_url = vw_get_theme_option('fav_icon_ipad_retina_url');
if (!empty($fav_icon_ipad_retina_url['url'])) {
    ?>
<link rel="apple-touch-icon" sizes="144x144" href="<?php 
    echo esc_url($fav_icon_ipad_retina_url['url']);
    ?>
"><?php 
}
?>


<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
	<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7/html5shiv.min.js"></script>
	<script src="//cdnjs.cloudflare.com/ajax/libs/respond.js/1.3.0/respond.min.js"></script>
<![endif]-->
コード例 #21
0
ファイル: page.php プロジェクト: mathewhtc/cats-old
    ?>

						</div><!-- .entry-content -->

						<?php 
    wp_link_pages(array('before' => '<div class="vw-page-links"><span class="vw-page-links-title">' . __('Pages:', 'envirra') . '</span>', 'after' => '</div>', 'link_before' => '<span class="vw-page-link">', 'link_after' => '</span>'));
    ?>
						
					</article><!-- #post-## -->

				<?php 
}
?>

				<?php 
if (!vw_get_theme_option('page_force_disable_comments') && (comments_open() || get_comments_number())) {
    comments_template();
}
?>

			</div>

			<aside class="vw-page-sidebar col-md-4">

				<?php 
get_sidebar('page');
?>

			</aside>
		</div>
	</div>
コード例 #22
0
 function vw_init_facebook_open_graph()
 {
     if (vw_get_theme_option('site_enable_open_graph')) {
         vw_render_facebook_open_graph();
     }
 }