Forums Forums Search & Filter Pro Show relationship ACF field in results

  • This topic has 21 replies, 2 voices, and was last updated 6 years ago by Anonymous.
Viewing 10 posts - 11 through 20 (of 22 total)
  • Anonymous
    #193230
    This reply has been marked as private.
    Trevor
    #193234
    This reply has been marked as private.
    Anonymous
    #193236
    This reply has been marked as private.
    Trevor
    #193238

    At the moment, this line:

    <p>Univers : <?php the_field('cial_secteur'); ?></p>

    Produces text like:

    Univers : Atlantique

    Yes?

    What does

    <?php $cial_sector = get_field('cial_secteur');
    echo $cial_sector('cial_das');?>

    Give you?

    Anonymous
    #193240

    At this time my code is :

    <div class="commercial">
    			<h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
    			<p>Mail : <?php the_field('cial_email'); ?></p>
    			<p>Téléphone : <?php the_field('cial_telephone'); ?></p>
    			<?php if( get_field('cial_das') ):?>
    			<p>Univers : <?php the_field('cial_das'); ?></p>
    			<?php endif; ?>			
    		</div>
    
    You can see the result at the bottom of this page : http://festilight.com/festilight-deco
    
    For exemple if you select "Atlantique", all the informations are good and visible.
    
    When I add 
    
    <code><p>Univers : <?php the_field('cial_secteur'); ?></p></code>
    
    (there is a mistake, it's not "Univers :" but "secteur" it's like "localization :" in english but it's not a problem for now)
    
    So 

    <p>Univers : <?php the_field(‘cial_secteur’); ?></p>

    That break my page and don’t show my footer.

    Anonymous
    #193242
    This reply has been marked as private.
    Trevor
    #193292
    This reply has been marked as private.
    Anonymous
    #193377
    This reply has been marked as private.
    Trevor
    #193395

    It took me a little while, but this seems to do it:

    <p>Secteur : <?php $cial_secteur = get_field('cial_secteur');
    $cial_secteur_rec = $cial_secteur[0];
    echo $cial_secteur_rec -> post_title;?></p>
    Anonymous
    #193401
    This reply has been marked as private.
Viewing 10 posts - 11 through 20 (of 22 total)