• This is my code that I write in single-mytaxonomy.php file.

    <?php start_short(); ?>
    [if term="berner"]
    [if field="berner-5"]<p><b>Date: </b>[field berner-5]</p>[/if]
    [if field="berner-6"]<p><b>Price: </b>[field berner-6]</p>[/if]
    [/if]
    <?php end_short(); ?>

    It display somethink like this (view screenshoot)
    https://prntscr.com/7ykaj6

    I tried this code too, It’s show nothing.

    <?php start_short(); ?>
    [if term="berner"]
    [-if field="berner-5"]<p><b>Date: </b>[field berner-5]</p>[/-if]
    [-if field="berner-6"]<p><b>Price: </b>[field berner-6]</p>[/-if]
    [/if]
    <?php end_short(); ?>

    https://www.ads-software.com/plugins/custom-content-shortcode/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Eliot Akira

    (@miyarakira)

    OK, I will look into this and let you know what I find. It looks like [if] is not getting the same field value as [field].

    Thread Starter davidanielyan

    (@davidanielyan)

    Dear Eliot,
    All those fields generated by ACF plugin.
    Does it reason for this conflict?

    Plugin Author Eliot Akira

    (@miyarakira)

    I don’t think it’s a conflict with ACF.

    Could you try the newest plugin update to see if this is solved?

    There is some issue with line 666 in if.php. Somehow it is breaking my “every” condition.
    I’ve commented it out for now.

    if ( CCS_To_ACF::$state['is_repeater_or_flex_loop'] && !empty($every) ) {
    			$condition = ( CCS_To_ACF::$state['repeater_index'] % $every == 0 );
    		}
    Plugin Author Eliot Akira

    (@miyarakira)

    Hi Agent Codesmith, thanks for pointing this out. It was a mistake in using true/false as a string (the above condition was always true, i.e., not empty) instead of boolean value. I fixed it in the latest plugin update.

    @davidanielyan

    About your original question, the second code block you described should be working with nested [if] — except this line here:

    [if term="berner"]

    There needs to be a taxonomy specified:

    [if taxonomy="something" term="berner"]
Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘[-if] … [/-if] inside [if]..[/if] doesn't display fields correctly’ is closed to new replies.