This is how you display other events on different pages.

83 views
Skip to first unread message

oshr...@gmail.com

unread,
Dec 26, 2013, 4:36:39 PM12/26/13
to myev...@googlegroups.com
Hi all,
In the site I'm working on, the need is to display only relevant events for each page.

I've tried to hard-code it and to inject var into the eventon array, but it didn't worked, so I used shortcode.

What I did is compare the page title to the event_type category (textonomy) name. If it is true, you will get only the relevant events. if not - the plugin will not be loaded.

This is how it's done:

<?php
/************************************ EVENTS ***********************************/
/* Display custom events for each page by Oshri Ben Hamo - www.artipixel.co.il */

// retrieve category ID
function get_category_id($category_name) {
$term = get_term_by('name', $category_name, 'event_type');
return $term->term_id;
}

// retrieve category Name
function get_category_name($category_name) {
$term = get_term_by('name', $category_name, 'event_type');
return $term->name;
}
//calls
$ttl = get_the_title();
$category_id = get_category_id($ttl);
$cat_name = get_category_name($ttl);
if($cat_name==$ttl){
echo do_shortcode("[add_eventon event_type='$category_id']");
}
/********************************** END EVENTS ********************************/
?>


Hope this helps anybody,

I was looking for a solution to make it hardcoded and not using shortcode.
I would love to hear about one for the future. thax!

Ron Davis

unread,
Dec 27, 2013, 2:40:22 AM12/27/13
to myev...@googlegroups.com, oshr...@gmail.com
Hi, is this still working for you?  I need to have an 'isolated' schedule for each post, not a post that shows the schedule/events from other posts. Is this what you were going after too?
Message has been deleted

Ron Davis

unread,
Dec 27, 2013, 5:21:24 AM12/27/13
to myev...@googlegroups.com, oshr...@gmail.com
Quick question: 
1. Did you create separate plugin just for these functions? or did you add to existing file?
2. If there is an update to EventON plugin, then this will may be overwritten... unless it is created as separate plugin.


On Thursday, December 26, 2013 4:36:39 PM UTC-5, oshr...@gmail.com wrote:

myEventON Admin

unread,
Dec 28, 2013, 12:18:03 AM12/28/13
to myev...@googlegroups.com
Hey i am trying to understand your need "he need is to display only  relevant events for each page."

So are you trying to show certain events on a page? you could use event type categories and assign a specific event_type tag to the special events and call all those events only using shortcode. Is that what you are trying to do?

oshr...@gmail.com

unread,
Dec 31, 2013, 6:38:49 AM12/31/13
to myev...@googlegroups.com
Hi, I'm doing it hard-coded in the theme,
that way it's automatically fits the page name to the eventon event_type category. The page get the relevant values without the need to write a shortcode on every page manually.

myEventON Admin

unread,
Jan 2, 2014, 8:08:39 PM1/2/14
to myev...@googlegroups.com
Oh ok and were you able to achieve this or did you need any help from me?

Artipixel Studio

unread,
Jan 2, 2014, 8:18:00 PM1/2/14
to myEventON Admin, myev...@googlegroups.com
I did it, and just shared with everyone the solution-
Although, I did it using shortcode and couldn't do it with the regular php code.
Maybe you can add a new feature to the plugin as this one, it will be very helpful.
thnx!

בברכה,

אושרי בן חמו
052-4439780
ארטיפיקסל שרותי גרפיקה
www.ArtiPixel.co.il


2014/1/3 myEventON Admin <ash...@gmail.com>

--
You received this message because you are subscribed to a topic in the Google Groups "myEventON" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/myeventon/Rp1r0pql9Kg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to myeventon+...@googlegroups.com.
To post to this group, send email to myev...@googlegroups.com.
Visit this group at http://groups.google.com/group/myeventon.
For more options, visit https://groups.google.com/groups/opt_out.

Ron Davis

unread,
Jan 2, 2014, 8:56:27 PM1/2/14
to myev...@googlegroups.com, myEventON Admin, in...@artipixel.co.il
It will be very helpful to add a dynamic short-code to the plugin. 
For example: there could be 2 benefits from "Action User" add-on:

1. Show user-created event compared to other user-created events.
2. Show user-created event individually & dynamically with a post that has the same title.

As a side note: I'm still trying to get the dynamic short-code to work on my side. Right now, it is not generating any output...

Ron Davis

unread,
Jan 2, 2014, 10:30:40 PM1/2/14
to myev...@googlegroups.com, myEventON Admin, Oshri ben hemo
some variables have no output:

echo ("'.$cat_name.'");  (output)
echo ("'.$category_id.'"); (no output)
echo ("'.$ttl.'"); (no output)
Reply all
Reply to author
Forward
0 new messages