本文整理汇总了PHP中is_front_page函数的典型用法代码示例。如果您正苦于以下问题:PHP is_front_page函数的具体用法?PHP is_front_page怎么用?PHP is_front_page使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了is_front_page函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: the_content
function the_content($content)
{
// Don't show on custom page templates
if (is_page_template()) {
return $content;
}
// Don't show on Stacked slides
if (get_post_type() == 'slide') {
return $content;
}
global $wp_current_filter;
if (in_array('get_the_excerpt', (array) $wp_current_filter)) {
return $content;
}
$cce_options = get_option('cce_options');
$show_on_posts = isset($cce_options['show_loveit_button_on']['post']) ? $cce_options['show_loveit_button_on']['post'] : FALSE;
$show_on_pages = isset($cce_options['show_loveit_button_on']['page']) ? $cce_options['show_loveit_button_on']['page'] : FALSE;
if (is_singular('post') && $show_on_posts) {
$content .= $this->do_likes('loveit-after-content');
}
if (is_page() && !is_front_page() && $show_on_pages) {
$content .= $this->do_likes('loveit-after-content');
}
//Under consideration: if(( is_front_page() || is_home() || is_category() || is_tag() || is_author() || is_date() || is_search()) && $options['add_to_other'] ) $content .= $this->do_likes();
return $content;
}
示例2: wpdocs_hack_wp_title_for_home
function wpdocs_hack_wp_title_for_home($title)
{
if (empty($title) && (is_home() || is_front_page())) {
$title = __(get_bloginfo('title'), 'textdomain') . ' | ' . get_bloginfo('description');
}
return $title;
}
示例3: spacious_scripts_styles_method
/**
* Register jquery scripts
*/
function spacious_scripts_styles_method()
{
/**
* Loads our main stylesheet.
*/
wp_enqueue_style('spacious_style', get_stylesheet_uri());
if (of_get_option('spacious_color_skin', 'light') == 'dark') {
wp_enqueue_style('spacious_dark_style', SPACIOUS_CSS_URL . '/dark.css');
}
/**
* Adds JavaScript to pages with the comment form to support
* sites with threaded comments (when in use).
*/
if (is_singular() && comments_open() && get_option('thread_comments')) {
wp_enqueue_script('comment-reply');
}
/**
* Register JQuery cycle js file for slider.
*/
wp_register_script('jquery_cycle', SPACIOUS_JS_URL . '/jquery.cycle.all.min.js', array('jquery'), '2.9999.5', true);
// wp_register_style( 'google_fonts', 'http://fonts.googleapis.com/css?family=Lato' );
/**
* Enqueue Slider setup js file.
*/
if (is_home() || is_front_page() && of_get_option('spacious_activate_slider', '0') == '1') {
wp_enqueue_script('spacious_slider', SPACIOUS_JS_URL . '/spacious-slider-setting.js', array('jquery_cycle'), false, true);
}
wp_enqueue_script('spacious-navigation', SPACIOUS_JS_URL . '/navigation.js', array('jquery'), false, true);
wp_enqueue_script('spacious-custom', SPACIOUS_JS_URL . '/spacious-custom.js', array('jquery'));
wp_enqueue_style('google_fonts');
$spacious_user_agent = strtolower($_SERVER['HTTP_USER_AGENT']);
if (preg_match('/(?i)msie [1-8]/', $spacious_user_agent)) {
wp_enqueue_script('html5', SPACIOUS_JS_URL . '/html5.js', true);
}
}
示例4: lifestyle_banner
function lifestyle_banner()
{
?>
<div class="banner">
<div class="wrap">
<?php
if (is_front_page()) {
lifestyle_get_home_banner();
} elseif (!is_front_page() && get_theme_mod('lifestyle_header_home')) {
echo '';
} else {
// get title
$id = get_option('page_for_posts');
if (is_home() || is_singular('post')) {
if (has_post_thumbnail($id)) {
echo get_the_post_thumbnail($id, 'full');
}
} elseif (has_post_thumbnail() && is_singular('page')) {
the_post_thumbnail();
}
}
?>
</div><!-- .wrap -->
</div><!-- .banner -->
<?php
}
示例5: dess_page_title
function dess_page_title($title)
{
if (empty($title) && (is_home() || is_front_page())) {
return __('Home', 'pro-blogg') . ' | ' . get_bloginfo('description');
}
return $title;
}
示例6: wpsp_page_header
/**
* Get custom page header template part, will apply on top of post/page
*/
function wpsp_page_header()
{
if (is_home() || is_front_page() || is_page_template('templates/homepage.php') || is_page_template('templates/contact.php')) {
return;
}
get_template_part('template-parts/page-header');
}
示例7: ieseg2_scripts
/**
* Enqueue scripts and styles for the front end.
*
* @since Twenty Fourteen 1.0
*/
function ieseg2_scripts()
{
//<link href='http://fonts.googleapis.com/css?family=Source+Sans+Pro:400,600,700,300,400italic' rel='stylesheet' type='text/css'>
// Add Source Sans.
wp_enqueue_style('ieseg-source-sans', 'http://fonts.googleapis.com/css?family=Source+Sans+Pro:400,600,700,300,400italic', array(), null);
// Add Genericons font, used in the main stylesheet.
//wp_enqueue_style( 'genericons', get_template_directory_uri() . '/genericons/genericons.css', array(), '3.0.2' );
// Load our main stylesheet.
//wp_enqueue_style( 'twentyfourteen-style', get_stylesheet_uri(), array( 'genericons' ) );
wp_enqueue_style('bootstrap', get_template_directory_uri() . '/css/bootstrap.min.css', false, '1.0');
wp_enqueue_style('bootstrap-theme', get_template_directory_uri() . '/css/bootstrap-theme.min.css', array('bootstrap'), '1.0');
wp_enqueue_style('animate', get_template_directory_uri() . '/css/animate.css', false, '1.0');
// utile pour wow.js
wp_enqueue_style('style-ieseg', get_template_directory_uri() . '/css/ieseg.min.css', array('bootstrap'), '1.0');
if (is_page(array(1766, 59))) {
wp_enqueue_style('style-timeline', get_template_directory_uri() . '/css/timeline.css');
}
//wp_enqueue_style('fancybox','/wp-content/themes/'.get_template().'/lib/fancybox/jquery.fancybox-1.3.4.css',false,'1.0');
// Load the Internet Explorer specific stylesheet.
//wp_enqueue_style( 'twentyfourteen-ie', get_template_directory_uri() . '/css/ie.css', array( 'twentyfourteen-style', 'genericons' ), '20131205' );
//wp_style_add_data( 'twentyfourteen-ie', 'conditional', 'lt IE 9' );
//BX slider
if (is_front_page() || is_page_template('template-page-programs.php')) {
wp_enqueue_script('bxslider', get_template_directory_uri() . '/js/jquery.bxslider.min.js', array('jquery'), '1.0', true);
wp_enqueue_style('style-bxslider', get_template_directory_uri() . '/css/jquery.bxslider.css', array('style-ieseg'), '1.0');
}
wp_enqueue_script('ieseg-script', get_template_directory_uri() . '/js/ieseg.js', array('jquery'), '1.0', true);
wp_enqueue_script('bootstrap-script', get_template_directory_uri() . '/js/bootstrap.min.js', array('jquery'), '1.0', true);
wp_enqueue_script('wow', get_template_directory_uri() . '/js/wow.min.js', array('jquery'), '1.0', true);
//wp_enqueue_script( 'responsive-nav', get_template_directory_uri() . '/js/responsive-nav.min.js', array( 'jquery' ), '1.0', true ); //menu de gauche responsive
if (is_page(array('mib-class-profile', 'mib-career-opportunities', 'mfm-student-profiles', 'msc-digital-marketing-crm-class-profile', 'msc-business-analysis-consulting-class-profile', 'msc-accounting-audit-control', 'msc-finance-class-profile', 'msc-banking-capital-markets-class-profile', 'msc-in-negotiation-for-organizations-class-profile', 'msc-big-data-analytics-business-class-profile', 'imba-class-profile', 'programme-grande-ecole', 33306, 33325))) {
wp_enqueue_script('classprofiles', get_bloginfo('template_directory') . '/js/classprofiles.js', array(), '1.1', true);
}
}
示例8: planar_content_width
function planar_content_width()
{
global $content_width;
if (is_front_page() || is_page_template('page-templates/page-fullwidth.php') || is_page_template('page-templates/homepage-one.php') || is_page_template('page-templates/page-childgrid.php')) {
$content_width = 1400;
}
}
示例9: widget
/**
* Outputs the content of the widget
*
* @param array $args
* @param array $instance
*/
function widget($args, $instance)
{
global $post, $oss_share_settings;
if (is_object($post)) {
$ossMeta = get_post_meta($post->ID, '_oss_meta', true);
// If sharing disabled on this page/post, return content unaltered.
if (isset($ossMeta['sharing']) && $ossMeta['sharing'] == 1 && !is_front_page()) {
return;
}
}
extract($args);
if ($instance['hide_for_logged_in'] == 1 && is_user_logged_in()) {
return;
}
echo $before_widget;
if (!empty($instance['before_widget_content'])) {
echo $instance['before_widget_content'];
}
OSS_Common_Sharing::horizontal_sharing();
echo '<div class="oss_horizontal_share"></div>';
if (!empty($instance['after_widget_content'])) {
echo $instance['after_widget_content'];
}
echo $after_widget;
}
示例10: jedlikowski_home_fix_title
/**
* Fix empty title attribute for homepage.
*
* @param string $title Original title, generated by WP.
* @return string Fixed title.
*/
function jedlikowski_home_fix_title($title)
{
if (empty($title) && (is_home() || is_front_page())) {
return get_bloginfo('name') . ' | ' . get_bloginfo('description');
}
return $title;
}
示例11: baw_hack_wp_title_for_home
function baw_hack_wp_title_for_home($title)
{
if (empty($title) && (is_home() || is_front_page())) {
return 'Início | ';
}
return $title;
}
示例12: degrona15_add_candidate_content
function degrona15_add_candidate_content()
{
if (is_front_page()) {
// If De_Grona_Ehdokas-plugin is installed, retrieve $instance of the plugin
if (function_exists('De_Grona_Ehdokas')) {
$instance = De_Grona_Ehdokas::instance();
if ($instance->get_candidate_data('degrona15_candidate_enable_home_page')) {
$bg_img_id = $instance->get_candidate_data('degrona15_candidate_site_jumbotron');
if ($bg_img_id) {
$bg_img = wp_get_attachment_image_src($bg_img_id, 'full');
} else {
$bg_img[0] = $instance->get_jumbtoron_default_bg();
}
$data = $instance->get_candidate_home_page_data();
?>
<div class='de_grona_candidate_jumbotron' style='background-image: url(<?php
echo $bg_img[0];
?>
);'>
<!-- <div class='row'> -->
<?php
echo $data;
?>
<!-- </div> -->
</div>
<?php
}
}
}
}
示例13: fre_logo
/**
* render site logo image get from option
* @author tam
* @return void
*/
function fre_logo($option_name = '')
{
if ($option_name == '') {
if (is_front_page()) {
$option_name = 'site_logo_white';
} else {
$option_name = 'site_logo_black';
}
}
switch ($option_name) {
case 'site_logo_black':
$img = get_template_directory_uri() . "/img/logo-fre-black.png";
break;
case 'site_logo_white':
$img = get_template_directory_uri() . "/img/logo-fre-white.png";
break;
default:
$img = get_template_directory_uri() . "/img/logo-fre-black.png";
break;
}
$options = AE_Options::get_instance();
// save this setting to theme options
$site_logo = $options->{$option_name};
if (!empty($site_logo)) {
$img = $site_logo['large'][0];
}
echo '<img alt="' . $options->blogname . '" src="' . $img . '" />';
}
示例14: airballoon_display_custom_header
function airballoon_display_custom_header()
{
// Get Theme Options from Database
$options = get_option('zeenoble_options');
// Don't display header image on template-frontpage.php
if (is_page_template('template-frontpage.php')) {
return;
}
// Don't display header image when "display frontpage template automatically on home page" option is activated
if (is_front_page() and isset($options['themeZee_frontpage_activate']) and $options['themeZee_frontpage_activate'] == 'true') {
return;
}
// Check if page is displayed and featured header image is used
if (is_page() && has_post_thumbnail()) {
?>
<div id="custom-header">
<?php
the_post_thumbnail('frontpage_slider_image');
?>
</div>
<?php
// Check if there is a custom header image
} elseif (get_header_image()) {
?>
<div id="custom-header">
<img src="<?php
echo get_header_image();
?>
" />
</div>
<?php
}
}
示例15: magee_breadcrumb
function magee_breadcrumb($options = "")
{
$this->options = array('before' => '<span class="arrow"> ', 'after' => ' </span>', 'delimiter' => ' / ');
if (is_array($options)) {
$this->options = array_merge($this->options, $options);
}
$markup = $this->options['before'] . $this->options['delimiter'] . $this->options['after'];
global $post;
echo '<p class="magee-breadcrumb"><a href="' . get_bloginfo('url') . '">';
_e("Home", 'magee');
echo "</a>";
if (!is_front_page()) {
echo $markup;
}
$output = $this->magee_simple_breadcrumb_case($post);
echo "<span class='current_crumb'>";
if (is_page() || is_single()) {
if (is_front_page()) {
echo $markup;
the_title();
} else {
the_title();
}
} else {
echo $output;
}
echo " </span></p>";
}