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


PHP get_cfield函数代码示例

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


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

示例1: kleo_title

$title_arr['title'] = kleo_title();
//hide title?
$title_arr['show_title'] = true;
if (get_cfield('title_checkbox') == 1) {
    $title_arr['show_title'] = false;
}
//If we are displaying the title in the main area, not the breadcrumb area
if (sq_option('title_location', 'breadcrumb') == 'main') {
    $title_arr['show_title'] = false;
}
//hide breadcrumb?
$title_arr['show_breadcrumb'] = true;
if (sq_option('breadcrumb_status', 1) == 0) {
    $title_arr['show_breadcrumb'] = false;
}
if (get_cfield('hide_breadcrumb') == 1) {
    $title_arr['show_breadcrumb'] = false;
} else {
    if (get_cfield('hide_breadcrumb') === '0') {
        $title_arr['show_breadcrumb'] = true;
    }
}
//extra info
if (get_cfield('hide_info') == 1 || sq_option('title_info', '') == '') {
    $show_info = FALSE;
} else {
    $show_info = TRUE;
}
if (isset($title_arr['show_breadcrumb']) && $title_arr['show_breadcrumb'] || $show_info === TRUE || $title_arr['show_title']) {
    echo kleo_title_section($title_arr);
}
开发者ID:6226,项目名称:wp,代码行数:31,代码来源:general-title-section.php

示例2: add_filter

?>

<?php 
//Specific class for post listing */
if (kleo_postmeta_enabled()) {
    $meta_status = ' with-meta';
    add_filter('kleo_main_template_classes', create_function('$cls', '$cls .= "' . $meta_status . '"; return $cls;'));
}
/* Related posts logic */
$related = sq_option('related_posts', 1);
if (!is_singular('post')) {
    $related = sq_option('related_custom_posts', 0);
}
//post setting
if (get_cfield('related_posts') != '') {
    $related = get_cfield('related_posts');
}
?>

<?php 
get_template_part('page-parts/general-title-section');
?>

<?php 
get_template_part('page-parts/general-before-wrap');
?>

<?php 
/* Start the Loop */
while (have_posts()) {
    the_post();
开发者ID:quyip8818,项目名称:wps,代码行数:31,代码来源:single.php

示例3: get_option

    $show_info = TRUE;
}
//If we have designated a page for latest posts like Blog page
if (get_option('page_for_posts')) {
    $blogpage_id = get_option('page_for_posts');
    $page_title = get_the_title($blogpage_id);
    if (get_cfield('title_checkbox', $blogpage_id) == 1) {
        $title_arr['show_title'] = false;
    }
    if (get_cfield('hide_info', $blogpage_id) == 1) {
        $show_info = FALSE;
    }
    if (get_cfield('hide_breadcrumb', $blogpage_id) == 1) {
        $title_arr['show_breadcrumb'] = false;
    } else {
        if (get_cfield('hide_breadcrumb', $blogpage_id) === '0') {
            $title_arr['show_breadcrumb'] = true;
        }
    }
}
$title_arr['title'] = $page_title;
if (isset($title_arr['show_breadcrumb']) && $title_arr['show_breadcrumb'] || $show_info === TRUE || $title_arr['show_title']) {
    echo kleo_title_section($title_arr);
}
/* END TITLE SECTION */
?>

<?php 
get_template_part('page-parts/general-before-wrap');
?>
开发者ID:6226,项目名称:wp,代码行数:30,代码来源:index.php

示例4: array

 // video bg self hosted
 $bg_video_args = array();
 $k_video = '';
 if (get_cfield('video_mp4')) {
     $bg_video_args['mp4'] = get_cfield('video_mp4');
 }
 if (get_cfield('video_ogv')) {
     $bg_video_args['ogv'] = get_cfield('video_ogv');
 }
 if (get_cfield('video_webm')) {
     $bg_video_args['wemb'] = get_cfield('video_webm');
 }
 if (!empty($bg_video_args)) {
     $attr_strings = array('preload="none"');
     if (get_cfield('video_poster')) {
         $attr_strings[] = 'poster="' . get_cfield('video_poster') . '"';
     }
     $k_video .= '<div class="kleo-video-wrap"><video ' . join(' ', $attr_strings) . ' controls="controls" class="kleo-video" style="height: 100%; width: 100%;">';
     $source = '<source type="%s" src="%s" />';
     foreach ($bg_video_args as $video_type => $video_src) {
         $video_type = wp_check_filetype($video_src, wp_get_mime_types());
         $k_video .= sprintf($source, $video_type['type'], esc_url($video_src));
     }
     $k_video .= '</video></div>';
     echo '<div class="article-media clearfix">';
     echo $k_video;
     echo '</div>';
 } elseif (!empty($video)) {
     echo '<div class="article-media clearfix">';
     echo wp_oembed_get($video);
     echo '</div>';
开发者ID:VLabsInc,项目名称:WordPressPlatforms,代码行数:31,代码来源:content-page.php

示例5:

<?php

/**
 * The template for displaying posts in the Link post format
 *
 * @package WordPress
 * @subpackage Kleo
 * @since Kleo 1.0
 */
?>

<?php 
$post_class = 'clearfix';
if (is_single() && get_cfield('centered_text') == 1) {
    $post_class .= ' text-center';
}
?>

<!-- Begin Article -->
<article id="post-<?php 
the_ID();
?>
" <?php 
post_class(array($post_class));
?>
>

	<?php 
if (kleo_postmeta_enabled()) {
    ?>
		<div class="article-meta">
开发者ID:VLabsInc,项目名称:WordPressPlatforms,代码行数:31,代码来源:content-link.php

示例6: query_posts

}
query_posts($args);
if (have_posts()) {
    ob_start();
    ?>
	<div class="<?php 
    echo $class;
    ?>
">
		
		<?php 
    while (have_posts()) {
        the_post();
        $client_link = '#';
        if (get_cfield('client_link')) {
            $client_link = get_cfield('client_link');
        }
        if (get_post_thumbnail_id()) {
            ?>
			<div class="client <?php 
            if ($animated != '') {
                echo 'list-el-animated';
            }
            ?>
">
				<a href="<?php 
            echo $client_link;
            ?>
" <?php 
            if ($animated != '') {
                echo 'class="el-' . $animation . '"';
开发者ID:quyip8818,项目名称:wps,代码行数:31,代码来源:kleo_clients.php

示例7: kleo_woo_set_custom_menu

function kleo_woo_set_custom_menu($args = '')
{
    $shop_id = wc_get_page_id('shop');
    if (is_shop()) {
        $menuslug = get_cfield('page_menu', $shop_id);
        if (!empty($menuslug) && $menuslug != 'default' && is_nav_menu($menuslug)) {
            $args['menu'] = $menuslug;
        }
    }
    return $args;
}
开发者ID:quyip8818,项目名称:wps,代码行数:11,代码来源:config.php

示例8: get_cfield

		<div class="article-media">
		 <?php 
    //oEmbed video
    $video = get_cfield('embed');
    // video bg self hosted
    $bg_video_args = array();
    $k_video = '';
    if (get_cfield('video_mp4')) {
        $bg_video_args['mp4'] = get_cfield('video_mp4');
    }
    if (get_cfield('video_ogv')) {
        $bg_video_args['ogv'] = get_cfield('video_ogv');
    }
    if (get_cfield('video_webm')) {
        $bg_video_args['webm'] = get_cfield('video_webm');
    }
    if (!empty($bg_video_args)) {
        $attr_strings = array('preload="0"');
        $k_video .= sprintf('<div class="kleo-video-wrap"><video %s controls="controls" class="kleo-video">', join(' ', $attr_strings));
        $source = '<source type="%s" src="%s" />';
        foreach ($bg_video_args as $video_type => $video_src) {
            $video_type = wp_check_filetype($video_src, wp_get_mime_types());
            $k_video .= sprintf($source, $video_type['type'], esc_url($video_src));
        }
        $k_video .= '</video></div>';
        echo $k_video;
    } elseif (!empty($video)) {
        global $wp_embed;
        echo apply_filters('kleo_oembed_video', $video);
    }
开发者ID:6226,项目名称:wp,代码行数:30,代码来源:content-video.php

示例9: sq_option

<?php

/** 
 * Displays social share icons
 * @package WordPress
 * @subpackage Kleo
 * @since Kleo 1.0
 */
$social_share = sq_option('blog_social_share', 1);
if (get_cfield('blog_social_share') != '') {
    $social_share = get_cfield('blog_social_share');
}
$like_status = sq_option('likes_status', 1);
if ($social_share != 1 && $like_status != 1) {
    return;
}
?>
<section class="container-wrap">
	<div class="container">
		<div class="share-links">
      
      <div class="hr-title hr-long"><abbr><?php 
_e("Share this article:", "kleo_framework");
?>
</abbr></div>
      
			<?php 
if ($like_status == 1) {
    ?>
			
      <span class="kleo-love">
开发者ID:6226,项目名称:wp,代码行数:31,代码来源:posts-social-share.php

示例10: kleo_entry_meta

			<span class="post-meta">
				<?php 
    kleo_entry_meta();
    ?>
			</span>
			<?php 
    edit_post_link(esc_html__('Edit', 'kleo_framework'), '<span class="edit-link">', '</span>');
    ?>
		</div><!--end article-meta-->
	<?php 
}
?>


	<?php 
$audio = get_cfield('audio');
if (kleo_postmedia_enabled() && !empty($audio)) {
    ?>

		<div class="article-media post-audio">          
			<audio id="audio_<?php 
    the_id();
    ?>
" class="kleo-audio" style="width:100%;" src="<?php 
    echo $audio;
    ?>
"></audio>
		</div><!--end article-media-->

	<?php 
}
开发者ID:quyip8818,项目名称:wps,代码行数:31,代码来源:content-audio.php

示例11: the_cfield

 function the_cfield($meta = NULL, $id = NULL)
 {
     echo get_cfield($meta, $id);
 }
开发者ID:quyip8818,项目名称:wps,代码行数:4,代码来源:function-core.php

示例12: kleo_woo_bottom_content

function kleo_woo_bottom_content()
{
    $shop_id = woocommerce_get_page_id('shop');
    if (!$shop_id) {
        return;
    }
    $page_bottom = get_cfield('bottom_content', $shop_id);
    if (is_shop() && $page_bottom != '') {
        echo '<div class="kleo-page-bottom">';
        echo do_shortcode($page_bottom);
        echo '</div>';
    }
}
开发者ID:6226,项目名称:wp,代码行数:13,代码来源:config.php

示例13: kleo_frontend_files

 function kleo_frontend_files()
 {
     //head scripts
     wp_register_script('kleo-init', get_template_directory_uri() . '/assets/js/init.js', array(), KLEO_THEME_VERSION, false);
     wp_register_script('modernizr', get_template_directory_uri() . '/assets/js/modernizr.custom.46504.js', array(), KLEO_THEME_VERSION, false);
     /* Footer scripts */
     wp_register_script('bootstrap', get_template_directory_uri() . '/assets/js/bootstrap.min.js', array('jquery'), KLEO_THEME_VERSION, true);
     wp_register_script('waypoints', get_template_directory_uri() . '/assets/js/plugins/waypoints.min.js', array('jquery'), KLEO_THEME_VERSION, true);
     //wp_register_script( 'pretty-photo', get_template_directory_uri() . '/assets/js/plugins/prettyPhoto/jquery.prettyPhoto.js', array('jquery'),KLEO_THEME_VERSION, true );
     wp_register_script('magnific-popup', get_template_directory_uri() . '/assets/js/plugins/magnific-popup/magnific.min.js', array('jquery'), KLEO_THEME_VERSION, true);
     wp_register_script('caroufredsel', get_template_directory_uri() . '/assets/js/plugins/carouFredSel/jquery.carouFredSel-6.2.0-packed.js', array('jquery'), KLEO_THEME_VERSION, true);
     wp_register_script('jquery-mousewheel', get_template_directory_uri() . '/assets/js/plugins/carouFredSel/helper-plugins/jquery.mousewheel.min.js', array('jquery', 'caroufredsel'), KLEO_THEME_VERSION, true);
     wp_register_script('jquery-touchswipe', get_template_directory_uri() . '/assets/js/plugins/carouFredSel/helper-plugins/jquery.touchSwipe.min.js', array('jquery', 'caroufredsel'), KLEO_THEME_VERSION, true);
     wp_register_script('jquery-transit', get_template_directory_uri() . '/assets/js/plugins/carouFredSel/helper-plugins/jquery.transit.min.js', array('jquery', 'caroufredsel'), KLEO_THEME_VERSION, true);
     wp_register_script('jquery-ba-throttle-debounce', get_template_directory_uri() . '/assets/js/plugins/carouFredSel/helper-plugins/jquery.ba-throttle-debounce.min.js', array('jquery', 'caroufredsel'), KLEO_THEME_VERSION, true);
     wp_register_script('isotope', get_template_directory_uri() . '/assets/js/plugins/jquery.isotope.min.js', array('jquery'), KLEO_THEME_VERSION, true);
     wp_register_script('kleo-scripts', get_template_directory_uri() . '/assets/js/scripts.js', array('jquery'), KLEO_THEME_VERSION, true);
     wp_register_script('kleo-shortcodes', get_template_directory_uri() . '/assets/js/shortcodes.js', array('jquery'), KLEO_THEME_VERSION, true);
     wp_register_script('app', get_template_directory_uri() . '/assets/js/app.js', array('jquery'), KLEO_THEME_VERSION, true);
     //enque them
     wp_enqueue_script('kleo-init');
     wp_enqueue_script('modernizr');
     wp_enqueue_script('bootstrap');
     wp_enqueue_script('waypoints');
     //wp_enqueue_script('pretty-photo');
     wp_enqueue_script('magnific-popup');
     wp_enqueue_script('caroufredsel');
     wp_enqueue_script('jquery-touchswipe');
     wp_enqueue_script('jquery-transit');
     wp_enqueue_script('jquery-ba-throttle-debounce');
     wp_enqueue_script('mediaelement');
     wp_enqueue_script('isotope');
     wp_enqueue_script('kleo-scripts');
     wp_enqueue_script('kleo-shortcodes');
     wp_enqueue_script('app');
     $retina_logo = sq_option_url('logo_retina') != '' ? sq_option_url('logo_retina') : "";
     if (is_singular() && get_cfield('logo_retina')) {
         $retina_logo = get_cfield('logo_retina');
     }
     $obj_array = array('ajaxurl' => home_url() . '/wp-admin/admin-ajax.php', 'goTop' => sq_option('go_top', 1), 'ajaxSearch' => sq_option('ajax_search', 1), 'alreadyLiked' => sq_option('likes_already', 'You already like this'), 'retinaLogo' => $retina_logo);
     wp_localize_script('app', 'kleoFramework', $obj_array);
     if (is_singular() && comments_open() && get_option('thread_comments')) {
         wp_enqueue_script('comment-reply');
     }
     // Register the styles
     wp_register_style('bootstrap', get_template_directory_uri() . '/assets/css/bootstrap.min.css', array(), KLEO_THEME_VERSION, 'all');
     wp_register_style('kleo-app', get_template_directory_uri() . '/assets/css/app.css', array(), KLEO_THEME_VERSION, 'all');
     wp_register_style('kleo-shortcodes', get_template_directory_uri() . '/assets/css/shortcodes.css', array(), KLEO_THEME_VERSION, 'all');
     //wp_register_style( 'pretty-photo', get_template_directory_uri() . '/assets/js/plugins/prettyPhoto/prettyPhoto.css', array(), KLEO_THEME_VERSION, 'all' );
     wp_register_style('magnific-popup', get_template_directory_uri() . '/assets/js/plugins/magnific-popup/magnific.css', array(), KLEO_THEME_VERSION, 'all');
     wp_register_style('mediaelement-skin', get_template_directory_uri() . '/assets/js/plugins/mediaelement/mejs-kleo-skin.css', array(), KLEO_THEME_VERSION, 'all');
     wp_register_style('kleo-fonts', get_template_directory_uri() . '/assets/css/embed-fonts.css', array(), KLEO_THEME_VERSION, 'all');
     wp_register_style('kleo-style', CHILD_THEME_URI . '/style.css', array(), KLEO_THEME_VERSION, 'all');
     //enque required styles
     wp_enqueue_style('bootstrap');
     wp_enqueue_style('kleo-app');
     wp_enqueue_style('kleo-shortcodes');
     //wp_enqueue_style( 'pretty-photo' );
     wp_enqueue_style('magnific-popup');
     wp_enqueue_style('kleo-fonts');
     wp_enqueue_style('mediaelement');
 }
开发者ID:6226,项目名称:wp,代码行数:62,代码来源:functions.php

示例14: do_post_parents

 /**
  * Adds a specific post's parents to the items array.
  *
  * @since  0.6.0
  * @access public
  * @param  int $post_id The ID of the post to get the parents of.
  * @return void
  */
 public function do_post_parents($post_id)
 {
     $parents = array();
     while ($post_id) {
         /* Get the post by ID. */
         $post = get_post($post_id);
         $page_title = get_the_title($post_id);
         if (get_cfield('custom_title', $post_id) && get_cfield('custom_title', $post_id) != '') {
             $page_title = get_cfield('custom_title', $post_id);
         }
         /* Add the formatted post link to the array of parents. */
         $parents[] = '<a href="' . get_permalink($post_id) . '" title="' . $page_title . '">' . $page_title . '</a>';
         /* If there's no longer a post parent, brea out of the loop. */
         if (0 >= $post->post_parent) {
             break;
         }
         /* Change the post ID to the parent post to continue looping. */
         $post_id = $post->post_parent;
     }
     /* Get the post hierarchy based off the final parent post. */
     $this->do_post_hierarchy($post_id);
     /* Merge the parent items into the items array. */
     $this->items = array_merge($this->items, array_reverse($parents));
 }
开发者ID:VLabsInc,项目名称:WordPressPlatforms,代码行数:32,代码来源:function-breadcrumb.php

示例15: kleo_bottom_content

function kleo_bottom_content()
{
    if (!is_singular()) {
        return false;
    }
    $page_bottom = get_cfield('bottom_content');
    if ($page_bottom != '') {
        echo '<div class="kleo-page-bottom">';
        echo do_shortcode($page_bottom);
        echo '</div>';
    }
}
开发者ID:6226,项目名称:wp,代码行数:12,代码来源:theme-functions.php


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