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


PHP the_sub_field函数代码示例

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


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

示例1: show_article

    function show_article()
    {
        ?>
        <article id="<?php 
        the_sub_field('id');
        ?>
" class="Section__article <?php 
        the_sub_field('class');
        ?>
">
            <?php 
        if (get_row_layout() == 'html') {
            Show_html();
        }
        ?>
        </article>
        <?php 
        //
    }
开发者ID:giorgiosaud,项目名称:bej,代码行数:19,代码来源:flex-helpers.php

示例2: ml_slideshow

function ml_slideshow()
{
    //THIS SLIDESHOW FUNCTION CAN BE USED FOR BOTH SLIDESHOWS
    //THAT NEED TO LIVE ON THE OPTIONS PAGE OR SINGLE PAGE
    $ss = 'field_simple_slideshow';
    $content = 'content';
    $img = 'image';
    $options = false;
    ?>


<section id = "hero" class="hero">
  <div class="slider_img cycle-slideshow" 
       data-cycle-swipe=true
       data-cycle-pager-template="<span class = 'icon pager-icon'></span>"
       data-cycle-slides="> div.slide"
       >

  <div class="cycle-pager"></div>
  <?php 
    if (have_rows($ss)) {
        while (have_rows($ss)) {
            the_row();
            ?>
      <div class = "slide">
	<?php 
            the_sub_field($content);
            ?>
	<img src="<?php 
            the_sub_field($img);
            ?>
" />
      </div>
  <?php 
        }
    }
    ?>
  </div><!--cycle-->
</section>

<?php 
}
开发者ID:pixelstorm,项目名称:slideshow_jquery_cycle2,代码行数:42,代码来源:functions.php

示例3: 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

示例4: the_sub_field

                ?>
		        			<tr>
		        				<td><?php 
                the_sub_field('class');
                ?>
</td>
		        				<td><?php 
                the_sub_field('session_name');
                ?>
</td>
		        				<td><?php 
                the_sub_field('start');
                ?>
</td>
		        				<td><?php 
                the_sub_field('end');
                ?>
</td>
		        			</tr>
		        		<?php 
            }
            echo '</table>';
        }
        $i++;
    }
}
?>

	<div class="right" itemprop="text">
		
		<?php 
开发者ID:gpirie,项目名称:motoscene,代码行数:31,代码来源:content-race.php

示例5: while

                    <?php 
        if (have_rows('menu_items')) {
            while (have_rows('menu_items')) {
                the_row();
                ?>
                            <div class="menu__item-wrapper">
                                <div class="menu__item"><?php 
                the_sub_field('menu_item');
                ?>
</div>
                                <div class="menu__price"><?php 
                the_sub_field('menu_item_price');
                ?>
</div>
                                <div class="menu__description"><?php 
                the_sub_field('menu_item_description');
                ?>
</div>
                            </div>
                        <?php 
            }
            //menu_items
        } else {
        }
        //menu_items
        ?>

            </div>

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

示例6: while

        ?>
>

				<?php 
        if (have_rows('membro')) {
            while (have_rows('membro')) {
                the_row();
                ?>
					
						<div class="cadaMembro">
							<?php 
                $image = get_sub_field('foto');
                $tamanho = 'pessoas';
                $pessoa = $image['sizes'][$tamanho];
                echo '<div class="miniBio">';
                the_sub_field('mini-bio');
                echo '</div>';
                echo '<img src="' . $pessoa . '" class="foto">';
                ?>
						</div>
						<?php 
            }
        }
        ?>

				<div id="trabalheConosco">
					<h2>Trabalhe Conosco</h2>
					<a href="http://www.vagas.com.br/vagas-de-precon" target="_blank" class="verMais">Vagas</a>
				</div>

				<br class="clear">
开发者ID:GuiHarrison,项目名称:engenho-azul,代码行数:31,代码来源:page-pessoas_back.php

示例7: the_sub_field

      <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');
            ?>
</h2>
          <p><?php 
            the_sub_field('content');
            ?>
</p>
        </div>
      </div>      
		<?php 
            $i++;
        }
        ?>
		                
<?php 
    }
    ?>
 
      
      <div class="col-md-1 col-xs-1"></div>
开发者ID:CROmetrics,项目名称:crometrics.com,代码行数:31,代码来源:our_clients_2016-01-22-08.php

示例8: the_sub_field

												<div class="m-all t-1of4 d-1of4">
												 	<a href="<?php 
                the_sub_field('link');
                ?>
"><img src="<?php 
                the_sub_field('image');
                ?>
" alt="<?php 
                the_sub_field('title');
                ?>
"></a>
												 	<h4><a href="<?php 
                the_sub_field('link');
                ?>
"><?php 
                the_sub_field('title');
                ?>
</a></h4>
												 	
												 </div>
												
												<?php 
            }
        } else {
        }
        ?>
									
									</div> <!--END RECENT PROJECTS-->
									
								
									
开发者ID:brycefrees,项目名称:nddLive,代码行数:28,代码来源:page-home-simple.php

示例9: get_sub_field

?>
" method="post" class="newsletter" style="<?php 
$image = get_sub_field('image');
if ($image) {
    if (is_array($image)) {
        $image = $image['url'];
    }
    echo "background-image: url(" . f('img/pattern.png') . "), url({$image});";
}
?>
" target="_blank">
  <fieldset class="wrap">
    <legend class="heading"><?php 
the_sub_field('title');
?>
</legend>
    <input type="hidden" name="ml-submit" value="1">
    <input type="email" name="fields[email]" autocapitalize="off" autocorrect="off" placeholder="<?php 
the_sub_field('placeholder');
?>
" aria-label="<?php 
the_sub_field('placeholder');
?>
" required aria-required="true">
    <button type="submit" class="button"><?php 
the_sub_field('submit_label');
?>
</button>
  </fieldset>
</form>
开发者ID:rdourado,项目名称:atins.me,代码行数:30,代码来源:layout-newsletter.php

示例10: while

    <div class="row">
      <div class="col-lg-8 col-lg-offset-2 top bottom">
        <?php 
    // loop through the rows of data
    while (have_rows('testimonials')) {
        the_row();
        ?>
        <div class="col-lg-4 testimonial">
          <p><?php 
        the_sub_field('quote');
        ?>
</p>
          <p class="uppercase handles"><a href="http://twitter.com/<?php 
        the_sub_field('twitter_handle');
        ?>
"><strong><?php 
        the_sub_field('twitter_handle');
        ?>
</strong></a></p>
        </div>

        <?php 
    }
    ?>
     </div>
    </div>
  </div>
  <?php 
} else {
    // no rows found
}
开发者ID:hyperperforator,项目名称:popsicle-ice,代码行数:31,代码来源:page-subscribe.php

示例11: str_replace

        $tabID = str_replace(' ', '', get_sub_field('tab_label'));
        echo '<li role="presentation" class="' . ($count == 0 ? "active" : "") . '"><a href="#' . $tabID . '" aria-controls="' . $tabID . '" role="tab" data-toggle="tab">';
        the_sub_field('tab_label');
        echo '</a></li>';
        $count++;
    }
    echo '</ul>';
    // tab content second
    echo '<div class="tab-content">';
    $count = 0;
    while (have_rows('tabs')) {
        the_row();
        // display a sub field value
        $tabID = str_replace(' ', '', get_sub_field('tab_label'));
        echo '<div role="tabpanel" class="tab-pane' . ($count == 0 ? " active" : "") . '" id="' . $tabID . '">';
        the_sub_field('tab_content');
        echo '</div>';
        $count++;
    }
    echo '
						</div>
					</div>
				</section>	
				';
} else {
    // no rows found
}
?>

		<?php 
$btm_content = get_field('btm_content');
开发者ID:joewatts000,项目名称:Enable,代码行数:31,代码来源:template-about.php

示例12: the_sub_field

"<?php 
                    }
                    ?>
 <?php 
                    if (get_sub_field('anchor_label')) {
                        ?>
data-label="<?php 
                        the_sub_field('anchor_label');
                        ?>
"<?php 
                    }
                    ?>
 class="row clients">
					<div class="container">
						<h1 class="section-title"><?php 
                    the_sub_field('section_title');
                    ?>
</h1>
						<ul>
							<?php 
                    foreach ($terms as $term) {
                        ?>
								<li>
								<?php 
                        $taxonomy = $term->taxonomy;
                        $term_id = $term->term_taxonomy_id;
                        $thumbnail = get_field('client_logo', $taxonomy . '_' . $term_id);
                        $image_size = array('width' => 200);
                        $image_url = get_image($thumbnail, $image_size);
                        ?>
					
开发者ID:kishandchips,项目名称:thebankcorporate,代码行数:30,代码来源:content.php

示例13: get_sub_field

    $classList .= get_sub_field('right_bracket') ? " rightBracket" : "";
    ?>
 
		<div class="<?php 
    echo $classList;
    ?>
">
			<div class="Wrapper">
				<?php 
    // two column text
    if (get_sub_field('column') == "2") {
        ?>
						<p class="twoCol"><?php 
        the_sub_field('text');
        ?>
</p>
				<?php 
        // One column text
    } else {
        ?>
						<p><?php 
        the_sub_field('text');
        ?>
</p>
				<?php 
    }
    ?>
			</div>
		</div>
<?php 
}
开发者ID:JoelAlphonso,项目名称:dectim,代码行数:31,代码来源:tp-text.php

示例14: hbmi_display_fc

function hbmi_display_fc()
{
    // loop through the rows of data
    while (have_rows('flexible_content')) {
        the_row();
        // "Hero" Layout
        if (get_row_layout() === 'hero_row') {
            $bg_image = get_sub_field('hero_image');
            ?>

				<section class="row content-section hero-row <?php 
            the_sub_field('css_class');
            ?>
" style="background: url(<?php 
            echo $bg_image['url'];
            ?>
); background-size: cover;">
					<div class="wrap">
						<div class="heading-container-wrap">
							<div class="hero-content">
								<?php 
            if (get_sub_field('hero_content')) {
                the_sub_field('hero_content');
            }
            ?>
							</div>
						</div>
					</div>
				</section>

			<?php 
        } elseif (get_row_layout() === 'row_with_heading') {
            $bg_color = get_sub_field('background_color');
            ?>

				<section class="row content-section <?php 
            echo the_sub_field('css_class');
            ?>
" style="background-color: <?php 
            echo $bg_color;
            ?>
;">
					<div class="wrap">
						<div class="heading-wrap">
							<h2 class="section-heading">
								<?php 
            if (get_sub_field('section_heading')) {
                the_sub_field('section_heading');
            }
            ?>
							</h2>
						</div>
						<div class="content-area">
							<?php 
            if (get_sub_field('content_area')) {
                the_sub_field('content_area');
            }
            ?>
						</div>
					</div>
				</section>


			<?php 
        } elseif (get_row_layout() === 'row_without_heading') {
            $background_image = get_sub_field('background_image') ? get_sub_field('background_image') : '';
            ?>

				<section class="row content-section <?php 
            the_sub_field('css_class');
            ?>
" style="background: url(<?php 
            echo $background_image['url'];
            ?>
); background-size: cover;">
					<div class="wrap">
						<div class="content-area">
							<?php 
            if (get_sub_field('content_area')) {
                the_sub_field('content_area');
            }
            ?>
						</div>
					</div>
				</section>

			<?php 
        }
    }
}
开发者ID:joedooley,项目名称:hbmi,代码行数:90,代码来源:front-page.php

示例15: the_sub_field

        ?>
 font-regular">
					<?php 
        the_sub_field("block_simple_button_text");
        ?>
				</p>
			</div>
			<a href="<?php 
        the_sub_field("block_simple_button_link");
        ?>
" class="button uppercase color-white background-<?php 
        the_sub_field('block_simple_button_color_button');
        ?>
 font-size-16 margin-top-30 display-inline-block">
				<?php 
        the_sub_field("block_simple_button_label_button");
        ?>
			</a>
			<?php 
        if (get_sub_field('block_simple_title_button_illustration')) {
            ?>
			<div class="site-banner--has-train position-absolute background-white">
			
			</div>
			<?php 
        } else {
            // field_name returned false
            ?>
			<?php 
        }
        // end of if field_name logic
开发者ID:19h47,项目名称:top-vacances,代码行数:31,代码来源:front-page.php


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