{!-- Custom URL Segment Data --} {if '{stash:channel_id}'=='74' || '{stash:channel_id}'=='84' || '{stash:channel_id}'=='134' || '{stash:channel_id}'=='139'} {exp:query sql="SELECT field_id_587 as cust_url, count(*) as the_count FROM exp_channel_data WHERE entry_id = {stash:entry_id} LIMIT 1"} {stash:custom_url}{if cust_url}{cust_url}{/if}{/stash:custom_url} {/exp:query} {if:else} {exp:query sql="SELECT field_id_544 as cust_url, count(*) as the_count FROM exp_channel_data WHERE entry_id = {stash:entry_id} LIMIT 1"} {stash:custom_url}{if cust_url}{cust_url}{/if}{/stash:custom_url} {/exp:query} {/if}