WordPress.org

Ready to get started?Download WordPress

Forums

Events Manager
[resolved] Create custom feed (9 posts)

  1. Beee
    Member
    Posted 1 year ago #

    Now that I'm able to show upcoming events on another site I'ld like to be able to create a custom feed so I can tailor a feed to a specific site.

    I thought about using categories or tags, but I don't want this to show up on the website, because it's only a marker for RSS. Since the category/tag listing (#_EVENTCATEGORIES/#_EVENTTAGS) both are shown in li's without unique classes/id's (which afaik can't be changed through the admin) I can't hide them through CSS.

    Any other solutions/tips ? Would custom fields maybe be an option ?

    http://wordpress.org/extend/plugins/events-manager/

  2. caimin_nwl
    NetWebLogic Support
    Posted 1 year ago #

    There is a way to remove the li tags from the #_EVENTCATEGORIES and #_EVENTTAGS placeholdes.

    You'd need to move the files categories.php and / eventtags.php from the /events-manager/templates/placeholders folder and put them in /wp-content/themes/yourtheme/plugins/events-manager/placeholders/ and edit them as needed.

  3. Beee
    Member
    Posted 1 year ago #

    Thanks I didn't know that yet. Will look into it and see if it fits me.

  4. Beee
    Member
    Posted 1 year ago #

    I managed to add classes to the categories and tags, so thanks for that.

    I'ld prefer to use tags to categories, but I'ld like to exclude one tag from being listed. Since they're listed as a flat list, seperated by comments, I need to exclude it in the query.

    This is the original file eventtags.php

    $tags = get_the_terms($EM_Event->post_id, EM_TAXONOMY_TAG);
    if ( is_array($tags) && count($tags) > 0 ) {
    	$tags_list = array();
    	foreach($tags as $tag) {
    		$link = get_term_link($tag->slug, EM_TAXONOMY_TAG);
    		if ( is_wp_error($link) ) $link = '';
    		$tags_list[] = '<a href="'. $link .'" class="'. $tag->name .'">'. $tag->name .'</a>';
    	}
    	echo implode(', ', $tags_list);
    }

    I think I should build an exclude to exclude tag_id 19.

    I tried

    $tags_list = array('exclude' => array('19'));

    and

    $tag_args = array('exclude' => array(19));
    $tags = get_the_terms($EM_Event->post_id, $tag_args);

    but I haven't been able to achieve it. Any suggestions ?

  5. Beee
    Member
    Posted 1 year ago #

    I managed to make a temporary solution.
    Since I never display more than 1 tag, I removed the comma and space in the implode and since I now tagged the links I can hide them by CSS.

    like this on line 12

    $tags_list[] = '<a href="'. $link .'" class="'. $tag->name .'">'. $tag->name .'</a>';

    and on line 14

    echo implode('', $tags_list);

    It's not the best solution so I still prefer to just exclude this term id from the listing.

  6. agelonwl
    Member
    Posted 1 year ago #

    thanks for updating us and sharing the solution. however, maybe this can help you also - http://pastebin.com/rBLpD74a (just add the exclude attribute)

  7. Beee
    Member
    Posted 1 year ago #

    I think that was what I was looking for initially.
    But don't understand the add_filter.

  8. Marcus
    NetWebLogic Support
    Plugin Author

    Posted 1 year ago #

  9. Beee
    Member
    Posted 1 year ago #

    ah ok, so 2 methods... I thought they belonged together to achieve 1 thing.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic