• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP have_rows函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



在下文中一共展示了have_rows函数的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: page_testimonials

function page_testimonials()
{
    ?>

	<div class="container-fluid section-spacing background-color-dark-blue">

		<div class="container wrap">

			<div class="row">

				<?php 
    if (have_rows('reviews')) {
        while (have_rows('reviews')) {
            the_row();
            // Testimonial
            $review = get_sub_field('review');
            $author = get_sub_field('author');
            $content_out = sprintf('
			        		<blockquote class="text-italic col-md-8 col-md-offset-2">
										<div class="quote-content"><p>“%s”</p></div>
										<div class="quote-author text-left">%s</div>
									</blockquote>', $review, $author);
            echo $content_out;
        }
    }
    ?>

			</div>

		</div>

	</div>

	<?php 
}
开发者ID:finestpixels,项目名称:riverplace2016,代码行数:35,代码来源:page-testimonials.php


示例3: byadr_layout_builder

 function byadr_layout_builder()
 {
     $lb = get_field('activar_layout_builder');
     if ($lb) {
         if (have_rows('layout_builder')) {
             while (have_rows('layout_builder')) {
                 the_row();
                 // TEXT BLOCK
                 require get_template_directory() . '/inc/acf/lb-text-block.php';
                 // QUOTE
                 require get_template_directory() . '/inc/acf/lb-quote.php';
                 // GALLERY
                 require get_template_directory() . '/inc/acf/lb-gallery.php';
                 // VIDEO
                 require get_template_directory() . '/inc/acf/lb-video.php';
                 // IMAGE
                 require get_template_directory() . '/inc/acf/lb-image.php';
                 // MOSAICO
                 require get_template_directory() . '/inc/acf/lb-grid.php';
                 // SLIDER PRECIOS
                 require get_template_directory() . '/inc/acf/lb-slider.php';
                 // GRILLA DE IMAGENES
                 require get_template_directory() . '/inc/acf/lb-grilla.php';
                 // ZONAS DEPILACION
                 require get_template_directory() . '/inc/acf/lb-zonas.php';
                 // LISTADO DE ICONOS
                 require get_template_directory() . '/inc/acf/lb-icon-list.php';
                 // LISTADO DE PRECIOS
                 require get_template_directory() . '/inc/acf/lb-price-list.php';
             }
         }
     } else {
         echo get_template_part('template-part/content', 'default');
     }
 }
开发者ID:byadrenaline,项目名称:laseravalon_wp,代码行数:35,代码来源:acf-functions.php


示例4: ss_include_slick_carousel

function ss_include_slick_carousel()
{
    if (have_rows('slick_carousel_slider')) {
        // repeater field: Slick Carousel Repeater
        echo '<div class="wrap carousel-slider">';
        echo '<div id="slider" class="carousel responsive-carousel">';
        while (have_rows('slick_carousel_slider')) {
            the_row();
            // loop through the repeater field
            $image = get_sub_field('image');
            // get image from repeater
            echo '<div>';
            echo '<a rel="lightbox" class="fancybox-ss" href="';
            echo $image['url'];
            echo '"><img src="';
            echo $image['url'];
            echo '" alt="" /></a>';
            echo '</div>';
        }
        // end loop
        echo '</div>';
        echo '</div>';
    }
    // End Carousel repeater
}
开发者ID:Shelob9,项目名称:slick-slider-genesis-wordpress,代码行数:25,代码来源:carousel-slider.php


示例5: byadr_layout_builder

 function byadr_layout_builder()
 {
     $lb = get_field('activar_layout_builder');
     if ($lb) {
         if (have_rows('layout_builder')) {
             while (have_rows('layout_builder')) {
                 the_row();
                 // TEXT BLOCK
                 require get_template_directory() . '/inc/acf/lb-text-block.php';
                 // QUOTE
                 require get_template_directory() . '/inc/acf/lb-quote.php';
                 // GALLERY
                 require get_template_directory() . '/inc/acf/lb-gallery.php';
                 // VIDEO
                 require get_template_directory() . '/inc/acf/lb-video.php';
                 // IMAGE
                 require get_template_directory() . '/inc/acf/lb-image.php';
                 // MOSAICO
                 require get_template_directory() . '/inc/acf/lb-grid.php';
             }
         }
     } else {
         echo get_template_part('template-part/content', 'default');
     }
 }
开发者ID:byadrenaline,项目名称:byadr-theme,代码行数:25,代码来源:acf-functions.php


示例6: render

 public function render()
 {
     if (have_rows('carousel_items')) {
         //acf
         $otpt = '<div class="featured-carousel carousel cf">';
         while (have_rows('carousel_items')) {
             the_row();
             $item_image = get_sub_field('item_image');
             $description = get_sub_field('above_line');
             $link_to = get_sub_field('link_to');
             $button_text = get_sub_field('below_line');
             $otpt .= '<div class="carousel-item">';
             $imgDir = '\\Library\\php\\picture';
             $imgObj = new $imgDir();
             $imgObj->add_images_array(array($item_image['sizes']['full'], $item_image['sizes']['desktop'], $item_image['sizes']['tablet'], $item_image['sizes']['mobile']));
             $imgObj->setClass('carousel-image');
             $otpt .= $imgObj->templateBackground();
             $otpt .= '<div class="carousel-text">';
             $otpt .= '<a class="block " href="' . $link_to . '"><div class="carousel-description carousel-underline f-size-big">' . $description . '</div>';
             $otpt .= '<div class="carousel-description f-size-big">' . $button_text . '</div></a>';
             $otpt .= '</div>';
             $otpt .= '</div>';
         }
         $otpt .= '</div>';
     } else {
         $otpt = 'repeat has no rows';
     }
     return $otpt;
 }
开发者ID:AnthonyLevillon,项目名称:mello_carousel,代码行数:29,代码来源:carousel.php


示例7: __construct

 function __construct()
 {
     if (get_sub_field('wrap') != null) {
         $this->wrap = get_sub_field('wrap');
     }
     $i = 0;
     if (have_rows('tours')) {
         while (have_rows('tours')) {
             the_row();
             if (get_sub_field('title') != null) {
                 $this->tours[$i]['title'] = get_sub_field('title');
             }
             if (get_sub_field('description') != null) {
                 $this->tours[$i]['description'] = get_sub_field('description');
             }
             if (get_sub_field('price') != null) {
                 $this->tours[$i]['price'] = get_sub_field('price');
             }
             if (get_sub_field('duration') != null) {
                 $this->tours[$i]['duration'] = get_sub_field('duration');
             }
             if (get_sub_field('link_button') != null) {
                 $this->tours[$i]['link_button'] = get_sub_field('link_button');
             }
             $i++;
         }
     }
 }
开发者ID:AnthonyLevillon,项目名称:mello_tourdescription,代码行数:28,代码来源:tourdescription.php


示例8: build_scoreset

 public function build_scoreset()
 {
     $this->elp_content = '<section class="elp-content">';
     foreach ($this->elp_categories as $category) {
         //we'll need these strings to call fields from within loops
         $field_base_name = strtolower(preg_replace('/\\s+/', '', $category));
         $repeater_field_title = $field_base_name . '_scores';
         $score_field_title = $field_base_name . '_score';
         $note_field_title = $field_base_name . '_score_additional_text_and_images';
         $date_field_title = $field_base_name . '_score_date';
         //catgory heading for each category
         $this->elp_content .= '<div class="elp-category cat-' . $field_base_name . '">';
         $this->elp_content .= '<h3>' . $category . '</h3>';
         //for each repeater row, three fields
         while (have_rows($repeater_field_title)) {
             the_row();
             if (get_sub_field('show_on_front') == true) {
                 $this->elp_content .= '<div class="elp-date elp-' . $field_base_name . '">' . get_sub_field($date_field_title) . '</div>';
                 $this->elp_content .= '<div class="elp-score elp-' . $field_base_name . '">' . get_sub_field($score_field_title) . '</div>';
                 $this->elp_content .= '<div class="elp-score-notes elp-' . $field_base_name . '">' . get_sub_field($note_field_title) . '</div>';
             }
         }
         //end repeater instance(s)
         $this->elp_content .= '</div>';
     }
     $this->elp_content .= '</section>';
 }
开发者ID:bacalj,项目名称:wp-european-language-assessment,代码行数:27,代码来源:elp_class.php


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


示例10: getAlternateLanguages

 private function getAlternateLanguages()
 {
     if (have_rows('quan_meta_hreflang')) {
         while (have_rows('quan_meta_hreflang')) {
             the_row();
             echo sprintf('<link rel="alternate" href="%s" hreflang="%s" />', get_permalink(get_sub_field('quan_meta_hreflang_url')), get_sub_field('quan_meta_hreflang_code'));
         }
     }
 }
开发者ID:alpipego,项目名称:wp-quan-postmeta,代码行数:9,代码来源:Plugin.php


示例11: get_new_report_count

 public function get_new_report_count($repeater_field)
 {
     $report_with_new_status = array();
     while (have_rows($repeater_field)) {
         the_row();
         if (get_sub_field('report_status') == 'New') {
             array_push($report_with_new_status, get_sub_field('report_status'));
         }
     }
     return count($report_with_new_status);
 }
开发者ID:patrickbjohnson,项目名称:lod-reporting-site,代码行数:11,代码来源:class-report-view-model.php


示例12: fill_slides

 public function fill_slides()
 {
     if (have_rows('slides')) {
         while (have_rows('slides')) {
             the_row();
             $image = get_sub_field('image');
             $title = get_sub_field('slide_title');
             $desc = get_sub_field('slide_description');
             $this->add_slide($image, esc_js($title), trim(preg_replace('/\\s+/', ' ', $desc)), $image);
         }
     }
 }
开发者ID:blizzardwatch,项目名称:BlizzardWatch,代码行数:12,代码来源:BlizzardWatchGallery.php


示例13: uf_slider_output

function uf_slider_output($sliderSlug = 'default')
{
    $output = '';
    if (have_rows('sliders', 'options')) {
        while (have_rows('sliders', 'options')) {
            the_row();
            $currentSlider = get_sub_field('slider_slug', 'options');
            if (get_sub_field('slider_slug', 'options') == $sliderSlug) {
                while (have_rows('slides', 'options')) {
                    the_row();
                    // echo get_sub_field('caption', 'options');
                }
                $activeClass = 'active';
                $sliderCount = 0;
                $output .= '<div id="uf-slider-' . $sliderSlug . '" class="carousel slide round" data-ride="carousel">';
                $output .= '<ol class="carousel-indicators">';
                while (have_rows('slides', 'options')) {
                    the_row();
                    // echo get_sub_field('caption', 'options');
                    $output .= '<li data-target="#uf-slider-' . $sliderSlug . '" data-slide-to="' . $sliderCount . '" class="' . $activeClass . '"></li>';
                    $activeClass = '';
                    $sliderCount++;
                }
                $output .= '</ol>';
                $activeClass = 'active';
                $output .= '<div class="carousel-inner round" role="listbox">';
                while (have_rows('slides', 'options')) {
                    the_row();
                    $output .= '<div class="item round ' . $activeClass . '">';
                    $output .= '<img src="' . acf_image_slider(get_sub_field('image', 'options'), $sliderSlug) . '" class="round">';
                    // $output .= print_r(get_sub_field('image', 'options'));
                    $output .= '<div class="carousel-caption">';
                    $output .= get_sub_field('caption', 'options');
                    $output .= '</div>';
                    $output .= '</div>';
                    $activeClass = '';
                }
                $output .= '</div>';
                $output .= '<!-- Controls -->';
                $output .= '<a class="left carousel-control" href="#uf-slider-' . $sliderSlug . '" role="button" data-slide="prev">';
                $output .= '<span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>';
                $output .= '<span class="sr-only">Previous</span>';
                $output .= '</a>';
                $output .= '<a class="right carousel-control" href="#uf-slider-' . $sliderSlug . '" role="button" data-slide="next">';
                $output .= '<span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>';
                $output .= '<span class="sr-only">Next</span>';
                $output .= '</a>';
                $output .= '</div>';
            }
        }
    }
    return $output;
}
开发者ID:jameswburke,项目名称:ufbase,代码行数:53,代码来源:uf-slider.php


示例14: get_features

function get_features($language)
{
    if (have_rows('feature_content')) {
        while (have_rows('feature_content')) {
            the_row();
            //all features
            feature_full($language);
            feature_grid_2_2_editor($language);
        }
        wp_reset_query();
    }
}
开发者ID:McCouman,项目名称:ultraschall-plugin,代码行数:12,代码来源:features-functions.php


示例15: acf_load_goole_fonts

 function acf_load_goole_fonts($field)
 {
     $fonts = get_field('db_fonts', 'options');
     $field['choices'] = array();
     if (have_rows('db_fonts', 'option')) {
         while (have_rows('db_fonts', 'option')) {
             the_row();
             $font = get_sub_field('db_font');
             $value = $font['font'];
             $field['choices'][$value] = $value;
         }
     }
     return $field;
 }
开发者ID:dungtd91,项目名称:bones,代码行数:14,代码来源:backend.php


示例16: the_pc_jumbotron

function the_pc_jumbotron()
{
    if (is_singular()) {
        if (have_rows('jumbotron_slides')) {
            get_template_part('parts/jumbotron');
            return;
        }
        if (get_field('main_heading')) {
            get_template_part('parts/main-heading');
            return;
        }
    }
    get_template_part('parts/main-heading-default');
}
开发者ID:jabrankhalil,项目名称:testsite,代码行数:14,代码来源:functions.php


示例17: get_box_content

function get_box_content($language)
{
    if (have_rows('content')) {
        while (have_rows('content')) {
            the_row();
            //all girds
            grid_full($language);
            grid_1_2_editor($language);
            grid_1_2_input($language);
        }
    } else {
        echo 'Error: content mismatch!';
    }
}
开发者ID:McCouman,项目名称:ultraschall-plugin,代码行数:14,代码来源:page-functions.php


示例18: related_content_related_links

function related_content_related_links($object, $field_name, $request)
{
    // check if the repeater field has rows of data
    if (have_rows('related_links')) {
        $related_links_link_text_array = array();
        // loop through the rows of data
        while (have_rows('related_links')) {
            the_row();
            // display a sub field value
            $related_links_link_text_array[] = array('url' => get_sub_field('link_url'), 'text' => get_sub_field('link_text'));
        }
    }
    return $related_links_link_text_array;
}
开发者ID:Blake-C,项目名称:wp-plugin-related-content,代码行数:14,代码来源:related-content.php


示例19: socialicons_func

/**
 * Social Icons shortcode
 */
function socialicons_func($atts, $content = null)
{
    $atts = shortcode_atts(array(), $atts);
    $output = '';
    if (have_rows('social_icons', 'options')) {
        $output .= '<ul class="socialicons">';
        while (have_rows('social_icons', 'options')) {
            the_row();
            $output .= '<li><a href="' . get_sub_field('url') . '" class="' . get_sub_field('slug') . '-dark" target="_blank">' . get_sub_field('name') . '</a></li>';
        }
        $output .= '</ul>';
    }
    return $output;
}
开发者ID:rku4er,项目名称:onebrideguide-wp,代码行数:17,代码来源:extras.php


示例20: pageWithSections

 public function pageWithSections()
 {
     $result = '<section class="subtemplate-container">';
     global $post;
     $id = $post->ID;
     if (have_rows('page_section', $id)) {
         while (have_rows('page_section', $id)) {
             the_row();
             $image = get_sub_field('image', $id);
             $rightContent = get_sub_field('right_content', $id);
             $email = get_sub_field('email', $id);
             $facebook = get_sub_field('facebook_url', $id);
             $twitter = get_sub_field('twitter_url', $id);
             $instagram = get_sub_field('intagram_url', $id);
             $logo = get_sub_field('logo', $id);
             $imageMarkup = '';
             if ($image) {
                 $imageMarkup = "<img src='{$image["sizes"]["tall-images"]}' alt='{$image["alt"]}' class='side-image'>";
             }
             $emailMarkup = '';
             if ($email) {
                 $imageUrl = BACKYARD_TEMPLATE_URL . "/images/social/mail-sm.png";
                 $emailMarkup = "<li><a href='mailto:{$email}' class='email'><img src='{$imageUrl}' alt='Mail'></a></li>";
             }
             $facebookMarkup = '';
             if ($facebook) {
                 $imageUrl = BACKYARD_TEMPLATE_URL . "/images/social/facebook-sm.png";
                 $facebookMarkup = "<li><a href='{$facebook}' class='facebook' target='_blank'><img src='{$imageUrl}' alt='Mail'></a></li>";
             }
             $twitterMarkup = '';
             if ($twitter) {
                 $imageUrl = BACKYARD_TEMPLATE_URL . "/images/social/twitter-sm.png";
                 $twitterMarkup = "<li><a href='{$twitter}' class='twitter' target='_blank'><img src='{$imageUrl}' alt='Mail'></a></li>";
             }
             $instagramMarkup = '';
             if ($instagram) {
                 $imageUrl = BACKYARD_TEMPLATE_URL . "/images/social/insta-sm.png";
                 $instagramMarkup = "<li><a href='{$instagram}' class='instagram' target='_blank'><img src='{$imageUrl}' alt='Mail'></a></li>";
             }
             $logoMarkup = '';
             if ($logo) {
                 $logoMarkup = "<img src='{$logo["url"]}' alt='{$logo["alt"]}' class='other-logo'>";
             }
             $result .= "\n\t\t\t\t\t<div class='subtemplate'>\n\t\t\t\t\t\t{$imageMarkup}\n\t\t\t\t\t\t<div class='side-content'>\n\t\t\t\t\t\t\t{$logoMarkup}\n\t\t\t\t\t\t\t{$rightContent}\n\t\t\t\t\t\t\t<ul class='contact-points'>\n\t\t\t\t\t\t\t{$emailMarkup}\n\t\t\t\t\t\t\t{$facebookMarkup}\n\t\t\t\t\t\t\t{$twitterMarkup}\n\t\t\t\t\t\t\t{$instagramMarkup}\n\t\t\t\t\t\t\t</ul>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t";
         }
     }
     $result .= "</section>";
     return $result;
 }
开发者ID:sarahetter,项目名称:thebackyard,代码行数:49,代码来源:controller.inc.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP have_ruleint_access函数代码示例发布时间:2022-05-15
下一篇:
PHP have_right函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap