Advanced Description Field if else

Home Forums Product Support Forums Ajax Search Pro for WordPress Support Advanced Description Field if else

This topic contains 1 reply, has 2 voices, and was last updated by

 
Keymaster
2 years, 7 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #23131

    Participant

    I use Advanced Description Field (default: {descriptionfield} section.

    I need if else method in description field section.. I am using ACF plugin.

    For example:

    <?php if( get_field(‘alt_konu’) ): ?><span class=”alt_konu”>Alt konu: {alt_konu}</span><?php endif; ?>

    But sometimes alt_konu field empty.. I dont need empty string text… I seen always “Alt konu:” text..

    I am trying all PHP method if and else… Dont accept your description section..

    For example I am trying remove text this PHP method:

    <?PHP
    $altkonu='<span class=”alt_konu”>Alt konu: {alt_konu}</span>’;
    $altkonugizli='<span class=”alt_konu” style=”display:none;”></span>’;
    if (get_field(‘alt_konu’)!=”){ echo $altkonu; } else{define(‘Alt Konu:’,’ ‘); echo $altkonugizli;} ?>

    All method not acceptable..

    How possible ı using if and else method in description section?

    Why dont hidden string text “Alt konu:”… Field value hidden but ı added manuel text showing…

    Please check..

    LOCATION SETTINGS:

    https://uro365.uroturk.org.tr/wp-admin/admin.php?page=asp_settings&asp_sid=1#701

    #23135

    Hi,

    You can use simple conditional brackets there, as explained within this documentation.

    In your example, it would look something like:

    [<span class='alt_konu'>Alt konu: {alt_konu}</span>]

    This bracket content is only displayed, if alt_konu field exists.

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


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

You must be logged in to reply to this topic.