WordPress.org

Forums

Events Manager
[resolved] Events (past and future) don't show in home slider nor in RSS (23 posts)

  1. tycooko
    Member
    Posted 8 months ago #

    I'll put the two issues together because I get the feeling they're part of the same problem: no event (past or future) shows up neither in the home page slider of my site or in the RSS feed (this one: http://wordpress.org/plugins/feed-template-customize), so it looks like both of them don't see the category pertaining to the Events Manager plugin.
    Now with a VERY simple language (the site was built by a friend: I don't know anything about codes and plugins), could you tell me what the problem could be, or how can I give you more information to help you find out?

    https://wordpress.org/plugins/events-manager/

  2. angelo
    NetWebLogic Support
    Posted 8 months ago #

    sorry haven't tried the slider before and can't help with regards to other plugins since EM is not fully integrated with the plugins(slider). however, you can check for wp_query or how the slider plugins get custom post type information.

  3. tycooko
    Member
    Posted 8 months ago #

    Hi Angelo,
    thanks for your time.
    Unfortunately, I have no idea what "wp_query" means. :)

  4. tycooko
    Member
    Posted 8 months ago #

    Apparently, the slider is not a plugin, but natively created in my website's code. Here's the page of the editor for the slider:

    <?php query_posts( 'posts_per_page=10' ); ?>
    <div id="sticky-container">
    <div id="sticky-content" class="row clearfix">

    <div class="large-3 columns clearfix medium-3 show-for-medium-up carousel-wrapper show-for-medium-up" role="sticky-sidebar">

    <div class="carousel">
    <div class="c-wrapper">

    <?php $query = new WP_Query( array(
    'post_type' => array( 'post', 'event' ),
    'orderby' => 'date',
    'order' => 'DESC',
    'posts_per_page' => 10) );
    //'posts_per_page' => -1) );
    ?>

    <?php if ( $query->have_posts() ) : while ( $query->have_posts() ) : $query->the_post(); ?>
    <?php global $post; ?>
    <div class="c-list">
    " data-rel="<?php the_ID(); ?>">
    <div class="row clearfix">
    <div class="large-3 medium-3 columns clearfix">

    <?php the_post_thumbnail(array(70, 70), array('class' => 'rounded-thumb thumb')); ?>

    </div>
    <div class="large-6 medium-6 columns clearfix">
    <div class="cell vertical-align">
    <div class="post-date"><?php echo get_the_date('d/m/Y'); ?></div>
    <h4 class="post-title"><?php the_title(); ?></h4>
    </div>
    </div>
    </div>

    </div>
    <?php endwhile; endif; ?>
    <?php wp_reset_query(); ?>
    </div>
    </div>


    <img src="<?php echo get_template_directory_uri(); ?>/library/images/psm-arrow-up.png" class="ico">


    <img src="<?php echo get_template_directory_uri(); ?>/library/images/psm-arrow-down.png" class="ico">

    </div>
    <div class="large-6 columns clearfix medium-6 show-for-medium-up" role="sticky-sidebar">
    <div class="sticky-post-list">
    <?php if ( $query->have_posts() ) : while ( $query->have_posts() ) : $query->the_post(); ?>

    <div class="sticky-post" data-rel="<?php the_ID(); ?>">
    "><?php the_post_thumbnail('sticky-home'); ?>
    <div class="post-date" style="margin: 20px auto -20px;"><?php echo get_the_date('d/m/Y'); ?></div>
    <h3 class="panel-title">"><?php the_title(); ?></h3>
    <?php the_excerpt(); ?>
    </div>

    <?php endwhile; endif; ?>
    </div>
    </div>

    <div class="large-9 columns clearfix show-for-small-only mobile-main-slider">
    <div class="swiper-container">
    <div class="swiper-wrapper">

    <?php if ( $query->have_posts() ) : while ( $query->have_posts() ) : $query->the_post(); ?>
    <div class="sticky-post swiper-slide" data-rel="<?php the_ID(); ?>">
    ">
    <?php the_post_thumbnail('sticky-home'); ?>
    <h3><?php the_title(); ?></h3>

    </div>
    <?php endwhile; endif; ?>

    </div>
    </div>

    </div>

    </div>
    </div>
    <?php wp_reset_query(); ?>

  5. tycooko
    Member
    Posted 8 months ago #

    I have further information.
    In the line where it reads "'post_type' => array( 'post', 'event' ),", if I delete "'post'," and just leave "'event'", the events created with Events Manager appear in the slider!
    Of course they alone, without any other category's post.

  6. caimin_nwl
    NetWebLogic Support
    Posted 8 months ago #

    If you're still having problems getting the events you want, you may need to experiment with the orderby and order parameters.

    This should help:
    http://codex.wordpress.org/Function_Reference/query_posts

  7. tycooko
    Member
    Posted 8 months ago #

    caimin_nwl: Pardon me, but I believe I might expressed myself poorly. The point is not that I have problems getting the events I want; the point is I don't get any event at all. It seems to be an issue with the category represented by the events, not their order.
    Please, read my messages above.

  8. caimin_nwl
    NetWebLogic Support
    Posted 8 months ago #

    Sorry, I don't follow what you mean when you say there could be a problem with the category because there's no category ID used in the WP_Query code you posted.

  9. tycooko
    Member
    Posted 8 months ago #

    Here, take a look: 'post_type' => array( 'post', 'event' )

    The type of post of the events SHOULD BE "event". This is confirmed by the fact that if I put that word alone, suddenly the events appear in my slider. But if I leave the code as it is, theoretically with the events and the normal WordPress posts together, the events disappear.

  10. caimin_nwl
    NetWebLogic Support
    Posted 8 months ago #

    That won't have anything to do with categories because they're not used in the code.

    My guess is the limit is too low, so you're seeing the more recent Posts while the less recent Events are being pushed off the list.

    Try using a much higher limit to see if that shows events:

    $query = new WP_Query( array(
    'post_type' => array( 'post', 'event' ),
    'orderby' => 'date',
    'order' => 'DESC',
    'posts_per_page' => 50) );
  11. tycooko
    Member
    Posted 8 months ago #

    caimin, you're getting stuck to a term while I'm trying to get to a more concrete point. I paste here what I said in my first message: "Now with a VERY simple language (the site was built by a friend: I don't know anything about codes and plugins)".
    Since I can see the term "category" upset you, because for what I can understand it means something very precise in WordPress, from now on I'll use the term "kind" or "genre" or whatever you like, even "mickeymouse".
    So: the mickeymouse of the posts published by the Events Manager plugin doesn't work together with the normal WordPress posts.
    Your solution clearly doesn't consider my past messages: I DON'T SEE ANY POSTS FROM THE KIND/GENRE/MICKEYMOUSE "EVENTS". The events are completely cut off from the slider; it's not that I only see the recent events!
    Please, for the second time I beg you to read all my messages.

  12. tycooko
    Member
    Posted 8 months ago #

    I'll try to explain myself more. My webiste is a complex portal with lots of different information. It has a models galleries page, a videos page, a blog, etc. etc. ...and so on up to the events page.
    Now: the slider is in the home page and should show all the new activity from all these kind of pages. Now it shows almost everything BUT the events, and this is NOT because the latest event was very far back in time, because it is only a few months old, and it doesn't appear in the slider, while even older posts of the "Models" page, for instance, do appear.

  13. caimin_nwl
    NetWebLogic Support
    Posted 8 months ago #

    Can you post a link to your site?

  14. tycooko
    Member
    Posted 8 months ago #

    Please, write a Skype contact or an email address here. Thanks.

  15. caimin_nwl
    NetWebLogic Support
    Posted 7 months ago #

    Sorry, that's not something we can on these forums. Please post a link, thanks.

  16. tycooko
    Member
    Posted 7 months ago #

    It's a gay fetish-oriented site, that's why the discretion. I say it more for the other users.

    I pasted the complete code of the slider here, described the current situation in detail...why do you need to actually see it? You will see a slider with lots of different kinds of posts (Models: Adriano, Blog: "A new story", etc.) and the total absence of events.
    I am telling you how it looks like; how can it help you more, to see it?
    And then again: why aren't you considering the fact that the plugin might have a flaw in its code? Have you tried to reproduce my situation?

  17. angelo
    NetWebLogic Support
    Posted 7 months ago #

    at the moment we EM does not have slider feature and since it involves other plugin or theme we can't help much specially when coding is involve however we are trying our best to help you out.

  18. tycooko
    Member
    Posted 7 months ago #

    Fine. The website is this one: http://www.psmtickling.com .
    The slider in at the center of the home page.
    Now you have all the possible data. I have no more information to give you.
    Could you at least tell me what's wrong or what am I doing wrong?

    P.S.: You will see events GALLERIES in the slider: those, as you will immediately realize, are not part of your plugin; they're photo galleries created through simple WordPress posts.

  19. caimin_nwl
    NetWebLogic Support
    Posted 7 months ago #

    Based on the code snippet you provided previously I can't see any reason why this wouldn't work.

    Given that, my best guess - aside from the things already mentioned - is there's a bug somewhere in the slider.

    I think this is something you'll need to investigate with the support team for the slider plugin, specifically, how you should go about including content from a custom post type.

  20. tycooko
    Member
    Posted 7 months ago #

    There's no plugin for the slider. I've already explained that. It's a slider apparently created in the moment, through codes.

  21. angelo
    NetWebLogic Support
    Posted 7 months ago #

    using wp_query in your above post, maybe this thread can give you more idea - http://wordpress.org/support/topic/custom-query-ignores-scopefuture?replies=10 (you can see the last snippet we shared)

  22. tycooko
    Member
    Posted 7 months ago #

    Where should I insert that code?

  23. tycooko
    Member
    Posted 7 months ago #

    Fine, so apparently I was able to do half the job myself by writing "any" instead of " 'post' " or " 'event' ". Now the slider is complete, with all the types of posts my website has, including the events.
    I still don't know how to make it work in the RSS feed.
    Here's the code of the feed:

    <?php
    /**
    * RSS2 Feed Template for displaying RSS2 Posts feed.
    *
    * @package WordPress
    */

    header('Content-Type: ' . feed_content_type('rss-http') . '; charset=' . get_option('blog_charset'), true);
    $more = 1;

    echo '<?xml version="1.0" encoding="'.get_option('blog_charset').'"?'.'>'; ?>

    <rss version="2.0"
    xmlns:content="http://purl.org/rss/1.0/modules/content/"
    xmlns:wfw="http://wellformedweb.org/CommentAPI/"
    xmlns:dc="http://purl.org/dc/elements/1.1/"
    xmlns:atom="http://www.w3.org/2005/Atom"
    xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
    xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
    <?php
    /**
    * Fires at the end of the RSS root to add namespaces.
    *
    * @since 2.0.0
    */
    do_action( 'rss2_ns' );
    ?>
    >

    <channel>
    <title><?php bloginfo_rss('name'); wp_title_rss(); ?></title>
    <atom:link href="<?php self_link(); ?>" rel="self" type="application/rss+xml" />
    <link><?php bloginfo_rss('url') ?></link>
    <description><?php bloginfo_rss("description") ?></description>
    <lastBuildDate><?php echo mysql2date('D, d M Y H:i:s +0000', get_lastpostmodified('GMT'), false); ?></lastBuildDate>
    <language><?php bloginfo_rss( 'language' ); ?></language>
    <?php
    $duration = 'hourly';
    /**
    * Filter how often to update the RSS feed.
    *
    * @since 2.1.0
    *
    * @param string $duration The update period.
    * Default 'hourly'. Accepts 'hourly', 'daily', 'weekly', 'monthly', 'yearly'.
    */
    ?>
    <sy:updatePeriod><?php echo apply_filters( 'rss_update_period', $duration ); ?></sy:updatePeriod>
    <?php
    $frequency = '1';
    /**
    * Filter the RSS update frequency.
    *
    * @since 2.1.0
    *
    * @param string $frequency An integer passed as a string representing the frequency
    * of RSS updates within the update period. Default '1'.
    */
    ?>
    <sy:updateFrequency><?php echo apply_filters( 'rss_update_frequency', $frequency ); ?></sy:updateFrequency>
    <?php
    /**
    * Fires at the end of the RSS2 Feed Header.
    *
    * @since 2.0.0
    */
    do_action( 'rss2_head');

    while( have_posts()) : the_post();
    ?>
    <item>
    <title><?php
    $category = get_the_category();
    echo $category[0]->cat_name; ?>: <?php the_title_rss() ?></title>
    <link><?php the_permalink_rss() ?></link>
    <comments><?php comments_link_feed(); ?></comments>
    <pubDate><?php echo mysql2date('D, d M Y H:i:s +0000', get_post_time('Y-m-d H:i:s', true), false); ?></pubDate>
    <dc:creator><![CDATA[<?php the_author() ?>]]></dc:creator>
    <?php the_category_rss('rss2') ?>

    <guid isPermaLink="false"><?php the_guid(); ?></guid>
    <?php if (get_option('rss_use_excerpt')) : ?>
    <description><![CDATA[<?php the_excerpt_rss(); ?>]]></description>
    <?php else : ?>
    <description><![CDATA[<?php the_excerpt_rss(); ?>]]></description>
    <?php $content = get_the_content_feed('rss2'); ?>
    <?php if ( strlen( $content ) > 0 ) : ?>
    <content:encoded><![CDATA[<?php echo $content; ?>]]></content:encoded>
    <?php else : ?>
    <content:encoded><![CDATA[<?php the_excerpt_rss(); ?>]]></content:encoded>
    <?php endif; ?>
    <?php endif; ?>
    <wfw:commentRss><?php echo esc_url( get_post_comments_feed_link(null, 'rss2') ); ?></wfw:commentRss>
    <slash:comments><?php echo get_comments_number(); ?></slash:comments>
    <?php rss_enclosure(); ?>
    <?php
    /**
    * Fires at the end of each RSS2 feed item.
    *
    * @since 2.0.0
    */
    do_action( 'rss2_item' );
    ?>
    </item>
    <?php endwhile; ?>
    </channel>
    </rss>

Reply

You must log in to post.

About this Plugin

  • Events Manager
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic