dimanche 18 octobre 2015

Display body text from custom post

I'm using PODS to create custom post types. I want to display these post types in my custom template. I've been able to display the title, image, but haven't found a way to display body content yet. I have tried get_the_content( $id ) without luck. Any ideas?

<?php

            $pod = pods( 'selectoffers' );
            $related = $pod->field( 'select' );

            if ( ! empty( $related ) ) {
                foreach ( $related as $rel ) {

                    $id = $rel[ 'ID' ];

                    ?>

                    <div class="col-lg-4">
                    <div class="round-img img-circle" style="background-image:url('<?php echo pods_image_url(get_post_meta( $id, 'bilde', true ), $size = 'full'); ?>');"></div>
                              <h2><?php echo get_the_title( $id ); ?></h2>

                              <p>   [[THIS IS WHERE I WANT TO ADD THE BODY]]   </p>

                              <p><a class="btn btn-default" href="<?php
                                                                 $lenke = get_post_meta( $id, 'lenke', true );
                                                                 echo esc_url( get_permalink( array_shift($lenke) ) );
                                                                 ?>" role="button">Les mer &raquo;</a></p>
        </div><!-- /.col-lg-4 -->



                    <?php

                } //end of foreach
            } //endif ! empty ( $related )
?>



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire