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


PHP has_sub_field函数代码示例

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


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

示例1: homeSliders

    function homeSliders($name = '', $id = 0, $w = '1600', $h = '440')
    {
        $html = '<link rel="stylesheet" type="text/css" href="' . get_bloginfo("template_directory") . '/assets/css/flexslider.css" media="screen" />
		<div class=" nopad" id="home-flexslider-wrapper">
		<div class="flexslider" style="margin:0 auto;">
		<ul class="slides">';
        if (get_field($name, $id)) {
            while (has_sub_field($name, $id)) {
                $img = get_template_directory_uri() . '/tmb.php?src=' . get_sub_field('image', $id) . '&amp;w=' . $w . '&h=' . $h . '&amp;q=90';
                $html .= '<li ><img src="' . $img . '" / >
			  <div class="flex-caption">
			  <div>
			  <h3>' . get_sub_field('title', $id) . '</h3>
			  </div>
			  </div>
			  </li>';
            }
            $html .= '</ul>
			<div class="clear"></div>
			</div>
			</div>
			<script type="text/javascript">
			jQuery(document).ready(function($){
			
			jQuery(\'.flexslider\').flexslider({
			animation: "fade",
			pauseOnHover: true,
			start: function(slider){}
			});
			
			});
			</script>';
        }
        return $html;
    }
开发者ID:djmacguyver,项目名称:cosmic-wordpress-tools,代码行数:35,代码来源:cosmic-home-slider.php

示例2: _has_sub_field

/**
 * Check if a given field has a sub field
 * @param str $key The meta key
 * @param mixed $id The post ID
 * @return bool
 * @uses has_sub_field()
 */
function _has_sub_field($key, $id = false)
{
    if (function_exists('has_sub_field')) {
        return has_sub_field($key, $id);
    } else {
        return false;
    }
}
开发者ID:chromasites,项目名称:Chroma-Theme,代码行数:15,代码来源:acf-wrapper-functions.php

示例3: change_sidebar_context

/**
 * Changes the context for a sidebar
 *
 * return void
 */
function change_sidebar_context()
{
    global $post, $wp_query, $dr_orig_wp_query, $dr_query_modified;
    $dr_orig_wp_query = $wp_query;
    // Get relationship field, if exists
    while (has_sub_field('relationship', 'option')) {
        if (get_sub_field('post_type') == $post->post_type) {
            $post = get_sub_field('detail_page');
            query_posts(array('p' => $post->ID));
            pw_filter_widgets(get_option('sidebars_widgets'));
            $dr_query_modified = true;
        }
    }
}
开发者ID:troubletribbles,项目名称:dr_bootstrap,代码行数:19,代码来源:utility.php

示例4: ImageBlocks

    function ImageBlocks($id = 0, $w = '1600', $h = '440')
    {
        $name = 'Image_blocks';
        $html = '<div id="image-blocks-wrapper">
		<div class="row" style="margin-bottom:1.5em;">';
        $popupCounter = 0;
        if (get_field($name, $id)) {
            while (has_sub_field($name, $id)) {
                $img = get_template_directory_uri() . '/tmb.php?src=' . get_sub_field('block_image', $id) . '&amp;w=' . $w . '&h=' . $h . '&amp;q=90';
                if (get_sub_field('block_type', $id) == 'popup') {
                    $html .= '<div class="small-12 medium-6 large-4 columns nopad" >
				  <h3>' . get_sub_field('block_title', $id) . '</h3>
				  <a title="click to view more" onclick="jQuery(\'#popup-div' . $popupCounter . '\').foundation(\'reveal\', \'open\');" 
				  href="javascript:return false;" 
				  class="image-block-links"  style="background-image: url(\'' . $img . '\');">
				  <span><div>' . get_sub_field('block_desc', $id) . ' Read More ></div></span></a></div>';
                    // popup content
                    $html .= '<div id="popup-div' . $popupCounter . '" class="reveal-modal" data-reveal>
				  <div class="row row-wide">
				  <div class="large-12 medium-12 columns" >
				  <h2 class="popup-title">' . get_sub_field('block_title', $id) . '</h2> 
					 
					  <div class="large-3 medium-3 small-12 columns nopad" class="popup-image">
					  <div  style="background-image: url(\'' . $img . '\');" class="popup-image"></div>
					  </div>
					  	
					  <div class="large-9 medium-9 small-12 columns" >
					  ' . get_sub_field('block_popup_content', $id) . '
					  </div>
				  
				  </div></div>
				  <a class="close-reveal-modal" id="close-popup-div">&#215;</a> </div>';
                    $popupCounter++;
                } else {
                    $html .= '<div class="small-12 medium-6 large-4 columns nopad" >
			  <h3>' . get_sub_field('block_title', $id) . '</h3>
			  <a title="click to view more" href="' . get_sub_field('block_link', $id) . '" 
			  class="image-block-links"  style="background-image: url(\'' . $img . '\');">
			  <span><div>' . get_sub_field('block_desc', $id) . ' Read More ></div></span></a></div>';
                }
            }
        }
        $html .= '</div></div>';
        return $html;
    }
开发者ID:djmacguyver,项目名称:cosmic-wordpress-tools,代码行数:45,代码来源:cosmic-image-blocks.php

示例5: VideoBlocks

    function VideoBlocks($id = 0, $w = '1600', $h = '440')
    {
        $name = 'youtube_videos';
        $html = '<div id="image-blocks-wrapper">
		<div class="row" style="margin-bottom:1.5em;">';
        $popupCounter = 0;
        if (get_field($name, $id)) {
            while (has_sub_field($name, $id)) {
                $html .= '
              <div class="small-12 medium-6 large-4 columns nopad" >
			  <h3>' . get_sub_field('video_title', $id) . '</h3>
			  <iframe class="video-block-iframe"
			  src="https://www.youtube.com/embed/' . get_sub_field('video_id', $id) . '?autoplay=0">
			  </iframe></div>';
            }
        }
        $html .= '</div></div>';
        return $html;
    }
开发者ID:djmacguyver,项目名称:cosmic-wordpress-tools,代码行数:19,代码来源:cosmic-video-blocks.php

示例6: aps_scholarship_author

function aps_scholarship_author()
{
    $echo_string = "";
    if (get_field('scholarship_is_author_member') == 'Yes') {
        $echo_string .= '<a href="' . bp_core_get_user_domain(get_field('scholarship_author_member')['ID']) . '">' . get_field('scholarship_author') . '</a>';
    } else {
        $echo_string .= get_field('scholarship_author');
    }
    if (get_field('scholarship_are_there_secondary_authors') === "Yes") {
        while (has_sub_field('scholarship_secondary_authors')) {
            $echo_string .= ", ";
            if (get_sub_field('scholarship_is_author_member') == 'Yes') {
                $echo_string .= '<a href="' . bp_core_get_user_domain(get_sub_field('scholarship_author_member')['ID']) . '">' . get_sub_field('scholarship_author') . '</a>';
            } else {
                $echo_string .= get_sub_field('scholarship_author');
            }
        }
    }
    echo $echo_string;
}
开发者ID:gato-gordo,项目名称:association-print-scholars,代码行数:20,代码来源:scholarship_functions.php

示例7: plankton_all_testimonails

function plankton_all_testimonails()
{
    if (get_field('testimonials')) {
        while (has_sub_field('testimonials')) {
            echo '<section>';
            $attachment_id = get_sub_field('logo');
            $size = "thumbnail";
            // (thumbnail, medium, large, full or custom size)
            $image = wp_get_attachment_image_src($attachment_id, $size);
            ?>
		<h3><?php 
            the_sub_field('client_name');
            ?>
</h3>
 		
 		<?php 
            if (get_sub_field('logo') != '') {
                ?>
 			<img class="alignleft" src="<?php 
                echo $image[0];
                ?>
" />
 		<?php 
            } else {
                ?>
 			<img src="<?php 
                bloginfo('stylesheet_directory');
                ?>
/img/mini.png" class="alignleft" />
 		<?php 
            }
            the_sub_field('the_testimonial');
            ?>
					
	 
	 	</section>
	 	
	 <?php 
        }
    }
}
开发者ID:planktonWD,项目名称:Parkside-Quarry,代码行数:41,代码来源:testimonials-function.php

示例8: the_field

  <div class="container">
    <h3 class="text-uppercase text-center"><?php 
    the_field("client_success_title");
    ?>
</h3>
    <!-- Example row of columns -->
    <div class="row">
      <div class="col-md-1 col-xs-1"></div>
      
<?php 
    if (get_field('client_success_strip')) {
        ?>
							 
		<?php 
        $i = 1;
        while (has_sub_field('client_success_strip')) {
            ?>
	
      <div class="col-md-2 lrpad10">
        <div class="panel">
          <img class="center-block" src="<?php 
            the_sub_field('icon');
            ?>
" />
          <h1 class="text-center"><?php 
            the_sub_field('price');
            ?>
</h1>
          <h2 class="text-center"><?php 
            the_sub_field('title');
            ?>
开发者ID:CROmetrics,项目名称:crometrics.com,代码行数:31,代码来源:our_clients_2016-01-22-08.php

示例9: while

                top: 0px; left: 0px;width: 100%;height:100%;">
            </div>
        </div>

        <!-- Slides Container -->
        <div u="slides" style="cursor: move; position: absolute; left: 0px; top: 0px; width: 720px; height: 480px;
            overflow: hidden;">
				<?php 
while (have_posts()) {
    the_post();
    ?>
			        <?php 
    if (get_field('brochures_images')) {
        ?>
			            <?php 
        while (has_sub_field('brochures_images')) {
            ?>
			            	<?php 
            if (get_sub_field('images')) {
                ?>
                                <div>
                                    <img u="image" src="<?php 
                echo the_sub_field('images');
                ?>
" />
                                    <img u="thumb" src="<?php 
                echo the_sub_field('images');
                ?>
" />
                                </div>
							<?php 
开发者ID:nagyistoce,项目名称:krunalsojitra-wp-themes,代码行数:31,代码来源:brochures-images_swipe_effect.php

示例10: esc_html

        ?>
					<h2><?php 
        echo esc_html($title);
        ?>
</h2>
				<?php 
    }
    ?>
				<?php 
    if ($description) {
        ?>
					<h4><?php 
        echo esc_html($description);
        ?>
</h4>
				<?php 
    }
    ?>
				<?php 
    if ($buttons) {
        while (has_sub_field('buttons')) {
            GRAV_BLOCKS::get_link_html('button', 'button');
        }
    }
    ?>
			</div>
		</div>
	</div>

<?php 
}
开发者ID:GravitateDesignStudio,项目名称:Gravitate-Blocks,代码行数:31,代码来源:block.php

示例11: the_sub_field

						">
						<div class="inner container" style="<?php 
                    if (get_sub_field('custom_css')) {
                        the_sub_field('custom_css');
                        ?>
; <?php 
                    }
                    ?>
">
						
						<?php 
                    $total_columns = count(get_sub_field('columns', $id));
                    ?>

						<?php 
                    while (has_sub_field('columns', $id)) {
                        ?>
							<?php 
                        switch ($total_columns) {
                            case 2:
                                $class = 'five';
                                break;
                            case 3:
                                $class = 'one-third';
                                break;
                            case 4:
                                $class = 'one-fourth';
                                break;
                            case 5:
                                $class = 'one-fifth';
                                break;
开发者ID:kishandchips,项目名称:thebankcorporate,代码行数:31,代码来源:content.php

示例12: get_header

 * This is the most generic template file in a WordPress theme
 * and one of the two required files for a theme (the other being style.css).
 * It is used to display a page when nothing more specific matches a query.
 * E.g., it puts together the home page when no home.php file exists.
 * Learn more: http://codex.wordpress.org/Template_Hierarchy
 *
 * @package kp
 */
get_header();
?>

<?php 
$orderby = $_GET['orderby'];
$order = $_GET['order'];
if (!isset($orderby)) {
    while (has_sub_field('date')) {
        $orderby = get_sub_field('start_date');
    }
}
if (!isset($order)) {
    $order = "asc";
}
$args = array('post_type' => 'see');
$loop = new WP_Query($args);
if ($_GET['view'] == 'calendar') {
    $isSelected = " btn-selected";
} else {
    $thisSelected = " btn-selected";
}
?>
开发者ID:briancompton,项目名称:knightsplaza,代码行数:30,代码来源:page-see.php

示例13: while

</div>
<div class="section" id="about" > 
  <!--container -->
  <div class="container">
    <nav class="side-navigation hide-mobile">
      <ul>
        <li><a title="Welcome" href="#main"><span>Welcome</span></a></li>
        <li><a title="Services" href="#services"><span>Services</span></a></li>
        <li><a title="Testimonials" href="#clients"><span>Testimonials</span></a></li>
        <li><a title="Portfolio" href="#portfolio"><span>Portfolio</span></a></li>
        <li><a class="active" title="About" href="#about"><span>About</span></a></li>
        <li><a title="Contact" href="#contact"><span>Contact</span></a></li>
      </ul>
    </nav>
    <?php 
while (has_sub_field('about_block')) {
    ?>
    <h2 class="animated" data-animation="bounceInDown" data-revert="bounceOutUp">About</h2>
    <div class="clear"></div>
    <span class="line animated" data-animation="bounceInLeft" data-revert="bounceOutRight">&nbsp;</span>
    <div class="sub-head animated"  data-animation="flipInX" data-revert="flipOutX">
      <?php 
    the_sub_field('about_subtitle');
    ?>
    </div>
    <?php 
}
?>
    <ul>
      <?php 
$args = array('post_type' => 'post', 'category_name' => 'blog', 'orderby' => 'post_date', 'posts_per_page' => '1');
开发者ID:nagyistoce,项目名称:krunalsojitra-wp-themes,代码行数:31,代码来源:page-home_old.php

示例14: psp_phases

function psp_phases($id, $style = null)
{
    if ($style == 'psp-shortcode') {
        $psp_phases = '<div class="psp-shortcode-phases">';
    } else {
        $psp_phases = '<div class="psp-row">';
    }
    $i = 0;
    $c = 0;
    while (has_sub_field('phases', $id)) {
        $i++;
        $c++;
        if ($i % 2 == 1 && $style != 'psp-shortcode') {
            $psp_phases .= '</div><div class="psp-row">';
        }
        if ($c == 1) {
            $color = 'blue';
            $chex = '#3299BB';
        } elseif ($c == 2) {
            $color = 'teal';
            $chex = '#4ECDC4';
        } elseif ($c == 3) {
            $color = 'green';
            $chex = '#CBE86B';
        } elseif ($c == 4) {
            $color = 'pink';
            $chex = '#FF6B6B';
        } elseif ($c == 5) {
            $color = 'maroon';
            $chex = '#C44D58';
            $c = 0;
        }
        $psp_phases .= '<div class="psp-phase color-' . $color . '">';
        $completed = 0;
        $tasks = 0;
        $task_completion = 0;
        $completed_tasks = 0;
        if (get_sub_field('auto_progress')) {
            while (has_sub_field('tasks', $id)) {
                $tasks++;
                $task_completion += get_sub_field('status');
                if (get_sub_field('status') == '100') {
                    $completed_tasks++;
                }
            }
            if ($tasks > 1) {
                $completed += ceil($task_completion / $tasks);
            } elseif ($tasks == 1) {
                $completed = 0;
            } else {
                $completed += $task_completion;
            }
        } else {
            $completed = get_sub_field('percent_complete');
        }
        $remaining = 100 - $completed;
        $psp_phases .= '<h3>' . get_sub_field('title') . '</h3>
				
					<div class="psp-phase-overview cf">
						<div class="psp-high-level">
							<ul>
								<li><span>' . $completed . '%</span> Complete</h4>
								<li>';
        if (get_sub_field('tasks', $id)) {
            $psp_phases .= '<span>' . $completed_tasks . ' of ' . $tasks . '</span> tasks completed';
        } else {
            $psp_phases .= '<span>No Tasks</span>';
        }
        $psp_phases .= '</li>
							</ul>
						</div>
						<div class="psp-chart">
							<canvas id="chart-' . $i . '" class="chart-canvas" width="350" height="350"></canvas>
						</div>
						<div class="psp-phase-info">

							
							' . get_sub_field('description') . '
							
							
						</div>
					</div>
				
				
				<script type="text/javascript">
				
				var data' . $i . ' = [
					{
						value: ' . $completed . ',
						color: "' . $chex . '"
					},
					{
						value : ' . $remaining . ',
						color : "#CCCCCC"
					}

				]
					var ctx = document.getElementById("chart-' . $i . '").getContext("2d");
					new Chart(ctx).Doughnut(data' . $i . ');
			
//.........这里部分代码省略.........
开发者ID:Ingenex,项目名称:redesign,代码行数:101,代码来源:functions.php

示例15: while

            </article>
           <?php 
        }
        ?>

           <!-- tipo de bloque: Carrusel -->
            <?php 
        if (get_sub_field('tipo') == 'carrusel') {
            ?>

            <article class="carrusel <?php 
            print $clasesBloque;
            ?>
">
                <?php 
            while (has_sub_field('media')) {
                ?>
                    <figure class="media">
                        <h2 class="titulo"><?php 
                the_sub_field('titulo');
                ?>
</h2>
                        <div class="texto">
                            <?php 
                the_sub_field('texto');
                ?>
                        </div>
                        <img class="imagen" src="<?php 
                the_sub_field('imagen');
                ?>
" alt="<?php 
开发者ID:Hipermedia,项目名称:meteorosoft,代码行数:31,代码来源:sh-page-multiproposito.php


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