WordPress.org

Ready to get started?Download WordPress

Forums

Custom Content Types - Displaying Content On 1 Page? (4 posts)

  1. gotmedia
    Member
    Posted 4 years ago #

    Hi there,

    Can someone please help me? This is something I've been trying to figure out for a couple of years, and since 3.0, it's been itching me like crazy since I'm so close!

    I created a custom content type called Events and added in my fields. I go to "Add New Event" and add my event, it's added; preview here: http://64.13.250.167/events/annual-meeting/.

    So I create another New Event here: http://64.13.250.167/events/another-event/

    How do I pull the information from both of those pages, in fact, all the content underneath the content-type of "events" onto one single page?

  2. esmi
    Forum Moderator
    Posted 4 years ago #

  3. gotmedia
    Member
    Posted 4 years ago #

    Figured it out! Thank you esmi :) :) :) Now, I can't stop smiling.

  4. gotmedia
    Member
    Posted 4 years ago #

    This is what I ended up doing in combination with the Easy Post Types plugin (if anybody's curious):

    <?php
    $loop = new WP_Query( array( 'post_type' => 'events', 'posts_per_page' => -1 ) );
    while ( $loop->have_posts() ) : $loop->the_post();
    the_title();
    the_ept_field('date');
    the_ept_field('event_name');
    the_ept_field('event_location');
    the_ept_field('description');
    the_post_thumbnail();
      echo '<div class="entry-content">';
      the_content();
      echo '</div>';
    endwhile;
    ?>

Topic Closed

This topic has been closed to new replies.

About this Topic