コード例 #1
0
function wptouch_custom_latest_post_filter($query_vars)
{
    if (wptouch_is_showing_mobile_theme_on_mobile_device()) {
        $settings = foundation_get_settings();
        if (foundation_is_theme_using_module('custom-latest-posts') && $settings->latest_posts_page != 'none') {
            $dummy_query = new WP_Query();
            // the query isn't run if we don't pass any query vars
            $dummy_query->parse_query($query_vars);
            if ($dummy_query->is_page && count($query_vars) == 0) {
                // Front page
                $front_option = get_option('show_on_front', false);
                if ($front_option == 'page') {
                    $front_page = get_option('page_on_front');
                    $dummy_query->queried_object_id = $front_page;
                }
            }
            if (isset($dummy_query->queried_object_id) && apply_filters('foundation_is_custom_latest_posts_page', $settings->latest_posts_page == $dummy_query->queried_object_id)) {
                if (isset($query_vars['paged'])) {
                    $paged = $query_vars['paged'];
                } elseif (isset($query_vars['page'])) {
                    $paged = $query_vars['page'];
                } else {
                    $paged = 1;
                }
                $query_vars = array('paged' => $paged, 'posts_per_page' => $settings->posts_per_page);
                // Since we're modifying the query here, we need to prevent the custom landing page redirect from firing for this request (it'll think it's loading the homepage)
                add_filter('wptouch_redirect_target', 'wptouch_return_false');
            }
        }
    }
    return $query_vars;
}
コード例 #2
0
function wptouch_custom_latest_post_filter($query_vars)
{
    if (wptouch_is_showing_mobile_theme_on_mobile_device()) {
        $settings = foundation_get_settings();
        if (foundation_is_theme_using_module('custom-latest-posts') && $settings->latest_posts_page != 'none') {
            $dummy_query = new WP_Query();
            // the query isn't run if we don't pass any query vars
            $dummy_query->parse_query($query_vars);
            if ($dummy_query->is_page && count($query_vars) == 0) {
                // Front page
                $front_option = get_option('show_on_front', false);
                if ($front_option == 'page') {
                    $front_page = get_option('page_on_front');
                    $dummy_query->queried_object_id = $front_page;
                }
            }
            if (isset($dummy_query->queried_object_id) && apply_filters('foundation_is_custom_latest_posts_page', $settings->latest_posts_page == $dummy_query->queried_object_id)) {
                if (isset($query_vars['paged'])) {
                    $paged = $query_vars['paged'];
                } elseif (isset($query_vars['page'])) {
                    $paged = $query_vars['page'];
                } else {
                    $paged = 1;
                }
                $query_vars = array('paged' => $paged, 'posts_per_page' => $settings->posts_per_page);
            }
        }
    }
    return $query_vars;
}
コード例 #3
0
function bauhaus_register_fonts()
{
    if (foundation_is_theme_using_module('google-fonts')) {
        foundation_register_google_font_pairing('lato_roboto', foundation_create_google_font('heading', 'Lato', 'sans-serif', array('300', '600')), foundation_create_google_font('body', 'Roboto', 'sans-serif', array('400', '700', '400italic', '700italic')));
        foundation_register_google_font_pairing('droidserif_roboto', foundation_create_google_font('heading', 'Droid Serif', 'serif', array('400', '700')), foundation_create_google_font('body', 'Roboto', 'sans-serif', array('400', '700', '400italic', '700italic')));
        foundation_register_google_font_pairing('baumans_ubuntu', foundation_create_google_font('heading', 'Baumans', 'sans-serif', array('400', '700')), foundation_create_google_font('body', 'Ubuntu', 'sans-serif', array('400', '700', '400italic', '700italic')));
        foundation_register_google_font_pairing('alegreya_roboto', foundation_create_google_font('heading', 'Alegreya', 'serif', array('400', '700')), foundation_create_google_font('body', 'Roboto', 'sans-serif', array('400', '700', '400italic', '700italic')));
        foundation_register_google_font_pairing('fjalla_cantarell', foundation_create_google_font('heading', 'Fjalla One', 'sans-serif', array('400')), foundation_create_google_font('body', 'Open Sans', 'sans-serif', array('400', '700', '400italic', '700italic')));
        foundation_register_google_font_pairing('grandhotel_crimson', foundation_create_google_font('heading', 'Domine', 'sans-serif', array('400')), foundation_create_google_font('body', 'News Cycle', 'sans-serif', array('400', '700', '400italic', '700italic')));
    }
}
コード例 #4
0
function foundation_webapp_settings($page_options)
{
    wptouch_add_sub_page(FOUNDATION_PAGE_WEB_APP, 'foundation-page-webapp', $page_options);
    wptouch_add_page_section(FOUNDATION_PAGE_WEB_APP, __('Settings', 'wptouch-pro'), 'foundation-web-app-settings', array(wptouch_add_pro_setting('checkbox', 'webapp_mode_enabled', __('Enable iOS Web-App Mode', 'wptouch-pro'), '', WPTOUCH_SETTING_BASIC, '1.0'), wptouch_add_pro_setting('checkbox', 'webapp_enable_persistence', __('Enable persistence', 'wptouch-pro'), __('Loads the last visited URL for visitors on open.', 'wptouch-pro'), WPTOUCH_SETTING_BASIC, '1.0.2'), wptouch_add_pro_setting('textarea', 'webapp_ignore_urls', __('URLs to ignore in Web-App Mode', 'wptouch-pro'), '', WPTOUCH_SETTING_BASIC, '1.0.2')), $page_options, FOUNDATION_SETTING_DOMAIN);
    wptouch_add_page_section(FOUNDATION_PAGE_WEB_APP, __('Notice Message', 'wptouch-pro'), 'notice-message', array(wptouch_add_pro_setting('checkbox', 'webapp_show_notice', __('Show a notice message for iPhone, iPod touch & iPad visitors about my Web-App', 'wptouch-pro'), __('WPtouch shows a notice bubble on 1st visit letting users know about your Web-App enabled website on iOS devices.', 'wptouch-pro'), WPTOUCH_SETTING_BASIC, '1.0'), wptouch_add_pro_setting('textarea', 'webapp_notice_message', __('Notice message contents', 'wptouch-pro'), __('[device] and [icon] are dynamic and used to determine the device and iOS version. Do not remove these from your message.', 'wptouch-pro'), WPTOUCH_SETTING_ADVANCED, '1.0'), wptouch_add_pro_setting('list', 'webapp_notice_expiry_days', __('the notice message will be shown again for visitors', 'wptouch-pro'), '', WPTOUCH_SETTING_ADVANCED, '1.0', array('1' => __('1 day until', 'wptouch-pro'), '7' => __('7 days until', 'wptouch-pro'), '30' => __('1 month until', 'wptouch-pro'), '0' => __('Every time', 'wptouch-pro')))), $page_options, FOUNDATION_SETTING_DOMAIN);
    /* Startup Screen Area */
    wptouch_add_page_section(FOUNDATION_PAGE_WEB_APP, __('iPhone Startup Screen', 'wptouch-pro'), 'iphone-startup-screen', array(wptouch_add_pro_setting('image-upload', 'startup_screen_iphone_2g_3g', sprintf(__('%d by %d pixels (PNG)', 'wptouch-pro'), 320, 460), '', WPTOUCH_SETTING_BASIC, '1.0')), $page_options, FOUNDATION_SETTING_DOMAIN);
    wptouch_add_page_section(FOUNDATION_PAGE_WEB_APP, __('Retina iPhone Startup Screen', 'wptouch-pro'), 'retina-iphone-startup-screen', array(wptouch_add_pro_setting('image-upload', 'startup_screen_iphone_4_4s', sprintf(__('%d by %d pixels (PNG)', 'wptouch-pro'), 640, 920), '', WPTOUCH_SETTING_BASIC, '1.0')), $page_options, FOUNDATION_SETTING_DOMAIN);
    wptouch_add_page_section(FOUNDATION_PAGE_WEB_APP, __('iPhone 5 Startup Screen', 'wptouch-pro'), 'iphone-5-startup-screen', array(wptouch_add_pro_setting('image-upload', 'startup_screen_iphone_5', sprintf(__('%d by %d pixels (PNG)', 'wptouch-pro'), 640, 1096), '', WPTOUCH_SETTING_BASIC, '1.0')), $page_options, FOUNDATION_SETTING_DOMAIN);
    if (foundation_is_theme_using_module('tablets')) {
        wptouch_add_page_section(FOUNDATION_PAGE_WEB_APP, __('iPad Mini and iPad Startup Screens', 'wptouch-pro'), 'ipad-mini-and-ipad-startup-screens', array(wptouch_add_pro_setting('image-upload', 'startup_screen_ipad_1_portrait', sprintf(__('%d by %d pixels (PNG)', 'wptouch-pro'), 768, 1004), '', WPTOUCH_SETTING_BASIC, '1.0'), wptouch_add_pro_setting('image-upload', 'startup_screen_ipad_1_landscape', sprintf(__('%d by %d pixels (PNG)', 'wptouch-pro'), 1024, 748), '', WPTOUCH_SETTING_BASIC, '1.0')), $page_options, FOUNDATION_SETTING_DOMAIN);
        wptouch_add_page_section(FOUNDATION_PAGE_WEB_APP, __('Retina iPad Startup Screens', 'wptouch-pro'), 'retina-ipad-startup-screens', array(wptouch_add_pro_setting('image-upload', 'startup_screen_ipad_3_portrait', sprintf(__('%d by %d pixels (PNG)', 'wptouch-pro'), 1536, 2008), '', WPTOUCH_SETTING_BASIC, '1.0'), wptouch_add_pro_setting('image-upload', 'startup_screen_ipad_3_landscape', sprintf(__('%d by %d pixels (PNG)', 'wptouch-pro'), 2048, 1496), '', WPTOUCH_SETTING_BASIC, '1.0')), $page_options, FOUNDATION_SETTING_DOMAIN);
    }
    return $page_options;
}
コード例 #5
0
ファイル: webapp.php プロジェクト: StefanBonilla/CoupSoup
function foundation_webapp_settings($page_options)
{
    $show_wam_settings = apply_filters('wptouch_allow_wam', true);
    wptouch_add_sub_page(FOUNDATION_PAGE_WEB_APP, 'foundation-page-webapp', $page_options);
    if (!$show_wam_settings) {
        wptouch_add_page_section(FOUNDATION_PAGE_WEB_APP, __('Web-App Mode Unavailable', 'wptouch-pro'), 'foundation-web-app-settings', array(wptouch_add_pro_setting('checkbox', 'webapp_mode_unavailable', apply_filters('wptouch_allow_wam_message', 'Web-App Mode has been disabled by a theme or extension.'), '', WPTOUCH_SETTING_BASIC, '3.6.6')), $page_options, FOUNDATION_SETTING_DOMAIN);
    } else {
        wptouch_add_page_section(FOUNDATION_PAGE_WEB_APP, __('Settings', 'wptouch-pro'), 'foundation-web-app-settings', array(wptouch_add_pro_setting('checkbox', 'webapp_mode_enabled', __('Enable Web-App Mode', 'wptouch-pro'), '', WPTOUCH_SETTING_BASIC, '1.0'), wptouch_add_pro_setting('checkbox', 'webapp_enable_persistence', __('Enable persistence', 'wptouch-pro'), __('Loads the last visited URL for visitors on open.', 'wptouch-pro'), WPTOUCH_SETTING_BASIC, '1.0.2'), $wam_settings[] = wptouch_add_pro_setting('textarea', 'webapp_ignore_urls', __('URLs to ignore in Web-App Mode', 'wptouch-pro'), '', WPTOUCH_SETTING_BASIC, '1.0.2')), $page_options, FOUNDATION_SETTING_DOMAIN);
        wptouch_add_page_section(FOUNDATION_PAGE_WEB_APP, __('Web App Title', 'wptouch-pro'), 'admin_menu_homescreen_icons_options', array(wptouch_add_pro_setting('text', 'homescreen_icon_title', __('Icon title', 'wptouch-pro'), __('When visitors bookmark your website, this will be the title shown.', 'wptouch-pro'), WPTOUCH_SETTING_BASIC, '1.0')), $page_options, FOUNDATION_SETTING_DOMAIN);
        wptouch_add_page_section(FOUNDATION_PAGE_WEB_APP, __('Notice Message', 'wptouch-pro'), 'notice-message', array(wptouch_add_pro_setting('checkbox', 'webapp_show_notice', __('Show a notice message for iPhone, iPod touch & iPad visitors about my Web-App', 'wptouch-pro'), __('WPtouch shows a notice bubble on 1st visit letting users know about your Web-App enabled website on iOS devices.', 'wptouch-pro'), WPTOUCH_SETTING_BASIC, '1.0'), wptouch_add_pro_setting('textarea', 'webapp_notice_message', __('Notice message contents', 'wptouch-pro'), __('[icon] is used to display the appropriate bookmark icon for your device. Do not remove it from your message.', 'wptouch-pro'), WPTOUCH_SETTING_ADVANCED, '1.0'), wptouch_add_pro_setting('list', 'webapp_notice_expiry_days', __('the notice message will be shown again for visitors', 'wptouch-pro'), '', WPTOUCH_SETTING_ADVANCED, '1.0', array('1' => __('1 day until', 'wptouch-pro'), '7' => __('7 days until', 'wptouch-pro'), '30' => __('1 month until', 'wptouch-pro'), '0' => __('Every time', 'wptouch-pro')))), $page_options, FOUNDATION_SETTING_DOMAIN);
        /* Startup Screen Area */
        wptouch_add_page_section(FOUNDATION_PAGE_WEB_APP, __('iPhone Startup Screen', 'wptouch-pro'), 'iphone-startup-screen', array(wptouch_add_pro_setting('image-upload', 'startup_screen_iphone_2g_3g', sprintf(__('%d by %d pixels (PNG)', 'wptouch-pro'), 320, 460), '', WPTOUCH_SETTING_BASIC, '1.0')), $page_options, FOUNDATION_SETTING_DOMAIN);
        wptouch_add_page_section(FOUNDATION_PAGE_WEB_APP, __('Retina iPhone Startup Screen', 'wptouch-pro'), 'retina-iphone-startup-screen', array(wptouch_add_pro_setting('image-upload', 'startup_screen_iphone_4_4s', sprintf(__('%d by %d pixels (PNG)', 'wptouch-pro'), 640, 920), '', WPTOUCH_SETTING_BASIC, '1.0')), $page_options, FOUNDATION_SETTING_DOMAIN);
        wptouch_add_page_section(FOUNDATION_PAGE_WEB_APP, __('iPhone 5 Startup Screen', 'wptouch-pro'), 'iphone-5-startup-screen', array(wptouch_add_pro_setting('image-upload', 'startup_screen_iphone_5', sprintf(__('%d by %d pixels (PNG)', 'wptouch-pro'), 640, 1096), '', WPTOUCH_SETTING_BASIC, '1.0')), $page_options, FOUNDATION_SETTING_DOMAIN);
        wptouch_add_page_section(FOUNDATION_PAGE_WEB_APP, __('iPhone 6 Startup Screen', 'wptouch-pro'), 'iphone-6-startup-screen', array(wptouch_add_pro_setting('image-upload', 'startup_screen_iphone_6', sprintf(__('%d by %d pixels (PNG)', 'wptouch-pro'), 750, 1294), '', WPTOUCH_SETTING_BASIC, '1.0')), $page_options, FOUNDATION_SETTING_DOMAIN);
        wptouch_add_page_section(FOUNDATION_PAGE_WEB_APP, __('iPhone 6+ Startup Screen', 'wptouch-pro'), 'iphone-6plus-startup-screen', array(wptouch_add_pro_setting('image-upload', 'startup_screen_iphone_6plus', sprintf(__('%d by %d pixels (PNG)', 'wptouch-pro'), 1242, 2148), '', WPTOUCH_SETTING_BASIC, '1.0')), $page_options, FOUNDATION_SETTING_DOMAIN);
        if (foundation_is_theme_using_module('tablets')) {
            wptouch_add_page_section(FOUNDATION_PAGE_WEB_APP, __('iPad Mini and iPad Startup Screens', 'wptouch-pro'), 'ipad-mini-and-ipad-startup-screens', array(wptouch_add_pro_setting('image-upload', 'startup_screen_ipad_1_portrait', sprintf(__('%d by %d pixels (PNG)', 'wptouch-pro'), 768, 1004), '', WPTOUCH_SETTING_BASIC, '1.0'), wptouch_add_pro_setting('image-upload', 'startup_screen_ipad_1_landscape', sprintf(__('%d by %d pixels (PNG)', 'wptouch-pro'), 1024, 748), '', WPTOUCH_SETTING_BASIC, '1.0')), $page_options, FOUNDATION_SETTING_DOMAIN);
            wptouch_add_page_section(FOUNDATION_PAGE_WEB_APP, __('Retina iPad Startup Screens', 'wptouch-pro'), 'retina-ipad-startup-screens', array(wptouch_add_pro_setting('image-upload', 'startup_screen_ipad_3_portrait', sprintf(__('%d by %d pixels (PNG)', 'wptouch-pro'), 1536, 2008), '', WPTOUCH_SETTING_BASIC, '1.0'), wptouch_add_pro_setting('image-upload', 'startup_screen_ipad_3_landscape', sprintf(__('%d by %d pixels (PNG)', 'wptouch-pro'), 2048, 1496), '', WPTOUCH_SETTING_BASIC, '1.0')), $page_options, FOUNDATION_SETTING_DOMAIN);
        }
    }
    return $page_options;
}
コード例 #6
0
function classic_register_fonts()
{
    if (foundation_is_theme_using_module('google-fonts')) {
        foundation_register_google_font_pairing('arvo_ptsans', foundation_create_google_font('heading', 'Arvo', 'serif', array('400', '700')), foundation_create_google_font('body', 'PT Sans', 'sans-serif', array('400', '700', '400italic', '700italic')));
        foundation_register_google_font_pairing('inika_raleway', foundation_create_google_font('heading', 'Inika', 'serif', array('400', '700')), foundation_create_google_font('body', 'Raleway', 'sans-serif', array('500', '700', '500italic', '700italic')));
        foundation_register_google_font_pairing('dosis_dsans', foundation_create_google_font('heading', 'Dosis', 'serif', array('400', '700')), foundation_create_google_font('body', 'Droid Sans', 'sans-serif', array('400', '700', '500italic', '700italic')));
        foundation_register_google_font_pairing('bitter_sourcesans', foundation_create_google_font('heading', 'Bitter', 'serif', array('400', '700')), foundation_create_google_font('body', 'Source Sans Pro', 'sans-serif', array('400', '700', '400italic', '700italic')));
        foundation_register_google_font_pairing('lato_sourcesans', foundation_create_google_font('heading', 'Lato', 'serif', array('400', '700')), foundation_create_google_font('body', 'Source Sans Pro', 'sans-serif', array('400', '700', '500italic', '700italic')));
    }
}
コード例 #7
0
ファイル: page.php プロジェクト: liangwei1988/wordpress
<?php

if (foundation_is_theme_using_module('custom-latest-posts') && wptouch_fdn_is_custom_latest_posts_page()) {
    ?>

	<?php 
    wptouch_fdn_custom_latest_posts_query();
    ?>
	<?php 
    get_template_part('index');
    ?>

<?php 
} else {
    ?>

	<?php 
    get_header();
    ?>

	<div id="content">
		<?php 
    if (wptouch_have_posts()) {
        ?>
			<?php 
        wptouch_the_post();
        ?>
			<?php 
        get_template_part('page-content');
        ?>
		<?php 
コード例 #8
0
		
		<?php 
    if (get_next_posts_link()) {
        var_dump(get_next_posts_page_link());
        ?>
  			<!-- hidden in css, needed to add js -->
			<a class="infinite-link" href="#" rel="<?php 
        echo get_next_posts_page_link();
        ?>
"></a>
		<?php 
    }
    ?>

	<?php 
} elseif (foundation_is_theme_using_module('load-more')) {
    ?>

		<!-- show the load more if we have more posts/pages -->
		<?php 
    if (get_next_posts_link()) {
        ?>
			<a class="load-more-link tappable no-ajax" href="javascript:return false;" rel="<?php 
        echo get_next_posts_page_link();
        ?>
">
				<?php 
        wptouch_fdn_archive_load_more_text();
        ?>
&hellip;
			</a>