Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1084671
    shriyash802
    Participant

    Hi…
    I have set up custom post type named ‘Staff’ and want to use acf to display staff members info such as Address,Age,Gender,Qualification etc.All set up is done but not sure how to display all this fields in theme.

    #1084868
    Thai
    Moderator

    Hi There,

    You can try with the ACF shortcode:

    [acf field="field_name"]

    For more information, please take a look at this article: https://www.advancedcustomfields.com/resources/shortcode/.

    Hope it helps 🙂

    #1085239
    shriyash802
    Participant

    Sorry.I am totally new to CPT and ACF.But where to put these shortcodes.I recently searched and tried some modifications in single-post.php files.It partially worked.Custom post content was out of content area.What can be reason ?

    #1086092
    Lely
    Moderator

    Hi There,

    Thanks for posting in. This would be outside the content area if you have added it outside the main container. If you’re using Cornerstone, above shortcode will work on a RAW CONTENT element or TEXT element. If you really want it to add on a template file, please add it after this line:
    <div class="x-container max width main">
    Or it would be better if you will share the code you have edited so we can check.

    Hope this helps.

    #1089911
    shriyash802
    Participant

    Hi.This is a code….

    <?php

    // =============================================================================
    // VIEWS/INTEGRITY/WP-SINGLE-STAFF.PHP
    // —————————————————————————–
    // Single staff post output for Integrity.
    // =============================================================================

    ?>

    <?php get_header(); ?>

    <div class=”x-container max width offset”>
    <div class=”x-main full” role=”main”>

    <?php while ( have_posts() ) : the_post(); ?>
    <?php x_get_view( ‘integrity’, ‘content’, ‘staff’ ); ?>
    <p><?php the_field(‘bio’); ?></p>
    <p><?php the_field(‘address’); ?></p>
    <?php x_get_view( ‘global’, ‘_comments-template’ ); ?>
    <?php endwhile; ?>

    </div>
    </div>

    <?php get_footer(); ?>

    #1089912
    shriyash802
    Participant
    #1089942
    shriyash802
    Participant

    Problem solved using corner stone.

    #1090247
    Rue Nel
    Moderator

    Hello There,

    We are just glad that you have figured it out a way to correct the said issue.
    Thanks for letting us know!

    Best Regards.

    #1169579
    garcosc
    Participant

    Hello:
    I have a question, How use a ACF repeater wuth shortcode in Cornesrstone?

    Kind regards

    #1169597
    garcosc
    Participant

    I have a ACF Ingredients with two fields (cant, description)

    Per example:
    cant: 300
    description: fish

    cant: 200
    description: butter

    if i put {{acf:ingredients}} shows Array, Array

    I supposed that each Array is a variable (cant, description)

    if put single (without loop)

    {{acf:ingredients_0_cant}} shows 300
    {{acf:ingredients_1_cant}} shows 200
    {{acf:ingredients_0_description}} shows fish
    {{acf:ingredients_1_description}} shows butter

    ¿but can i solve this with javascript ?

    please my brain is shutdown

    Kind regards

    #1169900
    Christian
    Moderator

    Hey there,

    That is currently not supported. Please stay tuned for updates.

    Thanks.

  • <script> jQuery(function($){ $("#no-reply-1084671 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>