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


PHP yit_post_id函数代码示例

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


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

示例1: yit_get_meta_tags

    /**
     * Retrieve current page keywords and description and return them.
     *
     * @return string
     * @since 1.0.0
     */
    function yit_get_meta_tags()
    {
        global $post;
        ob_start();
        ?>
        <meta charset="<?php 
        bloginfo('charset');
        ?>
" />

        <?php 
        if (yit_get_option('responsive-enabled')) {
            ?>
            <!-- this line will appear only if the website is visited with an iPad -->
            <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.2, user-scalable=yes" />
        <?php 
        }
        ?>

        <?php 
        $post_type = isset($post->post_type) ? $post->post_type : '';
        $post_id = yit_post_id();
        yit_og_meta_tags($post_id);
        if ($post_id) {
            //Keywords and description use apposite SEO option
            $keywords = !empty($post_type) ? yit_get_post_meta($post_id, '_seo-keywords') : '';
            $description = !empty($post_type) ? yit_get_post_meta($post_id, '_seo-description') : '';
            $keywords = empty($keywords) ? yit_get_option($post_type . '-seo-keywords') : $keywords;
            $keywords = empty($keywords) ? yit_get_option('seo-keywords') : $keywords;
            $description = empty($description) ? yit_get_option($post_type . '-seo-description') : $description;
            $description = empty($description) ? yit_get_option('seo-description') : $description;
            if (!empty($keywords)) {
                ?>
<meta name="keywords" content="<?php 
                echo $keywords;
                ?>
" /><?php 
            }
            if (!empty($description)) {
                ?>
<meta name="description" content="<?php 
                echo $description;
                ?>
" /><?php 
            }
        }
        ?>

        <?php 
        return ob_get_clean();
    }
开发者ID:eugenehiggins,项目名称:wellnessrx,代码行数:57,代码来源:functions-template.php

示例2: yit_get_post_meta

<?php

/**
 * Your Inspiration Themes
 * 
 * @package WordPress
 * @subpackage Your Inspiration Themes
 * @author Your Inspiration Themes Team <info@yithemes.com>
 *
 * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
 * that is bundled with this package in the file LICENSE.txt.
 * It is also available through the world-wide-web at this URL:
 * http://www.gnu.org/licenses/gpl-3.0.txt
 */
$bg_slider = yit_get_post_meta(yit_post_id(), '_bg_slider');
echo do_shortcode('[slider name="' . $bg_slider . '"]');
开发者ID:jayeshnair,项目名称:ctp,代码行数:16,代码来源:bg-slider.php

示例3: yit_body_background

    /**
     * Define the body background for the page. 
     * 
     * First get the setting for the current page. If a setting is not defined 
     * in the current page, will be get the setting from the theme options.
     * All css will be shown in head tag, by the action 'wp_head'                    
     * 
     * @since 1.0.0
     */
    function yit_body_background()
    {
        $post_id = yit_post_id();
        // get color and background from postmeta
        $color = yit_get_post_meta($post_id, '_bg_color', true);
        $image = yit_get_post_meta($post_id, '_bg_image', true);
        // get the color and background from theme options, if above are empty
        $background = yit_get_option('background-style');
        if (empty($image) && empty($color)) {
            $image = $background['image'];
            if ($image == 'custom') {
                $image = yit_get_option('bg_image');
            }
        }
        if (empty($color)) {
            $color = $background['color'];
        }
        $image_repeat = yit_get_option('bg_image_repeat');
        $image_position = yit_get_option('bg_image_position');
        $image_attachment = yit_get_option('bg_image_attachment');
        $css = array();
        if (!empty($color)) {
            $css[] = "background-color: {$color};";
        }
        if (!empty($image) && $image != 'none') {
            $css[] = "background-image: url('{$image}');";
        }
        if (!empty($image) && !empty($image_repeat)) {
            $css[] = "background-repeat: {$image_repeat};";
        }
        if (!empty($image) && !empty($image_position)) {
            $css[] = "background-position: {$image_position};";
        }
        if (!empty($image) && !empty($image_attachment)) {
            $css[] = "background-attachment: {$image_attachment};";
        }
        if (empty($css)) {
            return;
        }
        ?>
        <style type="text/css">
            body { <?php 
        echo implode(' ', $css);
        ?>
 }      
        </style>
        <?php 
    }
开发者ID:jayeshnair,项目名称:ctp,代码行数:57,代码来源:functions-core.php

示例4: yit_post_id

 * Your Inspiration Themes
 * 
 * @package WordPress
 * @subpackage Your Inspiration Themes
 * @author Your Inspiration Themes Team <info@yithemes.com>
 *
 * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
 * that is bundled with this package in the file LICENSE.txt.
 * It is also available through the world-wide-web at this URL:
 * http://www.gnu.org/licenses/gpl-3.0.txt
 */
global $post;
if (!isset($post->ID)) {
    return;
}
$post_id = yit_post_id();
$show_title = is_page() ? yit_get_post_meta($post_id, '_show-title') : false;
$show_breadcrumb = is_page() ? yit_get_post_meta($post_id, '_show-breadcrumb') : (bool) yit_get_option('breadcrumb');
if ($show_title || $show_breadcrumb) {
    $tag_title = apply_filters('yit_page_slogan_tag', 'h1');
    ?>
<!-- START PAGE META -->
<div id="page-meta" class="group margin-top">
	<div class="container">
	<div class="row">
		<div class="span12">
    <?php 
    if ($show_title) {
        ?>
        <!-- TITLE -->
        <div class="title">
开发者ID:shahadat014,项目名称:geleyi,代码行数:31,代码来源:page-meta.php

示例5: yit_get_sidebar_setting

 /**
  * Retrieve the sidebar settings for the current post.
  * 
  * @param string $setting
  * @return string
  * @since 1.0.0
  */
 function yit_get_sidebar_setting()
 {
     global $post, $yit_sidebar_layout;
     global $wp_query;
     $post_id = yit_post_id();
     if (empty($post_id) || is_category() || is_archive() || is_search()) {
         $yit_sidebar_layout = yit_get_standard_sidebar();
         return;
     } else {
         $sidebar_layout = yit_get_post_meta($post_id, '_sidebar-layout');
         if (!empty($sidebar_layout) && isset($sidebar_layout['sidebar']) && $sidebar_layout['sidebar'] != -1 || isset($sidebar_layout["layout"]) && $sidebar_layout["layout"] == 'sidebar-no') {
             $yit_sidebar_layout = $sidebar_layout;
         } else {
             $yit_sidebar_layout = yit_get_standard_sidebar();
         }
     }
 }
开发者ID:allyeastman,项目名称:studio-sapphire,代码行数:24,代码来源:functions-template.php

示例6: yit_get_title

 /**
  * Create the title of the current page based on SEO options.
  *
  * @return string
  * @since 1.0.0
  */
 function yit_get_title()
 {
     global $post, $page, $paged;
     if (!function_exists('is_plugin_active')) {
         require_once ABSPATH . "/wp-admin/includes/plugin.php";
     }
     $post_type = isset($post->post_type) ? $post->post_type : '';
     $post_id = yit_post_id();
     if ($post_id) {
         //Title uses apposite SEO option. If it is empty, the normal title will be used.
         if (!empty($post_type)) {
             $title = yit_get_post_meta($post_id, '_seo-title');
         }
         if (empty($title)) {
             $title = yit_get_option($post_type . '-seo-title');
         }
         if (empty($title)) {
             $title = yit_get_option('seo-title');
         }
         if (empty($title)) {
             $title = wp_title('|', false, 'right');
             if (!is_plugin_active('wordpress-seo/wp-seo.php')) {
                 if (!is_home() && !is_front_page()) {
                     $title .= ' | ';
                 }
                 $title .= yit_remove_chars_title(get_bloginfo('name'));
                 // Add description, if is home
                 if (is_home() || is_front_page()) {
                     $title .= ' | ' . yit_remove_chars_title(get_bloginfo('description'));
                 }
             }
         }
     } else {
         $title = wp_title('|', false, 'right');
         $title .= yit_remove_chars_title(get_bloginfo('name'));
         if (!is_plugin_active('wordpress-seo/wp-seo.php')) {
             // Add description, if is home
             if (is_home() || is_front_page()) {
                 $title .= ' | ' . yit_remove_chars_title(get_bloginfo('description'));
             }
         }
     }
     // Add a page number if necessary:
     if ($paged >= 2 || $page >= 2) {
         $title .= ' | ' . sprintf(__('Page %s', 'yit'), max($paged, $page));
     }
     return apply_filters('yit_title', $title);
 }
开发者ID:zgomotos,项目名称:Bazar,代码行数:54,代码来源:functions-template.php

示例7: yit_load_bg_slider

 function yit_load_bg_slider()
 {
     $bg_slider = yit_get_post_meta(yit_post_id(), '_bg_slider');
     if (empty($bg_slider) || $bg_slider == 'none') {
         return;
     }
     yit_add_body_class('background-slider');
     add_action('wp_head', 'yit_bg_slider');
 }
开发者ID:allyeastman,项目名称:studio-sapphire,代码行数:9,代码来源:functions-template.php

示例8: yit_slider_name

/** 
 * Get the name of the slider defined in the page          
 *  
 * @return string
 * 
 * @since 1.0  
 */  
function yit_slider_name() {
    global $post, $wp_query;    
    $slider = '';   
    
    $post_id = yit_post_id();            
                                                           
    if ( $post_id != 0 )
        $slider = get_post_meta( $post_id, '_slider_name', true );   
        
    if ( empty( $slider ) && ! $wp_query->is_posts_page && ( is_home() || is_front_page() ) ) {
        $slider = yit_get_option( 'slider_name', 'none' );       
	}
                                 
    if ( empty( $slider ) ) 
        $slider = 'none'; 
    
    return $slider;
}   
开发者ID:simonsays88,项目名称:costa,代码行数:25,代码来源:Slider.php


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