• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

PHP genesis_get_seo_option函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中genesis_get_seo_option函数的典型用法代码示例。如果您正苦于以下问题:PHP genesis_get_seo_option函数的具体用法?PHP genesis_get_seo_option怎么用?PHP genesis_get_seo_option使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了genesis_get_seo_option函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: genesis_nav

function genesis_nav($args = array())
{
    $defaults = array('context' => '', 'type' => 'pages', 'sort_column' => 'menu_order, post_title', 'menu_id' => false, 'menu_class' => 'nav', 'echo' => true, 'link_before' => '', 'link_after' => '');
    $defaults = apply_filters('genesis_nav_default_args', $defaults);
    $args = wp_parse_args($args, $defaults);
    $menu = '';
    $list_args = $args;
    // Show Home in the menu (mostly copied from WP source)
    if (isset($args['show_home']) && !empty($args['show_home'])) {
        if (true === $args['show_home'] || '1' === $args['show_home'] || 1 === $args['show_home']) {
            $text = apply_filters('genesis_nav_home_text', __('Home', 'genesis'), $args);
        } else {
            $text = $args['show_home'];
        }
        $class = '';
        if (is_front_page() && !is_paged()) {
            $class = 'class="home current_page_item"';
        } else {
            $class = 'class="home"';
        }
        $home = '<li ' . $class . '><a href="' . get_bloginfo('siteurl') . '" title="' . esc_attr($text) . '">' . $args['link_before'] . $text . $args['link_after'] . '</a></li>';
        $menu .= genesis_get_seo_option('nofollow_home_link') ? genesis_rel_nofollow($home) : $home;
        // If the front page is a page, add it to the exclude list
        if (get_option('show_on_front') == 'page' && $args['type'] == 'pages') {
            if (!empty($list_args['exclude'])) {
                $list_args['exclude'] .= ',';
            } else {
                $list_args['exclude'] = '';
            }
            $list_args['exclude'] .= get_option('page_on_front');
        }
    }
    $list_args['echo'] = false;
    $list_args['title_li'] = '';
    if ($args['type'] == 'pages') {
        $menu .= str_replace(array("\r", "\n", "\t"), '', wp_list_pages($list_args));
    } elseif ($args['type'] == 'categories') {
        $menu .= str_replace(array("\r", "\n", "\t"), '', wp_list_categories($list_args));
    }
    // Apply filters to the nav items
    $menu = apply_filters('genesis_nav_items', $menu, $args);
    $menu_class = $args['menu_class'] ? ' class="' . esc_attr($args['menu_class']) . '"' : '';
    $menu_id = $args['menu_id'] ? ' id="' . esc_attr($args['menu_id']) . '"' : '';
    if ($menu) {
        $menu = '<ul' . $menu_id . $menu_class . '>' . $menu . '</ul>';
    }
    // Apply filters to the final nav output
    $menu = apply_filters('genesis_nav', $menu, $args);
    if ($args['echo']) {
        echo $menu;
    } else {
        return $menu;
    }
}
开发者ID:Weissenberger13,项目名称:web.portugalrentalcottages,代码行数:54,代码来源:menu_functions.php


示例2: custom_header_inline_logo

function custom_header_inline_logo($title, $inside, $wrap)
{
    $logo = '<img src="' . get_stylesheet_directory_uri() . '/images/logo.png" alt="' . esc_attr(get_bloginfo('name')) . '" title="' . esc_attr(get_bloginfo('name')) . '" width="359" height="72" />';
    $inside = sprintf('<a href="%s" title="%s">%s</a>', trailingslashit(home_url()), esc_attr(get_bloginfo('name')), $logo);
    // Determine which wrapping tags to use - changed is_home to is_front_page to fix Genesis bug
    $wrap = is_front_page() && 'title' === genesis_get_seo_option('home_h1_on') ? 'h1' : 'p';
    // A little fallback, in case an SEO plugin is active - changed is_home to is_front_page to fix Genesis bug
    $wrap = is_front_page() && !genesis_get_seo_option('home_h1_on') ? 'h1' : $wrap;
    // And finally, $wrap in h1 if HTML5 & semantic headings enabled
    $wrap = genesis_html5() && genesis_get_seo_option('semantic_headings') ? 'h1' : $wrap;
    return sprintf('<%1$s %2$s>%3$s</%1$s>', $wrap, genesis_attr('site-title'), $inside);
}
开发者ID:Bobcatou,项目名称:plancurtail,代码行数:12,代码来源:functions.php


示例3: ygf_seo_site_title

/**
 * Echo the site title into the header.
 *
 * Depending on the SEO option set by the user, this will either be wrapped in an `h1` or `p` element.
 *
 * Applies the `genesis_seo_title` filter before echoing.
 *
 * @since 1.1.0
 *
 * @uses genesis_get_seo_option() Get SEO setting value.
 * @uses genesis_html5()          Check or HTML5 support.
 */
function ygf_seo_site_title()
{
    // Set what goes inside the wrapping tags
    $inside = sprintf('<a href="%s" class="menu-text">%s</a>', trailingslashit(home_url()), get_bloginfo('name'));
    // Determine which wrapping tags to use
    $wrap = is_home() && 'title' === genesis_get_seo_option('home_h1_on') ? 'h1' : 'h1';
    // A little fallback, in case an SEO plugin is active
    $wrap = is_home() && !genesis_get_seo_option('home_h1_on') ? 'h1' : $wrap;
    // And finally, $wrap in h1 if HTML5 & semantic headings enabled
    $wrap = genesis_html5() && genesis_get_seo_option('semantic_headings') ? 'h1' : $wrap;
    // Build the title
    $title = genesis_html5() ? sprintf("<li class='name'><{$wrap} %s>", genesis_attr('site-title')) : sprintf('<%s id="title">%s</%s>', $wrap, $inside, $wrap);
    $title .= genesis_html5() ? "{$inside}</{$wrap}></li>" : '';
    if (!has_nav_menu('mobile-off-canvas')) {
        $title .= '<li class="toggle-topbar menu-icon"><a href="#"><span>Menu</span></a></li>';
    }
    // Echo (filtered)
    echo apply_filters('genesis_seo_title', $title, $inside, $wrap);
}
开发者ID:g-kanoufi,项目名称:genesis-foundation6-child-theme,代码行数:31,代码来源:header.php


示例4: genesis_upgrade

/**
 * Update Genesis to the latest version.
 *
 * This iterative update function will take a Genesis installation, no matter
 * how old, and update its options to the latest version.
 *
 * It used to iterate over theme version, but now uses a database version
 * system, which allows for changes within pre-releases, too.
 *
 * @since 1.0.1
 *
 * @return null Return early if we're already on the latest version.
 */
function genesis_upgrade()
{
    // Don't do anything if we're on the latest version.
    if (genesis_get_option('db_version', null, false) >= PARENT_DB_VERSION) {
        return;
    }
    global $wp_db_version;
    // If the WP db hasn't been upgraded, make them upgrade first.
    if (get_option('db_version') != $wp_db_version) {
        wp_redirect(admin_url('upgrade.php?_wp_http_referer=' . urlencode(wp_unslash($_SERVER['REQUEST_URI']))));
        exit;
    }
    // UPDATE TO VERSION 1.0.1.
    if (version_compare(genesis_get_option('theme_version', null, false), '1.0.1', '<')) {
        $theme_settings = get_option(GENESIS_SETTINGS_FIELD);
        $new_settings = array('nav_home' => 1, 'nav_twitter_text' => 'Follow me on Twitter', 'subnav_home' => 1, 'theme_version' => '1.0.1');
        $settings = wp_parse_args($new_settings, $theme_settings);
        update_option(GENESIS_SETTINGS_FIELD, $settings);
    }
    // UPDATE TO VERSION 1.1.
    if (version_compare(genesis_get_option('theme_version', null, false), '1.1', '<')) {
        $theme_settings = get_option(GENESIS_SETTINGS_FIELD);
        $new_settings = array('content_archive_thumbnail' => genesis_get_option('thumbnail'), 'theme_version' => '1.1');
        $settings = wp_parse_args($new_settings, $theme_settings);
        update_option(GENESIS_SETTINGS_FIELD, $settings);
    }
    // UPDATE TO VERSION 1.1.2.
    if (version_compare(genesis_get_option('theme_version', null, false), '1.1.2', '<')) {
        $theme_settings = get_option(GENESIS_SETTINGS_FIELD);
        $new_settings = array('header_right' => genesis_get_option('header_full') ? 0 : 1, 'nav_superfish' => 1, 'subnav_superfish' => 1, 'nav_extras_enable' => genesis_get_option('nav_right') ? 1 : 0, 'nav_extras' => genesis_get_option('nav_right'), 'nav_extras_twitter_id' => genesis_get_option('twitter_id'), 'nav_extras_twitter_text' => genesis_get_option('nav_twitter_text'), 'theme_version' => '1.1.2');
        $settings = wp_parse_args($new_settings, $theme_settings);
        update_option(GENESIS_SETTINGS_FIELD, $settings);
    }
    // UPDATE TO VERSION 1.2.
    if (version_compare(genesis_get_option('theme_version', null, false), '1.2', '<')) {
        $theme_settings = get_option(GENESIS_SETTINGS_FIELD);
        $new_settings = array('update' => 1, 'theme_version' => '1.2');
        $settings = wp_parse_args($new_settings, $theme_settings);
        update_option(GENESIS_SETTINGS_FIELD, $settings);
    }
    // UPDATE TO VERSION 1.3.
    if (version_compare(genesis_get_option('theme_version', null, false), '1.3', '<')) {
        // Update theme settings.
        $theme_settings = get_option(GENESIS_SETTINGS_FIELD);
        $new_settings = array('author_box_single' => genesis_get_option('author_box'), 'theme_version' => '1.3');
        $settings = wp_parse_args($new_settings, $theme_settings);
        update_option(GENESIS_SETTINGS_FIELD, $settings);
        // Update SEO settings.
        $seo_settings = get_option(GENESIS_SEO_SETTINGS_FIELD);
        $new_settings = array('noindex_cat_archive' => genesis_get_seo_option('index_cat_archive') ? 0 : 1, 'noindex_tag_archive' => genesis_get_seo_option('index_tag_archive') ? 0 : 1, 'noindex_author_archive' => genesis_get_seo_option('index_author_archive') ? 0 : 1, 'noindex_date_archive' => genesis_get_seo_option('index_date_archive') ? 0 : 1, 'noindex_search_archive' => genesis_get_seo_option('index_search_archive') ? 0 : 1, 'noodp' => 1, 'noydir' => 1, 'canonical_archives' => 1);
        $settings = wp_parse_args($new_settings, $seo_settings);
        update_option(GENESIS_SEO_SETTINGS_FIELD, $settings);
        // Delete the store transient, force refresh.
        delete_transient('genesis-remote-store');
    }
    // UPDATE TO VERSION 1.6.
    if (version_compare(genesis_get_option('theme_version', null, false), '1.6', '<')) {
        // Vestige nav settings, for backward compatibility.
        if ('nav-menu' !== genesis_get_option('nav_type')) {
            _genesis_vestige(array('nav_type', 'nav_superfish', 'nav_home', 'nav_pages_sort', 'nav_categories_sort', 'nav_depth', 'nav_exclude', 'nav_include'));
        }
        // Vestige subnav settings, for backward compatibility.
        if ('nav-menu' !== genesis_get_option('subnav_type')) {
            _genesis_vestige(array('subnav_type', 'subnav_superfish', 'subnav_home', 'subnav_pages_sort', 'subnav_categories_sort', 'subnav_depth', 'subnav_exclude', 'subnav_include'));
        }
        $theme_settings = get_option(GENESIS_SETTINGS_FIELD);
        $new_settings = array('theme_version' => '1.6');
        $settings = wp_parse_args($new_settings, $theme_settings);
        update_option(GENESIS_SETTINGS_FIELD, $settings);
    }
    // UPDATE DB TO VERSION 1700.
    if (genesis_get_option('db_version', null, false) < '1700') {
        genesis_upgrade_1700();
    }
    // UPDATE DB TO VERSION 1800.
    if (genesis_get_option('db_version', null, false) < '1800') {
        genesis_upgrade_1800();
    }
    // UPDATE DB TO VERSION 1901.
    if (genesis_get_option('db_version', null, false) < '1901') {
        genesis_upgrade_1901();
    }
    // UPDATE DB TO VERSION 2001.
    if (genesis_get_option('db_version', null, false) < '2001') {
        genesis_upgrade_2001();
    }
    // UPDATE DB TO VERSION 2003.
//.........这里部分代码省略.........
开发者ID:netmagik,项目名称:netmagik,代码行数:101,代码来源:upgrade.php


示例5: genesis_rel_author

/**
 * Echo custom rel="author" link tag.
 *
 * If the appropriate information has been entered, either for the homepage author,
 * or for an individual post/page author, echo a custom rel="author" link.
 *
 * @since 1.9.0
 *
 * @uses genesis_get_seo_option()
 *
 * @global $post
 * @return null Returns null on failure
 */
function genesis_rel_author()
{
    if (is_front_page() && ($gplus_url = get_user_option('googleplus', genesis_get_seo_option('home_author')))) {
        printf('<link rel="author" href="%s" />' . "\n", esc_url($gplus_url));
        return;
    }
    global $post;
    if (is_singular() && isset($post->post_author) && ($gplus_url = get_user_option('googleplus', $post->post_author))) {
        printf('<link rel="author" href="%s" />' . "\n", esc_url($gplus_url));
        return;
    }
    if (is_author() && get_query_var('author') && ($gplus_url = get_user_option('googleplus', get_query_var('author')))) {
        printf('<link rel="author" href="%s" />' . "\n", esc_url($gplus_url));
        return;
    }
}
开发者ID:kabrewer07,项目名称:mrw,代码行数:29,代码来源:header.php


示例6: genesis_seo_settings_archives_box

function genesis_seo_settings_archives_box()
{
    ?>

	<p><label><input type="checkbox" name="<?php 
    echo GENESIS_SEO_SETTINGS_FIELD;
    ?>
[canonical_archives]" value="1" <?php 
    checked(1, genesis_get_seo_option('canonical_archives'));
    ?>
 /> <?php 
    printf(__('Canonical Paginated Archives', 'genesis'));
    ?>
 </label></p>

	<p><span class="description"><?php 
    _e('This option points search engines to the first page of an archive, if viewing a paginated page. If you do not know what this means, leave it on.', 'genesis');
    ?>
</span></p>

<?php 
}
开发者ID:elderxavier,项目名称:ALLAN-JUNIOR-IAN,代码行数:22,代码来源:seo-settings.php


示例7: genesis_canonical

function genesis_canonical()
{
    global $wp_query;
    $canonical = '';
    if (is_front_page()) {
        $canonical = get_bloginfo('url');
    }
    if (is_singular()) {
        if (!($id = $wp_query->get_queried_object_id())) {
            return;
        }
        $cf = genesis_get_custom_field('_genesis_canonical_uri');
        $canonical = $cf ? $cf : get_permalink($id);
    }
    if (is_category() || is_tag() || is_tax()) {
        if (!($id = $wp_query->get_queried_object_id())) {
            return;
        }
        $taxonomy = $wp_query->queried_object->taxonomy;
        $canonical = genesis_get_seo_option('canonical_archives') ? get_term_link($id, $taxonomy) : 0;
    }
    if (is_author()) {
        if (!($id = $wp_query->get_queried_object_id())) {
            return;
        }
        $canonical = genesis_get_seo_option('canonical_archives') ? get_author_posts_url($id) : 0;
    }
    if (!$canonical) {
        return;
    }
    printf('<link rel="canonical" href="%s" />' . "\n", esc_url($canonical));
}
开发者ID:elderxavier,项目名称:ALLAN-JUNIOR-IAN,代码行数:32,代码来源:header.php


示例8: custom_header_inline_logo

function custom_header_inline_logo($title, $inside, $wrap)
{
    $logo = '<img src="' . get_stylesheet_directory_uri() . '/images/logo.png" alt="' . esc_attr(get_bloginfo('name')) . ' Homepage" width="200" height="100" />';
    $inside = sprintf('<a href="%s">%s<span class="screen-reader-text">%s</span></a>', trailingslashit(home_url()), $logo, get_bloginfo('name'));
    //echo genesis_get_seo_option( 'home_h1_on' );
    // Determine which wrapping tags to use
    //$wrap = genesis_is_root_page() && 'title' === genesis_get_seo_option( 'home_h1_on' ) ? 'h1' : 'p';
    $wrap = 'h1';
    //return;
    // A little fallback, in case an SEO plugin is active
    //$wrap = genesis_is_root_page() && ! genesis_get_seo_option( 'home_h1_on' ) ? 'h1' : $wrap;
    // And finally, $wrap in h1 if HTML5 & semantic headings enabled
    $wrap = genesis_html5() && genesis_get_seo_option('semantic_headings') ? 'h1' : $wrap;
    return sprintf('<%1$s %2$s>%3$s</%1$s>', $wrap, genesis_attr('site-title'), $inside);
}
开发者ID:ppphoang,项目名称:ctynhua,代码行数:15,代码来源:functions.php


示例9: genesis_author_box

/**
 * Echo the the author box and its contents.
 *
 * The title is filterable via `genesis_author_box_title`, and the gravatar size is filterable via
 * `genesis_author_box_gravatar_size`.
 *
 * The final output is filterable via `genesis_author_box`, which passes many variables through.
 *
 * @since 1.3.0
 *
 * @uses genesis_html5() Check for HTML5 support.
 * @uses genesis_attr()  Contextual attributes.
 *
 * @global WP_User $authordata Author (user) object.
 *
 * @param string $context Optional. Allows different author box markup for different contexts, specifically 'single'.
 *                        Default is empty string.
 * @param bool   $echo    Optional. If true, the author box will echo. If false, it will be returned.
 *
 * @return string HTML for author box.
 */
function genesis_author_box($context = '', $echo = true)
{
    global $authordata;
    $authordata = is_object($authordata) ? $authordata : get_userdata(get_query_var('author'));
    $gravatar_size = apply_filters('genesis_author_box_gravatar_size', 70, $context);
    $gravatar = get_avatar(get_the_author_meta('email'), $gravatar_size);
    $description = wpautop(get_the_author_meta('description'));
    //* The author box markup, contextual
    if (genesis_html5()) {
        $title = __('About', 'genesis') . ' <span itemprop="name">' . get_the_author() . '</span>';
        /**
         * Author box title filter.
         *
         * Allows you to filter the title of the author box. $context passed as second parameter to allow for contextual filtering.
         *
         * @since unknown
         *
         * @param string $title Assembled Title.
         * @param string $context Context.
         */
        $title = apply_filters('genesis_author_box_title', $title, $context);
        if ('single' === $context && !genesis_get_seo_option('semantic_headings')) {
            $heading_element = 'h4';
        } elseif (genesis_a11y('headings') || get_the_author_meta('headline', (int) get_query_var('author'))) {
            $heading_element = 'h4';
        } else {
            $heading_element = 'h1';
        }
        $pattern = sprintf('<section %s>', genesis_attr('author-box'));
        $pattern .= '%s<' . $heading_element . ' class="author-box-title">%s</' . $heading_element . '>';
        $pattern .= '<div class="author-box-content" itemprop="description">%s</div>';
        $pattern .= '</section>';
    } else {
        $title = apply_filters('genesis_author_box_title', sprintf('<strong>%s %s</strong>', __('About', 'genesis'), get_the_author()), $context);
        if ('single' === $context || get_the_author_meta('headline', (int) get_query_var('author'))) {
            $pattern = '<div class="author-box"><div>%s %s<br />%s</div></div>';
        } else {
            $pattern = '<div class="author-box">%s<h1>%s</h1><div>%s</div></div>';
        }
    }
    $output = sprintf($pattern, $gravatar, $title, $description);
    /**
     * Author box output filter.
     *
     * Allows you to filter the full output of the author box.
     *
     * @since unknown
     *
     * @param string $output Assembled output.
     * @param string $context Context.
     * @param string $pattern (s)printf pattern.
     * @param string $context Gravatar.
     * @param string $context Title.
     * @param string $context Description.
     */
    $output = apply_filters('genesis_author_box', $output, $context, $pattern, $gravatar, $title, $description);
    if ($echo) {
        echo $output;
    } else {
        return $output;
    }
}
开发者ID:nkeat12,项目名称:dv,代码行数:83,代码来源:post.php


示例10: gmdl_seo_site_title

/**
 * Echo the site title into the header.
 *
 * Depending on the SEO option set by the user, this will either be wrapped in an `h1` or `p` element.
 *
 * Applies the `genesis_seo_title` filter before echoing.
 *
 * @since 1.1.0
 *
 * @uses genesis_get_seo_option() Get SEO setting value.
 * @uses genesis_html5()          Check or HTML5 support.
 */
function gmdl_seo_site_title()
{
    // Set what goes inside the wrapping tags
    $inside = sprintf('<a href="%s">%s</a>', trailingslashit(home_url()), get_bloginfo('name'));
    // Determine which wrapping tags to use
    $wrap = is_home() && 'title' === genesis_get_seo_option('home_h1_on') ? 'h1' : 'h1';
    // A little fallback, in case an SEO plugin is active
    $wrap = is_home() && !genesis_get_seo_option('home_h1_on') ? 'h1' : $wrap;
    // And finally, $wrap in h1 if HTML5 & semantic headings enabled
    $wrap = genesis_html5() && genesis_get_seo_option('semantic_headings') ? 'h1' : $wrap;
    // Build the title
    $title = genesis_html5() ? sprintf("<div class='name'><{$wrap} %s>", genesis_attr('site-title')) : sprintf('<%s id="title">%s</%s>', $wrap, $inside, $wrap);
    $title .= genesis_html5() ? "{$inside}</{$wrap}>" : '';
    // Echo (filtered)
    echo apply_filters('genesis_seo_title', $title, $inside, $wrap);
}
开发者ID:kosovish,项目名称:genesis-material-design-lite-child-theme,代码行数:28,代码来源:header.php


示例11: genesis_nav

/**
 * Echoes or returns a pages or categories menu.
 *
 * Now only used for backwards-compatibility (genesis_vestige).
 *
 * The array of menu arguments (and their defaults) are:
 * - theme_location => ''
 * - type           => 'pages'
 * - sort_column    => 'menu_order, post_title'
 * - menu_id        => false
 * - menu_class     => 'nav'
 * - echo           => true
 * - link_before    => ''
 * - link_after     => ''
 *
 * Themes can short-circuit the function early by filtering on 'genesis_pre_nav' or
 * on the string of list items via 'genesis_nav_items. They can also filter the
 * complete menu markup via 'genesis_nav'. The $args (merged with defaults) are
 * available for all filters.
 *
 * @category Genesis
 * @package Structure
 * @subpackage Menus
 *
 * @since 0.2.3
 *
 * @uses genesis_get_seo_option()
 * @uses genesis_rel_nofollow()
 *
 * @see genesis_do_nav()
 * @see genesis_do_subnav()
 *
 * @param array $args Menu arguments
 * @return string HTML for menu (unless genesis_pre_nav returns something truthy)
 */
function genesis_nav($args = array())
{
    if (isset($args['context'])) {
        _deprecated_argument(__FUNCTION__, '1.2', __('The argument, "context", has been replaced with "theme_location" in the $args array.', 'genesis'));
    }
    /** Default arguments */
    $defaults = array('theme_location' => '', 'type' => 'pages', 'sort_column' => 'menu_order, post_title', 'menu_id' => false, 'menu_class' => 'nav', 'echo' => true, 'link_before' => '', 'link_after' => '');
    $defaults = apply_filters('genesis_nav_default_args', $defaults);
    $args = wp_parse_args($args, $defaults);
    /** Allow child theme to short-circuit this function */
    $pre = apply_filters('genesis_pre_nav', false, $args);
    if ($pre) {
        return $pre;
    }
    $menu = '';
    $list_args = $args;
    /** Show Home in the menu (mostly copied from WP source) */
    if (isset($args['show_home']) && !empty($args['show_home'])) {
        if (true === $args['show_home'] || '1' === $args['show_home'] || 1 === $args['show_home']) {
            $text = apply_filters('genesis_nav_home_text', __('Home', 'genesis'), $args);
        } else {
            $text = $args['show_home'];
        }
        $class = '';
        if (is_front_page() && !is_paged()) {
            $class = 'class="home current_page_item"';
        } else {
            $class = 'class="home"';
        }
        $home = '<li ' . $class . '><a href="' . trailingslashit(home_url()) . '" title="' . esc_attr($text) . '">' . $args['link_before'] . $text . $args['link_after'] . '</a></li>';
        $menu .= genesis_get_seo_option('nofollow_home_link') ? genesis_rel_nofollow($home) : $home;
        /** If the front page is a page, add it to the exclude list */
        if ('page' == get_option('show_on_front') && 'pages' == $args['type']) {
            $list_args['exclude'] .= $list_args['exclude'] ? ',' : '';
            $list_args['exclude'] .= get_option('page_on_front');
        }
    }
    $list_args['echo'] = false;
    $list_args['title_li'] = '';
    /** Add menu items */
    if ('pages' == $args['type']) {
        $menu .= str_replace(array("\r", "\n", "\t"), '', wp_list_pages($list_args));
    } elseif ('categories' == $args['type']) {
        $menu .= str_replace(array("\r", "\n", "\t"), '', wp_list_categories($list_args));
    }
    /** Apply filters to the nav items */
    $menu = apply_filters('genesis_nav_items', $menu, $args);
    $menu_class = $args['menu_class'] ? ' class="' . esc_attr($args['menu_class']) . '"' : '';
    $menu_id = $args['menu_id'] ? ' id="' . esc_attr($args['menu_id']) . '"' : '';
    if ($menu) {
        $menu = '<ul' . $menu_id . $menu_class . '>' . $menu . '</ul>';
    }
    /** Apply filters to the final nav output */
    $menu = apply_filters('genesis_nav', $menu, $args);
    if ($args['echo']) {
        echo $menu;
    } else {
        return $menu;
    }
}
开发者ID:hscale,项目名称:webento,代码行数:95,代码来源:menu.php


示例12: cuttz_desc

/**
 * Changes Site Description to H1 (Genesis does an H2 by default). Bozo?
 * @param type $title 
 * @param type $inside 
 * @param type $wrap 
 * @return type
 * @since 1.0
 */
function cuttz_desc($description, $inside, $wrap)
{
    $tag = is_home() && 'description' === genesis_get_seo_option('home_h1_on') ? 'h1' : 'p';
    $tag = genesis_html5() && genesis_get_seo_option('semantic_headings') ? 'h1' : $tag;
    $description = preg_replace("/<{$wrap}\\s(.+?)>(.+?)<\\/{$wrap}>/is", "<{$tag} \$1>\$2</{$tag}>", $description);
    return $description;
}
开发者ID:garywp,项目名称:cuttz-framework,代码行数:15,代码来源:misc.php


示例13: bw_header_inline_logo

function bw_header_inline_logo($title, $inside, $wrap)
{
    // remove site tagline
    remove_action('genesis_site_description', 'genesis_seo_site_description');
    if (get_theme_mod('s_logo')) {
        $logo = '<img id="logo" src="' . get_theme_mod('s_logo') . '" alt="' . esc_attr(get_bloginfo('name')) . '" title="' . esc_attr(get_bloginfo('name')) . '">';
    } else {
        $logo = '<img id ="logo" src="' . get_stylesheet_directory_uri() . '/images/logo.png" alt="' . esc_attr(get_bloginfo('name')) . '" title="' . esc_attr(get_bloginfo('name')) . '">';
    }
    $inside = sprintf('<a href="%s" title="%s">%s</a>', trailingslashit(home_url()), esc_attr(get_bloginfo('name')), $logo);
    //* Determine which wrapping tags to use - changed is_home to is_front_page to fix Genesis bug
    $wrap = is_front_page() && 'title' === genesis_get_seo_option('home_h1_on') ? 'h1' : 'p';
    //* A little fallback, in case an SEO plugin is active - changed is_home to is_front_page to fix Genesis bug
    $wrap = is_front_page() && !genesis_get_seo_option('home_h1_on') ? 'h1' : $wrap;
    //* And finally, $wrap in h1 if HTML5 & semantic headings enabled
    $wrap = genesis_html5() && genesis_get_seo_option('semantic_headings') ? 'h1' : $wrap;
    return sprintf('<%1$s %2$s>%3$s</%1$s>', $wrap, genesis_attr('site-title'), $inside);
}
开发者ID:ngo6012,项目名称:socratic-genesis-starter-theme,代码行数:18,代码来源:bw-functions.php


示例14: genesis_upgrade

function genesis_upgrade()
{
    // Don't do anything if we're on the latest version
    if (version_compare(genesis_get_option('theme_version'), PARENT_THEME_VERSION, '>=')) {
        return;
    }
    #########################
    #	UPGRADE TO VERSION 1.0.1
    #########################
    // Check to see if we need to upgrade to 1.0.1
    if (version_compare(genesis_get_option('theme_version'), '1.0.1', '<')) {
        $theme_settings = get_option(GENESIS_SETTINGS_FIELD);
        $new_settings = array('nav_home' => 1, 'nav_twitter_text' => 'Follow me on Twitter', 'subnav_home' => 1, 'theme_version' => '1.0.1');
        $settings = wp_parse_args($new_settings, $theme_settings);
        update_option(GENESIS_SETTINGS_FIELD, $settings);
    }
    #########################
    #	UPGRADE TO VERSION 1.1
    #########################
    // Check to see if we need to upgrade to 1.1
    if (version_compare(genesis_get_option('theme_version'), '1.1', '<')) {
        $theme_settings = get_option(GENESIS_SETTINGS_FIELD);
        $new_settings = array('content_archive_thumbnail' => genesis_get_option('thumbnail'), 'theme_version' => '1.1');
        $settings = wp_parse_args($new_settings, $theme_settings);
        update_option(GENESIS_SETTINGS_FIELD, $settings);
    }
    #########################
    #	UPGRADE TO VERSION 1.1.2
    #########################
    // Check to see if we need to upgrade to 1.1.2
    if (version_compare(genesis_get_option('theme_version'), '1.1.2', '<')) {
        $theme_settings = get_option(GENESIS_SETTINGS_FIELD);
        $new_settings = array('header_right' => genesis_get_option('header_full') ? 0 : 1, 'nav_superfish' => 1, 'subnav_superfish' => 1, 'nav_extras_enable' => genesis_get_option('nav_right') ? 1 : 0, 'nav_extras' => genesis_get_option('nav_right'), 'nav_extras_twitter_id' => genesis_get_option('twitter_id'), 'nav_extras_twitter_text' => genesis_get_option('nav_twitter_text'), 'theme_version' => '1.1.2');
        $settings = wp_parse_args($new_settings, $theme_settings);
        update_option(GENESIS_SETTINGS_FIELD, $settings);
    }
    #########################
    #	UPGRADE TO VERSION 1.2
    #########################
    // Check to see if we need to upgrade to 1.2
    if (version_compare(genesis_get_option('theme_version'), '1.2', '<')) {
        $theme_settings = get_option(GENESIS_SETTINGS_FIELD);
        $new_settings = array('update' => 1, 'theme_version' => '1.2');
        $settings = wp_parse_args($new_settings, $theme_settings);
        update_option(GENESIS_SETTINGS_FIELD, $settings);
    }
    #########################
    #	UPGRADE TO VERSION 1.3
    #########################
    // Check to see if we need to upgrade to 1.3
    if (version_compare(genesis_get_option('theme_version'), '1.3', '<')) {
        //	upgrade theme settings
        $theme_settings = get_option(GENESIS_SETTINGS_FIELD);
        $new_settings = array('author_box_single' => genesis_get_option('author_box'), 'theme_version' => '1.3');
        $settings = wp_parse_args($new_settings, $theme_settings);
        update_option(GENESIS_SETTINGS_FIELD, $settings);
        //	upgrade SEO settings
        $seo_settings = get_option(GENESIS_SEO_SETTINGS_FIELD);
        $new_settings = array('noindex_cat_archive' => genesis_get_seo_option('index_cat_archive') ? 0 : 1, 'noindex_tag_archive' => genesis_get_seo_option('index_tag_archive') ? 0 : 1, 'noindex_author_archive' => genesis_get_seo_option('index_author_archive') ? 0 : 1, 'noindex_date_archive' => genesis_get_seo_option('index_date_archive') ? 0 : 1, 'noindex_search_archive' => genesis_get_seo_option('index_search_archive') ? 0 : 1, 'noodp' => 1, 'noydir' => 1, 'canonical_archives' => 1);
        $settings = wp_parse_args($new_settings, $seo_settings);
        update_option(GENESIS_SEO_SETTINGS_FIELD, $settings);
        //	delete the store transient, force refresh
        delete_transient('genesis-remote-store');
    }
    #########################
    #	UPGRADE TO VERSION 1.5
    #########################
    // Check to see if we need to upgrade to 1.5
    if (version_compare(genesis_get_option('theme_version'), '1.5', '<')) {
        $theme_settings = get_option(GENESIS_SETTINGS_FIELD);
        $new_settings = array('theme_version' => '1.5');
        $settings = wp_parse_args($new_settings, $theme_settings);
        update_option(GENESIS_SETTINGS_FIELD, $settings);
    }
    #########################
    #	REFRESH TO LOAD NEW DATA
    #########################
    wp_redirect(admin_url('admin.php?page=genesis&upgraded=true'));
    exit;
}
开发者ID:Weissenberger13,项目名称:web.portugalrentalcottages,代码行数:80,代码来源:upgrade.php


示例15: genesis_canonical

/**
 * Echo custom canonical link tag.
 *
 * Remove the default WordPress canonical tag, and use our custom
 * one. Gives us more flexibility and effectiveness.
 *
 * @since 0.1.3
 *
 * @uses genesis_get_seo_option() Get SEO setting value
 * @uses genesis_get_custom_field() Get custom field value
 *
 * @global WP_Query $wp_query
 * @return null Returns null on failure to determine queried object
 */
function genesis_canonical()
{
    /** Remove the WordPress canonical */
    remove_action('wp_head', 'rel_canonical');
    global $wp_query;
    $canonical = '';
    if (is_front_page()) {
        $canonical = trailingslashit(home_url());
    }
    if (is_singular()) {
        if (!($id = $wp_query->get_queried_object_id())) {
            return;
        }
        $cf = genesis_get_custom_field('_genesis_canonical_uri');
        $canonical = $cf ? $cf : get_permalink($id);
    }
    if (is_category() || is_tag() || is_tax()) {
        if (!($id = $wp_query->get_queried_object_id())) {
            return;
        }
        $taxonomy = $wp_query->queried_object->taxonomy;
        $canonical = genesis_get_seo_option('canonical_archives') ? get_term_link((int) $id, $taxonomy) : 0;
    }
    if (is_author()) {
        if (!($id = $wp_query->get_queried_object_id())) {
            return;
        }
        $canonical = genesis_get_seo_option('canonical_archives') ? get_author_posts_url($id) : 0;
    }
    if ($canonical) {
        printf('<link rel="canonical" href="%s" />' . "\n", esc_url(apply_filters('genesis_canonical', $canonical)));
    }
}
开发者ID:hscale,项目名称:webento,代码行数:47,代码来源:header.php


示例16: genesis_post_tags_link

/**
 * The Genesis-specific post tags link
 *
 * @since 0.2.3
 */
function genesis_post_tags_link($sep = ', ', $label = '')
{
    $label = !empty($label) ? trim($label) . ' ' : '';
    $links = get_the_tag_list($label, $sep);
    $links = genesis_get_seo_option('nofollow_tag_link') ? genesis_rel_nofollow($links) : $links;
    echo sprintf('<span class="tags">%s</span> ', $links);
}
开发者ID:Weissenberger13,项目名称:web.portugalrentalcottages,代码行数:12,代码来源:output_functions.php


示例17: genesis_seo_site_description

/**
 * Echo the site description into the header.
 *
 * Depending on the SEO option set by the user, this will either be wrapped in an `h1` or `p` element.
 *
 * Applies the `genesis_seo_description` filter before echoing.
 *
 * @since 1.1.0
 */
function genesis_seo_site_description()
{
    // Set what goes inside the wrapping tags.
    $inside = esc_html(get_bloginfo('description'));
    // Determine which wrapping tags to use.
    $wrap = genesis_is_root_page() && 'description' === genesis_get_seo_option('home_h1_on') ? 'h1' : 'p';
    // Wrap homepage site description in p tags if static front page.
    $wrap = is_front_page() && !is_home() ? 'p' : $wrap;
    // And finally, $wrap in h2 if HTML5 & semantic headings enabled.
    $wrap = genesis_html5() && genesis_get_seo_option('semantic_headings') ? 'h2' : $wrap;
    /**
     * Site description wrapping element
     *
     * The wrapping element for the site description.
     *
     * @since 2.2.3
     *
     * @param string $wrap The wrapping element (h1, h2, p, etc.).
     */
    $wrap = apply_filters('genesis_site_description_wrap', $wrap);
    // Build the description.
    $description = genesis_markup(array('open' => sprintf("<{$wrap} %s>", genesis_attr('site-description')), 'close' => "</{$wrap}>", 'content' => $inside, 'context' => 'site-description', 'echo' => false, 'params' => array('wrap' => $wrap)));
    // Output (filtered).
    $output = $inside ? apply_filters('genesis_seo_description', $description, $inside, $wrap) : '';
    echo $output;
}
开发者ID:netmagik,项目名称:netmagik,代码行数:35,代码来源:header.php


示例18: genesis_seo_settings_canonical_box

function genesis_seo_settings_canonical_box()
{
    ?>
	<p><?php 
    _e('Would you like to enable use of the canonical tag?', 'genesis');
    ?>
</p>
	<p><label><input type="radio" name="<?php 
    echo GENESIS_SEO_SETTINGS_FIELD;
    ?>
[enable_canonical]" value="1" <?php 
    checked(1, genesis_get_seo_option('enable_canonical'));
    ?>
 />
	<?php 
    _e('Yes', 'genesis');
    ?>
</label>
	<label><input type="radio" name="<?php 
    echo GENESIS_SEO_SETTINGS_FIELD;
    ?>
[enable_canonical]" value="0" <?php 
    checked(0, genesis_get_seo_option('enable_canonical'));
    ?>
 />
	<?php 
    _e('No', 'genesis');
    ?>
</label></p>
	<p><span class="description"><strong><?php 
    _e("Note: ", 'genesis');
    ?>
</strong><?php 
    _e('The Canonical Tag is used to inform search engines of the proper URL to index when they crawl your site.', 'genesis');
    ?>
</p>
<?php 
}
开发者ID:Weissenberger13,项目名称:web.portugalrentalcottages,代码行数:38,代码来源:seo_settings.php


示例19: genesis_seo_site_description

/**
 * Echo the site description into the header.
 *
 * Depending on the SEO option set by the user, this will either be wrapped in an `h1` or `p` element.
 *
 * Applies the `genesis_seo_description` filter before echoing.
 *
 * @since 1.1.0
 *
 * @uses genesis_get_seo_option() Get SEO setting value.
 * uses genesis_html5()           Check for HTML5 support.
 */
function genesis_seo_site_description()
{
    //* Set what goes inside the wrapping tags
    $inside = esc_html(get_bloginfo('description'));
    //* Determine which wrapping tags to use
    $wrap = is_home() && 'description' === genesis_get_seo_option('home_h1_on') ? 'h1' : 'p';
    //* And finally, $wrap in h2 if HTML5 & semantic headings enabled
    $wrap = genesis_html5() && genesis_get_seo_option('semantic_headings') ? 'h2' : $wrap;
    //* Build the description
    $description = genesis_html5() ? sprintf("<{$wrap} %s>", genesis_attr('site-description')) : sprintf('<%s id="description">%s</%s>', $wrap, $inside, $wrap);
    $description .= genesis_html5() ? "{$inside}</{$wrap}>" : '';
    //* Output (filtered)
    $output = $inside ? apply_filters('genesis_seo_description', $description, $inside, $wrap) : '';
    echo $output;
}
开发者ID:jpletner,项目名称:Avritek.Company.Site,代码行数:27,代码来源

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP genesis_has_post_type_archive_support函数代码示例发布时间:2022-05-15
下一篇:
PHP genesis_get_option函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap