Support

Account

Forum Replies Created

  • Thank you very much for your help,

    it works very well now :-),

    good evening

  • Hello and thank you for your answer,
    I tried this but I think I did wrong the code,
    Can you see when you have time?
    thank you

    <?php
    $group_ID = 30109;
    $fields = array();
    $fields = apply_filters('acf/field_group/get_fields', $fields, $group_ID);
    
    $exclude = array('field_5919f45752917', 'field_5919f46252918', 'field_5919f46a52919');
    
    if( $fields )
    {
    echo '<div class="col-sm-6">';
    echo '<h3>Description:</h3>';
        echo '<ul class="list-unstyled">';
      foreach( $fields as $field_name => $field ) {
      if (in_array($field['key'], $exclude) {
      {
        $value = get_field( $field['name'] );
        if ($field['choices']){
          $map = array(
           'yes' => '<i class="icon-ok"></i>'       
           );
          $value = $map[ $value ];
        } else {
        }
        if( $value && $value != 'no') {
          echo '<li>' . $field['label'] . '&nbsp;' . $value . '</li>';
      }
        continue;
      }
    }
      echo '</ul>';
    echo '</div>';
    }
    ?>
  • Hello,

    Is it possible to exclude with my code present at the top?

    thank you

  • I did like that,
    But I wonder if we can not do otherwise

    Here’s my code, is there optimized?

    	if( get_field('pp_marque') ): 
    	echo '<h3 class="uppercase" data-text-color="primary"> MY GROUPE </h3>';
    	endif;

    thanks

  • Good evening,

    I searched as you said I found the solution
    But I have to adapt all my codes as I was otherwise doing for display.

    However, there is one thing I can not do,

    I have a title for my group
    And when my group completes the title is displayed it’s normal

    But I would like that when my group is empty, that the title is not displayed

    echo '<h3 class="uppercase" data-text-color="primary"> MY GROUPE </h3>';

    Can you help me?

    Here is my final code

    <?php
    
    	$group_ID = 30117;
    	
    	$fields = array();
    	$fields = apply_filters('acf/field_group/get_fields', $fields, $group_ID);
    	
    	if( $fields )
    	{
    	echo '<div class="row">';
    	echo '<div class="product-footer">';
    	echo '<div class="col large-12">';
    	
    	echo '<h3 class="uppercase" data-text-color="primary"> MY GROUPE </h3>';
    	  foreach( $fields as $field_name => $field )
    	  {
      if ($i % 2 != 0) 
        $rowColor = "#f2f2f2";
      else 
        $rowColor = "#ffffff";
    	  {
    	    $value = get_field( $field['name'] );
    
    	    if( $value && $value != 'no') {
    	      	
    	      	echo '<div style="background:' . $rowColor . ';height:35px;width:100%;padding:5px 5px 5px 0px;">';
    			echo '<div style="width:40%;float:left;"><b>'. $field['label'] .'</b></div>';
    			echo '<div style="width:60%;float:left;">' . $value . '</div>';
    			echo '</div>';
    			$i++;
    	  }
    	}
    	}
    	echo '</div>';
    	echo '</div>';
    	echo '</div>';
    	}
    	
    ?>

    thanks you

  • Hello,
    you are right,
    that works very well
    it’s good now I understand we now cover: s

    I had made the wrong rule

    Thank you for your help 🙂

  • I did like on your screen, but it does not work
    can you tell me if you see the test video?
    ->

    http://d.pr/v/qjxK

    thanks

  • hello,

    I would like to show my AFC
    simply for categories except category blog
    and exclude for pages

    thanks

    try 1

    https://s4.postimg.io/siwpnzb0d/image.png

    try 2

    https://s10.postimg.org/hnhfqs0bd/image.png

  • Hello,

    I would exclude my group of custom fields

    on every page and also when I selected the category Blog

    otherwise it can be displayed for the remains of categories

    Your combination is logical is good
    but when I selected a second condition that bug

    but if I selected a condition that works, but not 2

    you can see this video please

    http://d.pr/v/HnfA

    Thank you

  • Hello,

    when I excluded for pages it works,

    but if I active for categories and pages
    it works just and only for categories

    I do not understand 🙁

    I would like to exclude pages and category I chose to exclude

    see pictures please
    -> http://d.pr/i/otbz

  • I solved the problem
    with plugins
    -> Custom Bulk / Quick Edit

  • Hello,

    I looked at your link
    but I did not understand
    or I have to put the custom fields

    And I found this query but it does not work

    INSERT INTO wp_postmeta (post_id, meta_key, meta_value) SELECT wp_posts.ID, 'my-custom-field', 0 FROM wp_posts WHERE wp_posts.post_status = 'publish' AND wp_posts.post_type='hello';

    -> https://snippets.khromov.se/batch-adding-custom-field-to-posts/

    I am looking for a query that can add custom fields and make all update to post

    thanks

  • Good evening,
    as I said yesterday I have a track but I do not know if this is the best way,
    Here are the source code

    
    <?php if( get_field('opening_hours') ): ?>
    <div class="news-v3 margin-bottom-60">
        <div class="news-v3-in">
         <h2>Opening hours</h2>
         <br><br/>
         <p>
           Monday: 			<?php the_field('monday'); ?>	<br/>
           Tuesday: 			<?php the_field('tuesday'); ?>	<br/>
           Wednesday: 			<?php the_field('wednesday'); ?>	<br/>
           Thursday: 			<?php the_field('thursday'); ?>	<br/>
           Friday: 			<?php the_field('friday'); ?>	<br/>
           Saturday: 			<?php the_field('saturday'); ?>	<br/>
           Sunday: 			<?php the_field('sunday'); ?>	<br/>
         </p>
         </div>
         </div>
     <?php endif; ?>  
    
    
  • Hello,
    I am almost at my goal.

    I use the conditions and it works well, and I also use date and time picker to set the time.

    But I wonder if I can determine for one day

    the beginning and end of the opening

    Example Monday xx: xx to xx: xx on the same fields personalize

    here is a video of my test

    https://www.youtube.com/watch?v=uNoS7B20LsI

    Thank you

  • OK if I want to use fields that repeat,
    I have to take ACF pro?

    it is possible to have a screenshot of what you explain above for a better understanding?

    Thank you

  • Hello,

    ACF I know, I already use
    I know customize display fields on my template,
    until the no worries.

    I just try to find a logic to display hours for stores.

    Automatic template or I simply between the hours, the days are already present in the back office …

    A condition

    Show hours of shops

    If I click yes

    it displays the days already record, just for me just add hours

    If not

    nothing to do

    Because

    I can see like that,
    but I try to see if we can help it and just

    <?php if( get_field('hour_monday') ): ?>
    Monday: <?php the_field('hour_monday'); ?>
    <?php endif; ?>
    <?php if( get_field('hour_sunday') ): ?>
    Sunday: <?php the_field('hour_sunday'); ?>
    <?php endif; ?>
    

    thank you

Viewing 17 posts - 1 through 17 (of 17 total)