本文整理汇总了PHP中get_row_layout函数的典型用法代码示例。如果您正苦于以下问题:PHP get_row_layout函数的具体用法?PHP get_row_layout怎么用?PHP get_row_layout使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_row_layout函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: zgm_flexible_content
function zgm_flexible_content()
{
global $post;
global $postid;
global $pagetemplateclass;
global $template;
$postid = $post->ID;
// get the global post and set the post id for use in get field calls and get_the_title()
$template = explode('.', basename(get_page_template()))[0];
// get template base name minus extension
$pagetemplateclass = '';
// set default for section class
$showAlways = false;
// set default for always show based on pre-existing setup incase felx content isnt set
$gracefull = true;
// check if the flexible content field has rows of data
ob_start();
if (have_rows('page_builder', $postid)) {
$gracefull = false;
// loop through the rows of data
while (have_rows('page_builder', $postid)) {
the_row();
// locate and insert templates for layouts
locate_template('templates/flexible/' . get_row_layout() . '.php', true, false);
}
}
ob_end_flush();
// end flex content
}
开发者ID:Jpwaldstein,项目名称:sage,代码行数:29,代码来源:acf.php
示例2: ci_classes
/**
* Set classes for the cover image container. These can be overridden or added to with a filter like the following:
* add_filter( 'cover_media_set_classes', 'custom_cover_classes' );
* function custom_cover_classes($classes) {
* if(is_page_template('template-landing-page.php') {
* $classes[] = 'on-landing-page';
* }
* return $classes;
* }
*
* @return string string of classes
*/
function ci_classes()
{
$classes = array();
$classes[] = 'cover-media-container';
$classes[] = 'cover-media-' . get_row_layout();
$classes = array_filter(array_map('trim', $classes));
echo trim(implode(' ', apply_filters('cover_media_set_classes', $classes)));
}
开发者ID:mwdelaney,项目名称:acf-cover-media,代码行数:20,代码来源:template-functions.php
示例3: getSectionsHTML
/**
* Retrieves all the section HTML
* @param String $name The slug used for the sections. Is 'sections' by default
* @return String The final HTML
*/
public function getSectionsHTML($name, $post_id)
{
if (!$this->acf_active) {
return '';
}
if (have_rows($name, $post_id)) {
$s = 1;
$this->html = '<div id="acfpb_sections">';
while (have_rows($name, $post_id)) {
the_row();
$layout = get_row_layout();
if (method_exists(get_class(), 'getSection_' . $layout)) {
$id = 'section_' . $s;
$class = 'acfpb_section section-' . $layout;
$style = get_sub_field('bg') ? 'background-color:' . get_sub_field('bg') : '';
$contained = (bool) get_sub_field('contained', false);
if (!$this->use_bs && $contained) {
$contained = false;
}
$wrapper = get_sub_field('wrapper_class');
$this->html .= '<div id="' . $id . '" class="' . $class . '" style="' . $style . '">';
if ($contained) {
$this->html .= '<div class="container">';
}
if ($contained) {
$this->html .= '<div class="row">';
}
if ($wrapper !== '') {
$this->html .= '<div class="' . $wrapper . '">';
}
$this->html .= $this->{'getSection_' . $layout}();
if ($wrapper !== '') {
$this->html .= '</div>';
}
// Wrapper finish
if ($this->use_bs) {
$this->html .= '<div class="clearfix"></div>';
}
if ($contained) {
$this->html .= '</div>';
}
// Row finish
if ($contained) {
$this->html .= '</div>';
}
// Container finish
$this->html .= '</div>';
// Section finish
$s++;
}
}
$this->html .= '</div>';
// Main Wrapper finish
return $this->html;
} else {
return '';
}
}
开发者ID:owenr88,项目名称:acf-page-builder,代码行数:63,代码来源:class.acf_page_builder.php
示例4: get_sub_field_brick_class_name
/**
* @return string
*/
public static function get_sub_field_brick_class_name()
{
$row_layout = get_row_layout();
$class_name = get_sub_field($row_layout . '_brick_class');
if (is_null($class_name)) {
die('get_sub_field_brick_instance() could not find a hidden field named ' . $row_layout . '_brick_class .');
}
return $class_name;
}
开发者ID:folbert,项目名称:fewbricks,代码行数:12,代码来源:flexible-content.php
示例5: the_modules_loop
function the_modules_loop($modules_field = 'modules')
{
// Loop through rows of flexible content field
while (the_flexible_field($modules_field)) {
// Render module template based on the row layout's name
$module_name = str_replace('_', '-', get_row_layout());
the_module($module_name);
}
}
开发者ID:davidroyer,项目名称:modular,代码行数:9,代码来源:helpers.php
示例6: feature_grid_2_2_editor
/**
* GRID: Half-Half Editor
*
* @param $languarge
*/
function feature_grid_2_2_editor($language)
{
if (get_row_layout() == 'half-half') {
$maxWidth = get_sub_field('22_width');
$backgroundColor = 'background-color: ' . get_sub_field('22_background_color') . '; ';
$padding = 'padding: ' . get_sub_field('22_padding') . '; ';
$center = get_sub_field('22_center');
$css = '<style>' . get_sub_field('22_box_css') . '</style>';
$hash = md5(get_sub_field('grid_left_de'));
# uk-margin-large-top | uk-margin-large-bottom
$selected = get_sub_field('22_easy_margin');
if (in_array('top', $selected)) {
$top = 'uk-margin-large-top';
}
if (in_array('bottom', $selected)) {
$bottom = 'uk-margin-large-bottom';
}
if ($top != '' || $bottom != '') {
$margin = ' class="' . $top . ' ' . $bottom . '"';
}
if ($center != 'no') {
$center_1 = '<center>';
$center_2 = '</center>';
}
if (get_sub_field('22_animation_left') != 'no') {
$animation_left = get_sub_field('22_animation_left');
$a_left = 'data-uk-scrollspy="{cls:\'uk-animation-' . $animation_left . '\', repeat: false}"';
}
if (get_sub_field('22_animation_right') != 'no') {
$animation_right = get_sub_field('22_animation_right');
$a_right = 'data-uk-scrollspy="{cls:\'uk-animation-' . $animation_right . '\', repeat: false}"';
}
echo '<div id="ultraschall-box-' . $hash . '" style="' . $backgroundColor . '"' . $margin . '>';
echo '<div class="uk-container uk-container-center"
style="max-width: ' . $maxWidth . 'px;' . $backgroundColor . '' . $padding . '">';
echo '<div class="uk-grid" data-uk-grid-margin="">';
echo '<div class="uk-width-medium-1-2" ' . $a_left . ' data-uk-grid-margin="">';
echo the_sub_field('grid_left_' . $language);
echo '</div>';
echo '<div class="uk-width-medium-1-2" ' . $a_right . ' data-uk-grid-margin="">';
echo the_sub_field('grid_right_' . $language);
echo '</div>';
echo '</div>';
echo '</div>';
echo '</div>';
}
}
开发者ID:McCouman,项目名称:ultraschall-plugin,代码行数:52,代码来源:features-functions.php
示例7: 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
示例8: bw_process_queue
function bw_process_queue()
{
$content = '';
$content = get_field('intro');
if (have_rows('queue_content')) {
// loop through the rows of data
while (have_rows('queue_content')) {
the_row();
if (get_row_layout() == 'question_and_answer') {
$content .= '<div class="bw_queue_question">' . "\n";
$content .= '<div class="bw_queue_question_from">' . get_sub_field('from') . '</div>' . "\n";
$content .= '<div class="bw_queue_question_body">' . get_sub_field('question') . '</div>' . "\n";
$content .= '</div>' . "\n";
$content .= get_sub_field('answer');
} elseif (get_row_layout() == 'generic_content') {
$content .= get_sub_field('generic_content_block');
}
}
} else {
// no layouts found
}
$content .= get_field('outro');
return $content;
}
开发者ID:blizzardwatch,项目名称:BlizzardWatch,代码行数:24,代码来源:bw-queue.php
示例9: acf_get_sub_field
function acf_get_sub_field($selector, $field)
{
// sub fields
if ($field['type'] == 'repeater') {
// extract sub fields
$sub_fields = acf_extract_var($field, 'sub_fields');
if (!empty($sub_fields)) {
foreach ($sub_fields as $sub_field) {
if ($sub_field['name'] == $selector || $sub_field['key'] == $selector) {
// return
return $sub_field;
}
// if
}
// foreach
}
// if
} elseif ($field['type'] == 'flexible_content') {
// vars
$layouts = acf_extract_var($field, 'layouts');
$current = get_row_layout();
if (!empty($layouts)) {
foreach ($layouts as $layout) {
// skip layout if the current layout key does not match
if ($current && $current !== $layout['name']) {
continue;
}
// extract sub fields
$sub_fields = acf_extract_var($layout, 'sub_fields');
if (!empty($sub_fields)) {
foreach ($sub_fields as $sub_field) {
if ($sub_field['name'] == $selector || $sub_field['key'] == $selector) {
// return
return $sub_field;
}
// if
}
// foreach
}
// if
}
// foreach
}
// if
}
// if
// return
return false;
}
开发者ID:coreymargulis,项目名称:karenmargulis,代码行数:49,代码来源:api-field.php
示例10: isset
<?php
/********************************
* Regular Content
********************************/
?>
<?php
$id = isset($id) ? $id : $post->ID;
$i = 0;
if (get_field('content', $id)) {
while (has_sub_field('content', $id)) {
?>
<?php
$layout = get_row_layout();
switch ($layout) {
case 'row':
if (get_sub_field('columns')) {
?>
<div <?php
if (get_sub_field('anchor_id')) {
?>
id="<?php
the_sub_field('anchor_id');
?>
"<?php
}
?>
<?php
if (get_sub_field('anchor_label')) {
开发者ID:kishandchips,项目名称:thebankcorporate,代码行数:31,代码来源:content.php
示例11: the_sub_field
the_sub_field("block_simple_title_button_link");
?>
" class="button uppercase background-<?php
the_sub_field('block_simple_title_button_color_button');
?>
color-white font-size-16 margin-top-30 display-inline-block">
<?php
the_sub_field("block_simple_title_button_label_button");
?>
</a>
</div>
<?php
} elseif (get_row_layout() == "block_simple_button") {
// layout: Block simple avec bouton mais pas de titre
?>
<div class="site-banner background-<?php
the_sub_field('block_simple_button_background');
?>
has-padding text-center position-relative <?php
if (get_sub_field('block_simple_title_button_illustration')) {
?>
has-illustration<?php
}
?>
">
<div class="site-banner__content-inner-full site-banner__content-inner display-inline-block">
<p class="site-banner__content-inner__text color-<?php
开发者ID:19h47,项目名称:top-vacances,代码行数:31,代码来源:front-page.php
示例12: elseif
} elseif (get_row_layout() == 'energy_savings_link') {
?>
<div class="box link bank">
<?php
the_field('bank_text', 'option');
?>
<a href="<?php
the_field('bank_link', 'option');
?>
" ></a>
<div class="clear"></div>
</div>
<?php
} elseif (get_row_layout() == 'call_before_you_dig_information') {
?>
<div class="box dig">
<?php
the_field('dig_text', 'option');
?>
<div class="clear"></div>
</div>
<?php
}
}
} else {
// no layouts found
}
?>
开发者ID:KrissieV,项目名称:pioneer-and-southern,代码行数:30,代码来源:content-page.php
示例13: get_sub_field
?>
<?php
// Vars
$sectionName = get_sub_field('section_name');
$left = get_sub_field('one_third_left');
$right = get_sub_field('two_thirds_right');
echo '<section class="third-split left-text ' . $sectionName . '"><figure><figcaption class="left slide-left">' . $left . '</figcaption><span style="background-image: url(' . $right . ');"></span></figure></section>';
?>
<?php
}
?>
<?php
// No Container One Third Right Text
if (get_row_layout() == 'no_container_third_right') {
?>
<?php
// Vars
$sectionName = get_sub_field('section_name');
$left = get_sub_field('two_thirds_left');
$right = get_sub_field('one_third_right');
echo '<section class="third-split right-text ' . $sectionName . '"><figure><span style="background-image: url(' . $left . ');"></span><figcaption class="right slide-right">' . $right . '</figcaption></figure></section>';
?>
<?php
}
?>
<?php
}
开发者ID:andandandandrew,项目名称:New-LIFT,代码行数:31,代码来源:template_careers-job-categories.php
示例14: array
<?php
include "template-parts/acf-modules/top-content.php";
?>
<?php
$thepages = array('tabbed_page_1', 'tabbed_page_2', 'tabbed_page_3', 'tabbed_page_4', 'tabbed_page_5', 'tabbed_page_6', 'tabbed_page_7');
echo '<div class="tabbedPageMenu"><ul class="tabbedPageMenu-list">';
foreach ($thepages as $thepage) {
if (have_rows($thepage)) {
while (have_rows($thepage)) {
the_row();
?>
<?php
if (get_row_layout() == 'tab_info') {
?>
<?php
$tab_title = get_sub_field('tab_title');
?>
<?php
$tab_hash = get_sub_field('tab_hash');
?>
<li><a class="<?php
echo $tab_hash;
?>
" href="#<?php
echo $tab_hash;
?>
开发者ID:rmikeska,项目名称:ushipnetwork,代码行数:30,代码来源:tabbed-page.php
示例15:
<a class="right carousel-control" href="#promo-carousel-m" role="button" data-slide="next">
<span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
<span class="sr-only">Next</span>
</a>
</div> <!-- /carousel -->
</div>
<?php
}
?>
<!--end carousel-->
<!--Post Carousel-->
<!--Check for slide show-->
<?php
if (get_row_layout() == 'post_carousel') {
?>
<div class="news_and_events_carousel col-md-12 no-gutter content-section light-grey-bg ">
<div class="news_and_events_carousel-header">
<div class="clearfix row">
<?php
if (get_sub_field('title')) {
?>
<span class="col-md-6 col-md-offset-3"><h4><?php
the_sub_field('title');
?>
</h4></span>
<?php
}
开发者ID:AmosFord,项目名称:fordsage,代码行数:31,代码来源:template-fullpage-scroll.php
示例16: the_sub_field
// echo $iframe
echo $iframe;
?>
</div>
<div class="caption"><?php
the_sub_field("image-caption");
?>
</div>
</div>
</div>
<?php
} elseif (get_row_layout() == 'gallery') {
?>
<?php
$images = get_sub_field('gallery');
if ($images) {
?>
<div class="media">
<div id="slider" class="flexslider <?php
if (get_sub_field('drop-shadow')) {
?>
drop-shadow-slider<?php
}
?>
">
开发者ID:coreymargulis,项目名称:coreymargulis,代码行数:31,代码来源:single.php
示例17: while
<?php
if (have_rows('sections')) {
while (have_rows('sections')) {
the_row();
?>
<?php
get_template_part('templates/sections/_' . get_row_layout());
?>
<?php
}
}
开发者ID:b0123498765,项目名称:template-wordpress,代码行数:13,代码来源:loop-flexible.php
示例18: while
while (have_rows('flexible_content_section')) {
the_row();
// !1 COL LAYOUT
if (get_row_layout() == '1_col_layout') {
get_template_part('/template-parts/flexible', '1col-layout');
}
// end 1 col layout
// !2 COL LAYOUT
// Check if this row layout is in use
if (get_row_layout() == '2_col_layout') {
// get the corresponding template part if it is
get_template_part('/template-parts/flexible', '2col-layout');
}
// end 2 col layout
// !TESTIMONIAL LAYOUT
if (get_row_layout() == 'testimonial_layout') {
get_template_part('/template-parts/flexible', 'testimonial-layout');
}
// end testimonial layout
}
}
?>
</div><!-- end inner -->
</section><!-- end flexible-content-wrapper -->
<?php
}
}
?>
<!-- end repeater field -->
</main>
<?php
开发者ID:Coop920,项目名称:Sterling-Wellness,代码行数:31,代码来源:flexible.php
示例19: elseif
echo $bgimg['sizes']['module-img'];
}
?>
)"></div>
</div>
</div>
</div>
</section>
<?php
}
?>
<?php
} elseif (get_row_layout() == "testimonial") {
$post_object = get_sub_field('testimonial_to_display');
if ($post_object) {
$post = $post_object;
setup_postdata($post);
$sideimg = '';
$bgimg = get_field('side_image');
if (isset($bgimg['sizes']['module-img'])) {
$sideimg = $bgimg['sizes']['module-img'];
}
?>
<section class="features-intro">
<div class="container-fluid">
<div class="row">
<div class="dotted-line gray"></div>
开发者ID:jackrabbit-design,项目名称:jrd-tufts-wp,代码行数:31,代码来源:content-bottom.php
示例20: while
<?php
// check if the flexible content field has rows of data
if (have_rows('flexible_content')) {
// loop through the rows of data
while (have_rows('flexible_content')) {
the_row();
// check current row layout
if (get_row_layout() == 'paragraph_with_headline') {
echo '<h2 class="flex">';
the_sub_field('headline');
echo '</h2>';
the_sub_field('body');
}
// check current row layout
if (get_row_layout() == 'button_with_link') {
echo '<a class="btn" href="';
the_sub_field('button_link');
echo '">';
the_sub_field('button_text');
echo '</a>';
the_sub_field('body');
}
}
} else {
// no layouts found
}
?>
<?php
开发者ID:hhgr,项目名称:uksoccer,代码行数:30,代码来源:content-page.php
注:本文中的get_row_layout函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论