コード例 #1
0
ファイル: scripts.php プロジェクト: WeFoster/wefoster
/**
 * Enqueue scripts and stylesheets
 *
 * @since 1.0.0
 */
function wff_scripts()
{
    // Register path
    $path = get_template_directory_uri() . '/assets';
    // First let's remove the default BuddyPress CSS
    wp_deregister_style('bp-child-css');
    wp_deregister_style('bp-parent-css');
    wp_deregister_style('bp-legacy-css');
    // Enqueue our Main Stylesheet.
    wp_enqueue_style('wff_main', $path . '/css/main.css', false, '6ee17105aaae3sffd20bb56ee840e0cabcd');
    // Load our BuddyPress Stylesheet based on being active (on root or multiblog)
    if (class_exists('BuddyPress') && bp_is_root_blog() || class_exists('BuddyPress') && defined('BP_ENABLE_MULTIBLOG') || WEFOSTER_MS_LOAD_BUDDYPRESS_STYLES == 'on') {
        wp_enqueue_style('wff_buddypress', $path . '/css/buddypress.css', false, '9ad14980d2sd75af2ed431fe686bad3f0');
    }
    if (WEFOSTER_ICON_FONT == 'font-awesome') {
        // Enqueue Font Awesome
        wp_enqueue_style('wff_font_awesome', $path . '/css/font-awesome.css', false, '6ee17s105aaae3sffd20bb56ee840e0cabcd');
    }
    if (is_single() && comments_open() && get_option('thread_comments')) {
        wp_enqueue_script('comment-reply');
    }
    // Modernizr
    wp_register_script('modernizr', $path . '/js/vendor/modernizr-2.7.0.min.js', array(), null, false);
    //Mobile Scripts
    wp_register_script('touchswipe_js', $path . '/js/vendor/jquery.touchSwipe.min.js', array(), null, false);
    wp_register_script('sidr_js', $path . '/js/vendor/jquery.sidr.min.js', array(), null, false);
    wp_register_script('perfect_scrollbar', $path . '/js/vendor/perfect-scrollbar.jquery.js', array(), null, false);
    // Enqueue Font Awesome
    // Custom Scripts
    wp_register_script('wff_scripts', $path . '/js/scripts.min.js', array(), '2592531929b0a0de360daca45107315b', true);
    wp_enqueue_script('modernizr');
    //Developer: See lib/constants.php to enable mobile optimisation. This is currently experimentatal.
    if (wff_is_device() || WEFOSTER_MOBILE_OPTIMISATION == 'off') {
        //Only load our scripts on mobile
        wp_enqueue_script('touchswipe_js');
        wp_enqueue_script('sidr_js');
        wp_enqueue_script('perfect_scrollbar');
        wp_register_script('wff-fastclick', $path . '/vendor/fastclick/lib/fastclick.js', array(), null, false);
        wp_enqueue_script('wff-fastclick');
    }
    wp_enqueue_script('jquery');
    wp_enqueue_script('wff_scripts');
}
コード例 #2
0
ファイル: bp-actions.php プロジェクト: WeFoster/wefoster
/**
 * Profile / Group Sidebar Triggers
 *
 */
function bp_mobile_sidebar_triggers()
{
    if (wff_is_device() || WEFOSTER_MOBILE_OPTIMISATION == 'off') {
        ?>
		<div class="mobile-content-trigger hidden-lg hidden-md">
			<?php 
        if (bp_is_groups_component() && bp_is_group()) {
            ?>
				<a id="buddypress-mobile-sidebar-trigger" href="#buddypress-mobile-sidebar">
					<i class="fa fa-group"></i>
					<svg xmlns="http://www.w3.org/2000/svg" width="50" height="50" viewBox="0 0 50 50">
						<path
							d="M25,2C12.318,2,2,12.318,2,25c0,12.683,10.318,23,23,23c12.683,0,23-10.317,23-23C48,12.318,37.683,2,25,2z M35,32H15 c-0.552,0-1-0.447-1-1s0.448-1,1-1h20c0.553,0,1,0.447,1,1S35.553,32,35,32z M35,26H15c-0.552,0-1-0.448-1-1s0.448-1,1-1h20 c0.553,0,1,0.448,1,1S35.553,26,35,26z M35,20H15c-0.552,0-1-0.448-1-1s0.448-1,1-1h20c0.553,0,1,0.448,1,1S35.553,20,35,20z"></path>
					</svg>
				</a>
			<?php 
        } elseif (bp_is_user() && !bp_is_my_profile()) {
            ?>
				<a id="buddypress-mobile-sidebar-trigger" href="#buddypress-mobile-sidebar">
					<i class="fa fa-user"></i>
					<svg xmlns="http://www.w3.org/2000/svg" width="50" height="50" viewBox="0 0 50 50">
						<path
							d="M25,2C12.318,2,2,12.318,2,25c0,12.683,10.318,23,23,23c12.683,0,23-10.317,23-23C48,12.318,37.683,2,25,2z M35,32H15 c-0.552,0-1-0.447-1-1s0.448-1,1-1h20c0.553,0,1,0.447,1,1S35.553,32,35,32z M35,26H15c-0.552,0-1-0.448-1-1s0.448-1,1-1h20 c0.553,0,1,0.448,1,1S35.553,26,35,26z M35,20H15c-0.552,0-1-0.448-1-1s0.448-1,1-1h20c0.553,0,1,0.448,1,1S35.553,20,35,20z"></path>
					</svg>
				</a>
			<?php 
        } elseif (bp_is_activity_component() && bp_is_directory()) {
            ?>
				<a id="buddypress-mobile-sidebar-trigger" href="#buddypress-mobile-sidebar">
					<i class="fa fa-eye"></i>
					<svg xmlns="http://www.w3.org/2000/svg" width="50" height="50" viewBox="0 0 50 50">
						<path
							d="M25,2C12.318,2,2,12.318,2,25c0,12.683,10.318,23,23,23c12.683,0,23-10.317,23-23C48,12.318,37.683,2,25,2z M35,32H15 c-0.552,0-1-0.447-1-1s0.448-1,1-1h20c0.553,0,1,0.447,1,1S35.553,32,35,32z M35,26H15c-0.552,0-1-0.448-1-1s0.448-1,1-1h20 c0.553,0,1,0.448,1,1S35.553,26,35,26z M35,20H15c-0.552,0-1-0.448-1-1s0.448-1,1-1h20c0.553,0,1,0.448,1,1S35.553,20,35,20z"></path>
					</svg>
				</a>
			<?php 
        }
        ?>

		</div>

		<?php 
    }
}
コード例 #3
0
ファイル: filters.php プロジェクト: WeFoster/wefoster
/**
 * Add special "admin bar is showing" body class
 *
 * @since 1.0.0
 *
 */
function wff_mobile_body_class($classes)
{
    if (wff_is_device() || WEFOSTER_MOBILE_OPTIMISATION == 'off') {
        $classes[] = 'wefosterismobile';
    } else {
        $classes[] = 'wefosterisdesktop';
    }
    // return it!
    return $classes;
}
コード例 #4
0
ファイル: actions.php プロジェクト: WeFoster/wefoster
    function wff_author_box_location()
    {
        get_template_part('templates/parts/author-box');
    }
    add_action('wf_after_entry_content', 'wff_author_box_location');
}
// Mobile Templates.
if (!function_exists('wff_mobile_sidebars')) {
    /**
     * Load our Mobile Navigation on Handhelds.
     */
    function wff_mobile_sidebars()
    {
        get_template_part('templates/sidebar/mobile-navigation');
    }
    if (wff_is_device() || WEFOSTER_MOBILE_OPTIMISATION == 'off') {
        add_action('wf_after_footer', 'wff_mobile_sidebars');
    }
}
/*
 * Hide Admin bar by default for regular users.
 *
 * @since 1.0.0
 */
if (!function_exists('wff_hide_admin_bar')) {
    function wff_hide_admin_bar()
    {
        add_filter('show_admin_bar', '__return_false');
    }
    // add_action( 'wf_init','wff_hide_admin_bar' );
}