• Resolved Owusu Marfo

    (@erhmirhnem)


    Hi,

    I am using the code below to fetch fields on my services page.
    I need to however display the same content on the homepage.
    Can u please help?

    $fields = CFS()->get(‘services’);
    foreach ((array)$fields as $field) {
    echo ‘<div class=”col-sm-4″>’;
    echo ‘<p>‘ . $field[‘service_title’]. ‘</p>’;
    echo ‘<div>’ . ‘<img src=’ . $field[‘service_image’] . ‘>’ . ‘</div>’;
    echo $field[‘service_content’];
    echo ‘<p class=”more” align=right>’ .$field[‘service_link’]. ‘<p>’;
    echo ‘</div>’;
    }

    https://ww.wp.xz.cn/plugins/custom-field-suite/

Viewing 1 replies (of 1 total)
  • Plugin Author Matt Gibbs

    (@mgibbs189)

    The get() method accepts a post ID as an optional 2nd parameter.

    CFS()->get( ‘the_field_name’, THE_POST_ID );

Viewing 1 replies (of 1 total)

The topic ‘Fetch fields onto a different page template’ is closed to new replies.