Support » Plugin: Events Manager » [Plugin: Events Manager] Show events as regular posts (articles)

Viewing 15 replies - 16 through 30 (of 40 total)
  • Thanks adelonwl, I forgot I had changed the ‘Reading’ settings, they now show up in the twentyeleven theme.

    Unfortunately like robinmchugh I’m using an Organic parent theme that uses the Options Framework plugin to choose the categories to display on the home page. I think since it only allows me to choose categories, rather than custom post types, that is the issue, correct?

    Any ideas?

    Site is here: http://www.evolveboston.com/wp_themetest/

    Thanks!

    I think I have the same problem. I have been using Arthemia, and have been able to get events to show up as posts, using agelonwl’s snippet… thank you!!

    However, I have no success trying to filter by categories. I have tried the following to no avail.

    <?php
    $the_query = new WP_Query( array ( 'post_type' => array( 'post, event'), 'category_name' => 'Headline', 'posts_per_page' => 2, 'category__not_in' => array(45,72,73)) );
    ?>
    
    		<?php while ($the_query->have_posts()) : $the_query->the_post(); ?>

    To clarify: when I say that the above code doesn’t work, what happens is that none of my events show up when I use WP_Query.

    However, if I use the following snippet (agelonwl’s plus category filter) with query_posts, my events show up, but I can’t hide any of them by category.

    add_filter( 'pre_get_posts', 'my_get_posts' );
    function my_get_posts( $query ) {
    	if ( is_home() && false == $query->query_vars['suppress_filters'] ) {
    		$query->set( 'post_type', array( 'post', 'event' ) );
    		$query->set('category__not_in', array(45,72,73));
    	}
    	return $query;
    }

    Currently, my entire calendar posts on the blog, while I’d rather that event posts appear only a few at a time, as the date approaches. Even better, I’d like to be able to pick and choose which events show up on the front list, although the calendar should show all events. I thought I could do this by setting up an “Hidden” category and using Quick Edit to mark events as hidden or not.

    using agelonwl’s snippet works but alas not for the functionality we need. it would be wonderful if events could be normal posts with normal post type categories. 🙂

    Plugin Author Marcus

    (@netweblogic)

    that’ll never happen (event = post), your best bet will be to make events look like posts.

    r.e. post categories, this is already possible, you just need to associate the post categories taxonomy with the event CPT.

    r.e. post categories, this is already possible, you just need to associate the post categories taxonomy with the event CPT.

    I’m sorry– I don’t know how to do that. It appears that event categories are stored in the terms table alongside of regular post categories. But in my example above, 72 and 73 are the cat ids of event categories, but somehow they aren’t being filtered out– though 45, a regular post category, is being properly filtered.

    Plugin Author Marcus

    (@netweblogic)

    probably because the EM category taxonomy is called ‘event-categories’, or stored as a constant EM_TAXONOMY_CATEGORY, it’s not the post taxonomy

    Thanks Marcus for the tip! This query worked for me:

    <?php
    $my_query = new WP_Query( array( 'post_type' => 'event',  'event-categories' => 'my-category-slug-name' ) );
    while ($my_query->have_posts()) : $my_query->the_post();
    ?>
    <div>
    <h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
    <div class="excerpt"><?php the_excerpt(); ?></div>
    </div>
    <?php endwhile; ?>

    Hi,

    I use agelonwl snippet to display events on front page.
    How can I select events to be displayed as “featured posts” plz ?

    Thanks in advance

    Plugin Author Marcus

    (@netweblogic)

    you’d have to do this e.g. by assigning a category or a tag. Then, you can filter by either of these. Alternatively, you could add your own custom code to do this.

    I’ll try with tags, thanks !

    Adam

    (@robinsontb21)

    r.e. post categories, this is already possible, you just need to associate the post categories taxonomy with the event CPT.

    Can some one explain in complete novice terms how to do this or provide and example code?

    @

    some useful links
    http://codex.wordpress.org/Taxonomies

    sample code, check @triggame post above

    Sorry guys but I’m confused, how do you show your future events using a custom query?

    edit: I manage to show my events on the front page using a custom query, but they don’t show in the right order.

    Marcus:

    EM does one thing when a post is loaded into the loop, which is it changes the default published date to the start date of the event (does not change it in the actual $post object though).

    Is it possible to do this with a custom query? or do I have to use the following code?

    if (class_exists('EM_Events')) {
    	echo EM_Events::output(array(
    		'limit' => 10,
    		'format' => '<h4>#_EVENTLINK</h4>',
    	));
    }
Viewing 15 replies - 16 through 30 (of 40 total)
  • The topic ‘[Plugin: Events Manager] Show events as regular posts (articles)’ is closed to new replies.