当前位置: 首页>>代码示例>>PHP>>正文


PHP post_type_archive_title函数代码示例

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


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

示例1: kkthemes_archive_title

function kkthemes_archive_title()
{
    $tag_style = '';
    $header_image = get_header_image();
    if (!empty($header_image)) {
        $tag_style = 'background-image: url(' . esc_url($header_image) . ');';
    }
    ?>
	<div class="uk-panel uk-panel-box uk-panel-space uk-text-large uk-text-center tm-branded-panel uk-margin-large-bottom" style="<?php 
    echo $tag_style;
    ?>
">
		<h1 class="uk-article-title" itemprop="headline">
			<?php 
    single_cat_title('') || post_type_archive_title('');
    ?>
		</h1>
		<?php 
    if (is_featured_item()) {
        $post_type = get_post_type();
        echo '<p>' . get_post_type_object($post_type)->description . '</p>';
    } else {
        echo category_description();
    }
    ?>
	</div>
<?php 
}
开发者ID:kkthemes,项目名称:kkthemes,代码行数:28,代码来源:index.php

示例2: get_the_archive_title_callback_wpbss

/**
 * Change for `the_archive_title()`.
 *
 * Display the archive title based on the queried object.
 */
function get_the_archive_title_callback_wpbss($title)
{
    if (is_post_type_archive()) {
        return post_type_archive_title('', false);
    }
    return $title;
}
开发者ID:systemo-biz,项目名称:wpbss2,代码行数:12,代码来源:extras.php

示例3: archive_title

 public static function archive_title()
 {
     $title = apply_filters('fp-team-archive-title-text', post_type_archive_title('', false));
     echo '<div class="large-12 columns center-text fp-team-title-container">';
     echo '<h1>' . $title . '</h1>';
     echo '</div>';
 }
开发者ID:CodeProKid,项目名称:fruitpack,代码行数:7,代码来源:class.hooks.php

示例4: uls_get_link

/**
 * Return the HTML link of the translation of a post.
 *
 * @param $post_id integer id of post.
 * @param $language string language of translation. If it is null or invalid, current language loaded in the page is used.
 * @param $label string inner text of the link.
 * @param $class string text to include as class parameter in the link
 *
 * @return string the HTML link of the translation link of a post.
 */
function uls_get_link($post_id = null, $language = null, $label = null, $class = 'uls-link')
{
    if ($post_id == null) {
        if (is_home()) {
            $url = get_home_url();
            $translation_url = uls_get_url_translated($url, $language);
        } else {
            if (is_archive()) {
                $url = get_post_type_archive_link(get_post_type());
                $translation_url = uls_get_url_translated($url, $language);
                $title = post_type_archive_title("", false);
            }
        }
    } else {
        $translation_id = uls_get_post_translation_id($post_id, $language);
        if (empty($translation_id)) {
            $translation_id = $post_id;
        }
        //set conversion of permalinks to false
        global $uls_permalink_convertion;
        $uls_permalink_convertion = false;
        $translation_url = uls_get_url_translated(get_permalink($translation_id), $language);
        //set conversion of permalinks to true again
        $uls_permalink_convertion = true;
        $title = get_the_title($translation_id);
    }
    // echo $translation_url;
    if (null == $label) {
        return '<a class="' . $class . '" href="' . $translation_url . '" >' . $title . '</a>';
    } else {
        return '<a class="' . $class . '" href="' . $translation_url . '" >' . $label . '</a>';
    }
}
开发者ID:Juni4567,项目名称:mycashflow,代码行数:43,代码来源:uls-functions.php

示例5: ref_custom_archive_title

 function ref_custom_archive_title($title)
 {
     if (is_post_type_archive()) {
         $title = post_type_archive_title('', false);
     }
     return $title;
 }
开发者ID:twelch555,项目名称:core_toolsetstarter,代码行数:7,代码来源:functions.php

示例6: calibrefx_og_title

/**
 * Output the title
 *
 * @return string $title
 */
function calibrefx_og_title()
{
    global $post, $wp_locale, $wp_query;
    $title = '';
    if (is_home() || is_front_page()) {
        $title = get_bloginfo('name');
    } elseif (is_singular()) {
        $title = stripslashes(esc_attr($post->post_title)) . ' - ' . get_bloginfo('name');
    } elseif (is_archive()) {
        if (is_category()) {
            $category = get_term(get_query_var('cat'), 'category');
            $title = __('Archive for ', 'calibrefx') . $category->name . ' - ' . get_bloginfo('name');
        } elseif (is_tax()) {
            $term = $wp_query->get_queried_object();
            $taxonomy = get_term($term->term_id, $term->taxonomy);
            $title = __('Archive for ', 'calibrefx') . $taxonomy->name . ' - ' . get_bloginfo('name');
        } elseif (is_year()) {
            $title = __('Archive for ', 'calibrefx') . get_query_var('year') . ' - ' . get_bloginfo('name');
        } elseif (is_month()) {
            $title = __('Archive for ', 'calibrefx') . $wp_locale->get_month(get_query_var('monthnum')) . ' ' . get_query_var('year') . ' - ' . get_bloginfo('name');
        } elseif (is_day()) {
            $title = __('Archive for ', 'calibrefx') . get_query_var('day') . ' ' . $wp_locale->get_month(get_query_var('monthnum')) . ' ' . get_query_var('year') . ' - ' . get_bloginfo('name');
        } elseif (is_author()) {
            $title = __('Archive for ', 'calibrefx') . $wp_query->queried_object->display_name . ' - ' . get_bloginfo('name');
        } elseif (is_post_type_archive()) {
            $title = __('Archive for ', 'calibrefx') . post_type_archive_title('', false) . ' - ' . get_bloginfo('name');
        }
    } elseif (is_404()) {
        $title = __('Not Found', 'calibrefx') . ' - ' . get_bloginfo('name');
    }
    return apply_filters('calibrefx_og_title', $title);
}
开发者ID:alispx,项目名称:calibrefx,代码行数:37,代码来源:opengraph-helper.php

示例7: seventeen_filter_archive_title

/**
 * Filter the output of the archive title
 */
function seventeen_filter_archive_title($title)
{
    if (is_post_type_archive('artists')) {
        $title = post_type_archive_title('', false);
    }
    return $title;
}
开发者ID:psflannery,项目名称:seventeen,代码行数:10,代码来源:extras.php

示例8: ubik_title_archives

function ubik_title_archives()
{
    if (is_category()) {
        $title = sprintf(__('%s archives', 'ubik'), single_cat_title('', false));
    } elseif (is_tag()) {
        $title = sprintf(__('%s archives', 'ubik'), single_tag_title('', false));
    } elseif (is_tax()) {
        $title = sprintf(__('%s archives', 'ubik'), single_term_title('', false));
    } elseif (is_post_type_archive()) {
        $title = sprintf(__('%s archives', 'ubik'), post_type_archive_title('', false));
    } elseif (is_author()) {
        $title = sprintf(__('Posts by %s', 'ubik'), get_the_author_meta('display_name', get_query_var('author')));
    } elseif (is_date()) {
        if (get_query_var('second') || get_query_var('minute') || get_query_var('hour')) {
            $title = sprintf(__('%s archives', 'ubik'), get_the_time(__('g:i a', 'ubik')));
        } elseif (is_day()) {
            $title = sprintf(__('%s daily archives', 'ubik'), get_the_date(_x('F j, Y', 'daily archives date format', 'ubik')));
        } elseif (get_query_var('w')) {
            $title = sprintf(__('Week %1$s of %2$s archives', 'ubik'), get_the_time(__('W', 'ubik')), get_the_time(__('Y', 'ubik')));
        } elseif (is_month()) {
            $title = sprintf(__('%s monthly archives', 'ubik'), get_the_date(_x('F Y', 'monthly archives date format', 'ubik')));
        } elseif (is_year()) {
            $title = sprintf(__('%s yearly archives', 'ubik'), get_the_date(_x('Y', 'yearly archives date format', 'ubik')));
        } else {
            $title = get_the_date();
        }
    } else {
        $title = __('Archives', 'ubik');
    }
    return apply_filters('ubik_title_archives', $title);
}
开发者ID:synapticism,项目名称:ubik-title,代码行数:31,代码来源:ubik-title-core.php

示例9: kleo_title

/**
 *  Return the Page title string
 */
function kleo_title()
{
    $output = "";
    if (is_tag()) {
        $output = __('Tag Archive for:', 'kleo_framework') . " " . single_tag_title('', false);
    } elseif (is_tax()) {
        $term = get_term_by('slug', get_query_var('term'), get_query_var('taxonomy'));
        $output = $term->name;
    } elseif (is_category()) {
        // Remove Archive for Category: as per Lloyd request
        // $output = __('Archive for category:', 'kleo_framework') . " " . single_cat_title('', false);
        $output = single_cat_title('', false);
    } elseif (is_day()) {
        $output = __('Archive for date:', 'kleo_framework') . " " . get_the_time('F jS, Y');
    } elseif (is_month()) {
        $output = __('Archive for month:', 'kleo_framework') . " " . get_the_time('F, Y');
    } elseif (is_year()) {
        $output = __('Archive for year:', 'kleo_framework') . " " . get_the_time('Y');
    } elseif (is_author()) {
        $curauth = get_query_var('author_name') ? get_user_by('slug', get_query_var('author_name')) : get_userdata(get_query_var('author'));
        $output = __('Author Archive', 'kleo_framework') . " ";
        if (isset($curauth->nickname)) {
            $output .= __('for:', 'kleo_framework') . " " . $curauth->nickname;
        }
    } elseif (is_archive()) {
        $output = post_type_archive_title('', false);
    } elseif (is_search()) {
        global $wp_query;
        if (!empty($wp_query->found_posts)) {
            if ($wp_query->found_posts > 1) {
                $output = $wp_query->found_posts . " " . __('search results for:', 'kleo_framework') . " " . esc_attr(get_search_query());
            } else {
                $output = $wp_query->found_posts . " " . __('search result for:', 'kleo_framework') . " " . esc_attr(get_search_query());
            }
        } else {
            if (!empty($_GET['s'])) {
                $output = __('Search results for:', 'kleo_framework') . " " . esc_attr(get_search_query());
            } else {
                $output = __('To search the site please enter a valid term', 'kleo_framework');
            }
        }
    } elseif (is_front_page() && !is_home()) {
        $output = get_the_title(get_option('page_on_front'));
    } elseif (is_home()) {
        if (get_option('page_for_posts')) {
            $output = get_the_title(get_option('page_for_posts'));
        } else {
            $output = __('Blog', 'kleo_framework');
        }
    } elseif (is_404()) {
        $output = __('Error 404 - Page not found', 'kleo_framework');
    } else {
        $output = get_the_title();
    }
    if (isset($_GET['paged']) && !empty($_GET['paged'])) {
        $output .= " (" . __('Page', 'kleo_framework') . " " . $_GET['paged'] . ")";
    }
    return $output;
}
开发者ID:divemasterza,项目名称:Checkedin,代码行数:62,代码来源:functions.php

示例10: jawsdays_get_the_archive_title

/**
 * Filter the archive title..
 *
 * @param string $title Archive title to be displayed.
 * @return string
 */
function jawsdays_get_the_archive_title($title)
{
    if (is_category()) {
        $title = single_cat_title('', false);
    } elseif (is_post_type_archive()) {
        $title = post_type_archive_title('', false);
    }
    return $title;
}
开发者ID:jaws-ug,项目名称:jawsdays2016,代码行数:15,代码来源:extras.php

示例11: illdy_archive_title

 function illdy_archive_title($before = '', $after = '')
 {
     if (is_category()) {
         $title = sprintf(esc_html__('Category: %s', 'illdy'), single_cat_title('', false));
     } elseif (is_tag()) {
         $title = sprintf(esc_html__('Tag: %s', 'illdy'), single_tag_title('', false));
     } elseif (is_author()) {
         $title = sprintf(esc_html__('Author: %s', 'illdy'), '<span class="vcard">' . get_the_author() . '</span>');
     } elseif (is_year()) {
         $title = sprintf(esc_html__('Year: %s', 'illdy'), get_the_date(esc_html_x('Y', 'yearly archives date format', 'illdy')));
     } elseif (is_month()) {
         $title = sprintf(esc_html__('Month: %s', 'illdy'), get_the_date(esc_html_x('F Y', 'monthly archives date format', 'illdy')));
     } elseif (is_day()) {
         $title = sprintf(esc_html__('Day: %s', 'illdy'), get_the_date(esc_html_x('F j, Y', 'daily archives date format', 'illdy')));
     } elseif (is_tax('post_format')) {
         if (is_tax('post_format', 'post-format-aside')) {
             $title = esc_html_x('Asides', 'post format archive title', 'illdy');
         } elseif (is_tax('post_format', 'post-format-gallery')) {
             $title = esc_html_x('Galleries', 'post format archive title', 'illdy');
         } elseif (is_tax('post_format', 'post-format-image')) {
             $title = esc_html_x('Images', 'post format archive title', 'illdy');
         } elseif (is_tax('post_format', 'post-format-video')) {
             $title = esc_html_x('Videos', 'post format archive title', 'illdy');
         } elseif (is_tax('post_format', 'post-format-quote')) {
             $title = esc_html_x('Quotes', 'post format archive title', 'illdy');
         } elseif (is_tax('post_format', 'post-format-link')) {
             $title = esc_html_x('Links', 'post format archive title', 'illdy');
         } elseif (is_tax('post_format', 'post-format-status')) {
             $title = esc_html_x('Statuses', 'post format archive title', 'illdy');
         } elseif (is_tax('post_format', 'post-format-audio')) {
             $title = esc_html_x('Audio', 'post format archive title', 'illdy');
         } elseif (is_tax('post_format', 'post-format-chat')) {
             $title = esc_html_x('Chats', 'post format archive title', 'illdy');
         }
     } elseif (is_post_type_archive()) {
         $title = sprintf(esc_html__('Archives: %s', 'illdy'), post_type_archive_title('', false));
     } elseif (is_tax()) {
         $tax = get_taxonomy(get_queried_object()->taxonomy);
         /* translators: 1: Taxonomy singular name, 2: Current taxonomy term */
         $title = sprintf(esc_html__('%1$s: %2$s', 'illdy'), $tax->labels->singular_name, single_term_title('', false));
     } else {
         $title = esc_html__('Archives', 'illdy');
     }
     /**
      * Filter the archive title.
      *
      * @param string $title Archive title to be displayed.
      */
     $title = apply_filters('get_the_archive_title', $title);
     if (!empty($title)) {
         echo $before . $title . $after;
         // WPCS: XSS OK.
     }
 }
开发者ID:robertoperata,项目名称:bbqverona.com,代码行数:54,代码来源:template-tags.php

示例12: setup

function setup()
{
    global $redux_demo;
    $options = $redux_demo;
    add_theme_support('soil-clean-up');
    // Enable clean up from Soil
    add_theme_support('soil-relative-urls');
    // Enable relative URLs from Soil
    add_theme_support('soil-nice-search');
    // Enable nice search from Soil
    add_theme_support('soil-google-analytics', $options['google-analytics-id']);
    // Enable Google Analytics
    //add_theme_support('soil-jquery-cdn');     // Enable jQuery from the Google CDN
    //add_theme_support('soil-js-to-footer');   // Enable js to footer
    add_theme_support('soil-nav-walker');
    // Enable clean nav walker
    add_theme_support('bootstrap-gallery');
    // Enable Bootstrap Gallery
    // Make theme available for translation
    // Community translations can be found at https://github.com/roots/sage-translations
    load_theme_textdomain('sage', get_template_directory() . '/lang');
    // Enable plugins to manage the document title
    // http://codex.wordpress.org/Function_Reference/add_theme_support#Title_Tag
    add_theme_support('title-tag');
    // Register wp_nav_menu() menus
    // http://codex.wordpress.org/Function_Reference/register_nav_menus
    register_nav_menus(['primary_navigation' => __('Primary Navigation', 'sage')]);
    // Add post thumbnails
    // http://codex.wordpress.org/Post_Thumbnails
    // http://codex.wordpress.org/Function_Reference/set_post_thumbnail_size
    // http://codex.wordpress.org/Function_Reference/add_image_size
    add_theme_support('post-thumbnails');
    //update_option( 'medium_crop', 1 ); //Turn on image crop at medium size
    // Add post formats
    // http://codex.wordpress.org/Post_Formats
    //add_theme_support('post-formats', ['aside', 'gallery', 'link', 'image', 'quote', 'video', 'audio']);
    // Add HTML5 markup for captions
    // http://codex.wordpress.org/Function_Reference/add_theme_support#HTML5
    add_theme_support('html5', ['caption', 'comment-form', 'comment-list', 'gallery', 'search-form']);
    // Tell the TinyMCE editor to use a custom stylesheet
    add_editor_style(Assets\asset_path('styles/editor-style.css'));
    // Allow shortcode execution in widgets
    add_filter('widget_text', 'do_shortcode');
    // Gets rid of the word "Archive:" in front of the Archive title
    add_filter('get_the_archive_title', function ($title) {
        if (is_post_type_archive()) {
            $title = post_type_archive_title();
        }
        return $title;
    });
    //remove_filter( 'the_content', 'wpautop' );
}
开发者ID:rku4er,项目名称:kie-wp,代码行数:52,代码来源:setup.php

示例13: sketch_portfolio_title

/**
 * Portfolio Title.
 */
function sketch_portfolio_title($before = '', $after = '')
{
    $jetpack_portfolio_title = get_option('jetpack_portfolio_title');
    $title = '';
    if (is_post_type_archive('jetpack-portfolio')) {
        if (isset($jetpack_portfolio_title) && '' != $jetpack_portfolio_title) {
            $title = esc_html($jetpack_portfolio_title);
        } else {
            $title = post_type_archive_title('', false);
        }
    } elseif (is_tax('jetpack-portfolio-type') || is_tax('jetpack-portfolio-tag')) {
        $title = single_term_title('', false);
    }
    echo $before . $title . $after;
}
开发者ID:mfojtik,项目名称:elisinwonderland,代码行数:18,代码来源:jetpack.php

示例14: omega_wp_title

/**
 * Filters the `wp_title` output early.
 *
 * @since  0.9.0
 * @access publc
 * @param  string  $title
 * @param  string  $separator
 * @param  string  $seplocation
 * @return string
 */
function omega_wp_title($title, $separator, $seplocation)
{
    if (is_front_page()) {
        $doctitle = get_bloginfo('name') . $separator . ' ' . get_bloginfo('description');
    } elseif (is_home() || is_singular()) {
        $doctitle = single_post_title('', false);
    } elseif (is_category()) {
        $doctitle = single_cat_title('', false);
    } elseif (is_tag()) {
        $doctitle = single_tag_title('', false);
    } elseif (is_tax()) {
        $doctitle = single_term_title('', false);
    } elseif (is_post_type_archive()) {
        $doctitle = post_type_archive_title('', false);
    } elseif (is_author()) {
        $doctitle = get_the_author_meta('display_name', get_query_var('author'));
    } elseif (get_query_var('minute') && get_query_var('hour')) {
        $doctitle = omega_single_minute_hour_title('', false);
    } elseif (get_query_var('minute')) {
        $doctitle = omega_single_minute_title('', false);
    } elseif (get_query_var('hour')) {
        $doctitle = omega_single_hour_title('', false);
    } elseif (is_day()) {
        $doctitle = omega_single_day_title('', false);
    } elseif (get_query_var('w')) {
        $doctitle = omega_single_week_title('', false);
    } elseif (is_month()) {
        $doctitle = single_month_title(' ', false);
    } elseif (is_year()) {
        $doctitle = omega_single_year_title('', false);
    } elseif (is_archive()) {
        $doctitle = omega_single_archive_title('', false);
    } elseif (is_search()) {
        $doctitle = omega_search_title('', false);
    } elseif (is_404()) {
        $doctitle = omega_404_title('', false);
    } else {
        $doctitle = '';
    }
    /* If the current page is a paged page. */
    if ((($page = get_query_var('paged')) || ($page = get_query_var('page'))) && $page > 1) {
        /* Translators: 1 is the page title. 2 is the page number. */
        $doctitle = sprintf(__('%1$s Page %2$s', 'omega'), $doctitle . $separator, number_format_i18n(absint($page)));
    }
    /* Trim separator + space from beginning and end. */
    $doctitle = trim($doctitle, "{$separator} ");
    return $doctitle;
}
开发者ID:javipaur,项目名称:TiendaVirtual,代码行数:58,代码来源:head.php

示例15: flegondavid_the_tagline

 function flegondavid_the_tagline($tagline = '')
 {
     if ('blank' === get_header_textcolor()) {
         return '';
     }
     if (is_home() || is_front_page()) {
         $tagline = get_bloginfo('description');
     } elseif (is_archive()) {
         $tagline = post_type_archive_title('', false);
     } elseif (is_search()) {
         $_format = __('Search results for %s');
         $tagline = sprintf($_format, get_search_query());
     } else {
         $tagline = get_the_title();
     }
     return $tagline;
 }
开发者ID:jimmyandrade,项目名称:flegondavid.com.br,代码行数:17,代码来源:template-tags.php


注:本文中的post_type_archive_title函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。