WordPress Output all Custom Fields on Post or Page

Glenn Blog 0 Comments

Knowing what custom fields are outputting on your page or post / custom post can be very helpful when you are building up and/or testing dynamic content in WordPress. Here is a WordPress snippet that uses a shortcode to do just that:- WordPress Output all Custom Fields on Post or Page PHP Code Add the following to your child them’s …

Show ACF Custom Field Outside Loop

Glenn Glenn's Blog 2 Comments

This is how to display an Advanced Custom Field (ACF) outside of the WordPress Loop:- Or to extend the code to only show if the field is present:- In our tests we have found that ‘the_field’ and ‘get_field’ are interchangeable methods – the main thing is to ensure that you add ‘$post->ID’.