I have a snippet of code that basically says to show a field if it's populated. It's an Advanced Custom Field text field.
Here's the working code:
<?php if (get_field('oil_pdf')): ?>
<img src="<?php echo esc_url( home_url( '/' ) ); ?>media/oil-icon-pdf.png"></a>
<?php endif; ?>
I need to change the code to only show if the text field (oil_pdf) includes '.pdf' somewhere in the text string. Not just 'pdf' but '.pdf'
Is this possible?