本文整理汇总了PHP中the_row函数的典型用法代码示例。如果您正苦于以下问题:PHP the_row函数的具体用法?PHP the_row怎么用?PHP the_row使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了the_row函数的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: 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
示例17: 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
示例18: 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
示例19: 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
示例20: pre_save_post
public function pre_save_post($post_id)
{
$post = get_post($post_id);
if ($post_id == 'options' || !isset($post->post_type) || $post->post_type !== 'poll' || isset($_POST['acf']) === false) {
return;
}
//Both user and secret set in the WP settings.
$userId = get_field('agreable_poll_plugin_settings_senti_user_id', 'options');
$secret = get_field('agreable_poll_plugin_settings_firebase_secret', 'options');
if (empty($secret) || empty($userId)) {
return false;
}
$firebase = new \Firebase\FirebaseLib('https://senti.firebaseio.com/', $secret);
$path = 'polls';
$firebasePollId = get_field('agreable_poll_definition_firebase_id', $post_id);
// Update votes from Firebase before saving post.
$firebase_answers = json_decode($firebase->get($path . '/' . $userId . '/' . $firebasePollId . '/answers'));
if (!$firebase_answers) {
return;
}
$rows = [];
if (have_rows('poll_answers', $post_id)) {
while (have_rows('poll_answers', $post_id)) {
array_push($rows, the_row());
}
}
// Modifying $_POST using previous index and values recently extracted from
// firebase.
$post_answers = $_POST['acf']['agreable_poll_definition_answers'];
for ($i = 0; $i < count($post_answers); $i++) {
if ($i < count($rows)) {
// Get previous index from DB.
$previous_index = $rows[$i]['agreable_poll_definition_answers_answer_index'];
if ($previous_index == "") {
$previous_index = $i;
}
$votes = isset($firebase_answers[$previous_index]->votes) ? $firebase_answers[$previous_index]->votes : 0;
// Update post using old index to get correct votes from firebase answers.
$_POST['acf']['agreable_poll_definition_answers'][$i]['agreable_poll_definition_answers_answer_votes'] = $votes;
// Update DB to new index for next time but remove from post.
unset($_POST['acf']['agreable_poll_definition_answers'][$i]['agreable_poll_definition_answers_answer_index']);
update_post_meta($post_id, "poll_answers_{$i}_answer_index", $i);
}
}
// Update number of entries.
$firebase_entries = $firebase->get($path . '/' . $userId . '/' . $firebasePollId . '/entries');
$_POST['acf']['agreable_poll_definition_entries'] = $firebase_entries;
}
开发者ID:shortlist-digital,项目名称:agreable-poll-plugin,代码行数:48,代码来源:SavePost.php
注:本文中的the_row函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论