Advanced Custom Fields

Posted in: Newspaper
Post count: 73

Hi,

I’m trying to make some custom fields appear. I see other people on the forum is able to make this work.

Another contributor here adviced to add some simple html code to check that I’m adding the code in the right place. And that works but as soon as I try to add some php to get the advanced custom fields nothing appears.

I’ve tried the following code without any success:

<?php echo get_field(‘company_name’);?>

<?php the_field(‘company_name’); ?>

<?php get_field(‘company_name’); ?>

I’ve also tried “ACF export code function” but did not work either.

Here you can see an example of the code I’ve tried in loop_5: https://www.dropbox.com/s/juhws2h5cpdgcnc/acf%20code%20in%20template%20-%20printscreen.jpg?dl=0

Herre you can see the actual post: http://businesstrade.eu/2014/08/sales-agents-within-fashion-scandinavia-wanted/

Hope somebody with some experience with ACF can give me a ocuple of pointers. Thanks!!

Kind regards
Lars

Post count: 22421

Hello,
In order to use ACF you need to add shortcodes in the desired place in the theme files so a basic knowledge is required on how the WP template hierarchy works. you can follow their official docs to get an idea of what to do: http://www.advancedcustomfields.com/resources/displaying-custom-field-values-in-your-theme/
You will also require basic PHP knowledge to tie in the shortcode to the existing code.
You can also do a quick search through our forums to see solutions other users found:
https://forum.tagdiv.com/search/advanced+custom+fields/
I hope this helps.
Thank you!

Viewing 2 posts - 1 through 2 (of 2 total)
The forum ‘Newspaper’ is closed to new topics and replies.