BuddyDev

Search

Replies

  • Participant
    Level: Enlightened
    Posts: 24

    Hi Brajesh,

    Thank you so much for your help. I am trying to add the code as suggested, but it is throwing-up lots of issues. It would be easier just to reference a separate custom post from the dynamic content page.

    i.e. instead of filling out the_content section show a different custom post

    Hope that makes sense.

    Best regards

    John

  • Participant
    Level: Enlightened
    Posts: 24

    Hi Brajesh,

    Thank you for the quick response and updates. To clarify, I am not trying to display a custom post type via the group tab. I am posting via BuddyPress Dynamic Group Tab Content. And I am trying to display the fields in the tab content.

    Do you still recommend the same as above?

    Best regards

    John

  • Participant
    Level: Enlightened
    Posts: 24

    Further to this I mean display the chosen fields within the display content post.

    Advanced custom fields suggest adding this sort of example code to the custom-post.php file.


    <?php

    get_header();
    the_post();

    // vars
    $location = get_field(‘location’);
    $thumbnail = get_field(‘thumbnail’);

    ?>

    <div class=”wrap”>

    <div id=”event-hero”>

    <?php if( $location ): ?>
    <div id=”event-map” class=”acf-map”>
    <div class=”marker” data-lat=”<?php echo $location[‘lat’]; ?>” data-lng=”<?php echo $location[‘lng’]; ?>”></div>
    </div>
    <?php endif; ?>

    <?php if( $thumbnail ): ?>
    ” alt=”<?php echo $thumbnail[‘alt’]; ?>” />
    <?php endif; ?>

    <h2><?php the_title(); ?></h2>
    <h3><?php the_field(‘date’); ?> from <?php the_field(‘start_time’); ?> to <?php the_field(‘end_time’); ?></h3>
    <h4><?php echo $location[‘address’]; ?></h4>

    </div>

    <div id=”primary” class=”content-area”>
    <main id=”main” class=”site-main” role=”main”>
    <?php the_content(); ?>
    </main>
    </div>

    </div>

    <?php get_footer(); ?>

  • Participant
    Level: Enlightened
    Posts: 24

    Hi Brajesh,

    Thank you again for the quick response and adding the functionality to the next release.

    Best regards

    John