WordPress.org

Ready to get started?Download WordPress

Forums

Simpul Events by Esotech
Make events appear as normal posts on front page (4 posts)

  1. jabaikanos
    Member
    Posted 1 year ago #

  2. geilt
    Member
    Plugin Author

    Posted 1 year ago #

    Yes it is possible, you can just access the post type "events" using WP_Query

    Such as

    $events = new WP_Query('post_type' => 'events');

    while( $events->have_posts() ): $events->the_post();
    the_content();
    endwhile;

    Add any other parts of the query you need and content you need.

    Also, the plugin does it as a widget, just disable the calendar and click to show post.

  3. jabaikanos
    Member
    Posted 1 year ago #

    thanks for the quick reply,

    I'm afraid I'm going to need more detailed instructions as my knowledge and skills are very basic :/

  4. geilt
    Member
    Plugin Author

    Posted 1 year ago #

    You would have to add this to front-page.php or whatever template your home page uses.

    <?php
    $events = new WP_Query( array('post_type' => 'events',
    'post_status' => 'publish',
    'posts_per_page' => 5));

    while( $events->have_posts() ): $events->the_post(); ?>
    <h2><?php the_title(); ?></h2>
    <?php the_content(); ?>
    endwhile;
    ?>

    Try it!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.