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 Ernest Marcinko 3 years, 12 months ago.
- AuthorPosts
- June 12, 2019 at 11:10 pm #23131
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
June 13, 2019 at 7:41 am #23135Hi,
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 :)
- AuthorPosts
You must be logged in to reply to this topic.