Home Trying to loop advanced custom fields pro functions .php
Reply: 0

Trying to loop advanced custom fields pro functions .php

user1673 Published in April 20, 2018, 10:45 am

I am using Advanced Custom Fields with wordpress but I am having an issue getting it to work with creating a short code. I want to drive my team-member post type with a short code that I Can add into visual composer but I am getting an error this is what I have tried.

function team(){ 

   // get posts
   $posts = get_posts(array(
    'post_type'         => 'team-member'


     if( $posts ): ?>
<?php foreach( $posts as $post ): 
   setup_postdata( $post );       

  $description = get_field('description');
  $name = get_field('name');  

  ' i want to loop here to print out every team member 

    $cnt.='<sction class="row ev-home-4">';
        $cnt.='<div class="col-sm-12 owl-carousel owl-theme" id="teams">';
            $cnt.=' <div class="item ev-home-4-block">
                        <div class="col-sm-12 ev-home-4-block-1">
                            <img src="'.get_site_url().'/wp-content/uploads/2017/11/test-1.png" class="img-responsive">
                            <div class="row row2 ev-home-4-block-2">


    <?php endif; ?>
<?php endforeach; ?>
    return $cnt;

But I am getting the following error


You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.306325 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO