<?xml version="1.0" encoding="UTF-8"?>
<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/"
	>

<channel>
	<title>Modern Tribe Inc. &#187; customization</title>
	<atom:link href="http://tri.be/tag/customization-2/feed/" rel="self" type="application/rss+xml" />
	<link>http://tri.be</link>
	<description>WordPress event plugins for people who kick ass</description>
	<lastBuildDate>Thu, 23 May 2013 17:31:34 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
<image><url>http://tri.be/wp-content/themes/moderntribe/images/branding/logo.png</url></image>		<item>
		<title>Coloring Your Category Events</title>
		<link>http://tri.be/coloring-your-category-events/</link>
		<comments>http://tri.be/coloring-your-category-events/#comments</comments>
		<pubDate>Wed, 23 Nov 2011 21:38:04 +0000</pubDate>
		<dc:creator>Jonah West</dc:creator>
				<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[calendar]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[customization]]></category>
		<category><![CDATA[styling]]></category>

		<guid isPermaLink="false">http://tri.be/?p=11436</guid>
		<description><![CDATA[Hi there folks! Today I&#8217;m going to show you how to color coordinate your calendar, i.e. give some color to your events so events in each category have a unique color. Note: If your events are only in one category this will not be as helpful for you but maybe this is the motivation you&#8217;ve been looking for to categorize your events! Screenshot of What We&#8217;ll Be Doing Adding The CSS You can add the &#8230; <a href="http://tri.be/coloring-your-category-events/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Hi there folks! Today I&#8217;m going to show you how to color coordinate your calendar, i.e. give some color to your events so events in each category have a unique color.</p>
<p><em>Note: If your events are only in one category this will not be as helpful for you but maybe this is the motivation you&#8217;ve been looking for to categorize your events!</em></p>
<h3>Screenshot of What We&#8217;ll Be Doing</h3>
<p></p>
<h3>Adding The CSS</h3>
<p>You can add the CSS needed to achieve this effect in your theme&#8217;s main <strong>style.css</strong> file or you can also use The Events Calendar <strong>events.css</strong> file located in /wp-content/plugins/the-events-calendar/resources/events.css. If using <strong>events.css</strong>, make sure you are overriding the plugins stock events.css file by duplicating it and placing it in an &#8216;events&#8217; folder within your theme. This will ensure you won&#8217;t lose your styles the next time you update.</p>
<p>For demonstration purposes say you have three categories named: Presentations, Conferences and Celebrations. An event under one of these categories will then be given a class with the name of it&#8217;s category prefixed with &#8216;cat_&#8217;, for example: &#8216;cat_presentations&#8217; for the Presentations category.</p>
<p>This class will be used for every event displayed on the calendar that is in that category so you can add a background color to that class in CSS and have that background used for all the events in that category. In CSS all you need to do to target this class and apply styling to it is use:</p>
<pre class="brush: css; title: ; notranslate">
.cat_presentations {
background: #fed64c;
}
</pre>
<p>This would apply a yellow background to events in the Presentations category.</p>
<p>Then for example in the next category Conferences, you want to give it a blue background, you would just add below the above CSS:</p>
<pre class="brush: css; title: ; notranslate">
.cat_conferences {
background: #68a7d3;
}
</pre>
<p>Now since these classes are also used in the events list view and on single events you&#8217;ll want to more specifically target your CSS selectors so the backgrounds are only used in the calendar view. To do that, just add:</p>
<pre class="brush: css; title: ; notranslate">
.tribe-events-calendar .cat_presentations {
background: #fed64c;
}
</pre>
<p>&#8216;.tribe-events-calendar&#8217; is another class that is added to the entire calendar and the category classes are children of that class so by prepending with the parent class you are indicating to only style the category events that are within it and not on the list view or single event pages.</p>
<p>There is a lot more you could do with styling your calendar, like changing the background of the strip in the tooltip popup to match your calendar event background. For example:</p>
<pre class="brush: css; title: ; notranslate">
.cat_presentations &gt; .tribe-events-tooltip .tribe-events-event-title {
background: #fed64c;
}
</pre>
<p>And you can combine this with the other background CSS like so:</p>
<pre class="brush: css; title: ; notranslate">
.tribe-events-calendar .cat_presentations,
.cat_presentations &gt; .tribe-events-tooltip .tribe-events-event-title {
background: #fed64c;
}
</pre>
<p>And since event links might not be looking so hot on that new background, you can style those in same way, specifically for each category like so:</p>
<pre class="brush: css; title: ; notranslate">
.tribe-events-calendar .cat_presentations a {
color: #333;
}
</pre>
<p>I&#8217;m also only using one property at a time but you can add as many styling properties as you want:</p>
<pre class="brush: css; title: ; notranslate">
.tribe-events-calendar .cat_presentations a {
color: #333;
font-weight: bold;
text-decoration: underline;
text-transform: uppercase;
}
</pre>
<p>The skies the limit! Here is a full snippet from the examples I used here and from what you see in the screenshot above:</p>
<pre class="brush: css; title: ; notranslate">
.tribe-events-calendar a {
font-weight: bold;
}
.tribe-events-calendar .cat_celebrations a,
.tribe-events-calendar .cat_conferences a {
color: #fff;
}
.tribe-events-calendar .cat_presentations a {
color: #333;
}
.tribe-events-calendar .cat_celebrations,
.cat_celebrations &gt; .tribe-events-tooltip .tribe-events-event-title {
background: #6da351;
}
.tribe-events-calendar .cat_presentations,
.cat_presentations &gt; .tribe-events-tooltip .tribe-events-event-title {
background: #fed64c;
}
.tribe-events-calendar .cat_conferences,
.cat_conferences &gt; .tribe-events-tooltip .tribe-events-event-title {
background: #68a7d3;
}
</pre>
<p>This should give you a pretty good base to work off of and actually even a pretty good CSS primer if you didn&#8217;t know much about CSS before. Hopefully it will inspire you to learn more about the powers of CSS and how much you can do to customize the look of your events in The Events Calendar.</p>
<p>If you have questions, hit me up in the comments!</p>
]]></content:encoded>
			<wfw:commentRss>http://tri.be/coloring-your-category-events/feed/</wfw:commentRss>
		<slash:comments>68</slash:comments>
		</item>
		<item>
		<title>How to Completely Customize Widgets</title>
		<link>http://tri.be/how-to-completely-customize-widgets/</link>
		<comments>http://tri.be/how-to-completely-customize-widgets/#comments</comments>
		<pubDate>Thu, 17 Nov 2011 20:29:17 +0000</pubDate>
		<dc:creator>Jonah West</dc:creator>
				<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[customization]]></category>
		<category><![CDATA[widgets]]></category>

		<guid isPermaLink="false">http://tri.be/?p=11230</guid>
		<description><![CDATA[About a week ago I posted this tutorial on how to show featured thumbnails for the Next Events widget. Then someone asked: &#8220;Is there a way to make this occur for only the first event?&#8221;. Yes there is, but it requires some further customization of the widgets (which will be helpful to point out here in general) since it will apply to all widgets and give you more customization control over them. Basically what we &#8230; <a href="http://tri.be/how-to-completely-customize-widgets/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>About a week ago I posted <a href="http://tri.be/how-to-show-featured-thumbnails-in-the-next-events-widget/">this tutorial</a> on how to show featured thumbnails for the Next Events widget. Then someone asked: &#8220;Is there a way to make this occur for only the first event?&#8221;. Yes there is, but it requires some further customization of the widgets (which will be helpful to point out here in general) since it will apply to all widgets and give you more customization control over them.</p>
<p>Basically what we need to do is unregister an already registered widget, copy the code for that widget and make our modifications and then register our copy in place of the other widget.</p>
<h4>Full functions.php Source: <a href="http://pastebin.com/cuYhhXWz">http://pastebin.com/cuYhhXWz</a><span class="Apple-style-span" style="font-weight: normal;"> </span></h4>
<h4>Full widget-featured-display.php Source: <a href="http://pastebin.com/UqvxU0uk">http://pastebin.com/UqvxU0uk</a></h4>
<h3>Unregister The Widget</h3>
<p>This is slightly different depending on how the widget is registered. In some cases you will want to use this code:</p>
<pre class="brush: php; title: ; notranslate">
function remove_widgets() {
unregister_widget('TheClassNameOfMyWidget');
}
add_action( 'widgets_init', 'remove_widgets', 11 );
</pre>
<p>In this particular case to unregister the Next Events widget you&#8217;ll want to use:</p>
<pre class="brush: php; title: ; notranslate">
remove_action( 'widgets_init', 'events_calendar_load_featured_widget',100);
</pre>
<p>Since that action is added to add the widget, you want to remove the action. If you&#8217;re wanting to unregister another widget you&#8217;ll just want to look through the widget code to see how it was added and adjust accordingly. Note that when using the unregister function you&#8217;ll need to get the classname of the registered widget in the widget code.</p>
<p>Place this code in your functions.php file or as a separate include to keep things organized. If you save functions.php at this point and go back to your Widgets page in WordPress you should notice the Next Events widget is gone. Don&#8217;t worry, we&#8217;re going to add it back  </p>
<h3>Copy the Original Widget Code</h3>
<p>For the Next Events widget this can be found in <em>plugins/events=calendar-pro/lib/widget-featured.class.php </em>- open the file and copy the entire contents.</p>
<h3>Paste Widget Code</h3>
<p><strong></strong>Paste the code into your functions.php file or your separate include above or below the above code.</p>
<p><strong style="font-size: 15px;">Make it Your Own Widget</strong></p>
<p><strong></strong>At the top of the widget code you&#8217;ll see the class declaration for the widget that identifies the widget throughout WordPress. Change the following lines:</p>
<pre class="brush: php; title: ; notranslate">
if( !class_exists( 'TribeEventsFeatureWidget') ) {
class TribeEventsFeatureWidget extends WP_Widget {
function TribeEventsFeatureWidget() {
</pre>
<p>to:</p>
<pre class="brush: php; title: ; notranslate">
if( !class_exists( 'CustomTribeEventsFeatureWidget') ) {
class CustomTribeEventsFeatureWidget extends WP_Widget {
function CustomTribeEventsFeatureWidget() {
</pre>
<p>You&#8217;ll also see this line towards the top of the widget code:</p>
<pre class="brush: php; title: ; notranslate">
$this-&amp;gt;WP_Widget('next_event', __('Next Event Widget'), $widget_ops);
</pre>
<p>..,which declares the widgets name as it appears in WordPress. Change &#8216;Next Event Widget&#8217; to &#8216;Custom Next Event Widget&#8217; or how ever else you want it to appear.</p>
<h3><strong>Remove Unnecessary Code</strong></h3>
<p><strong></strong>Scroll to the bottom of the widget code and remove the following:</p>
<pre class="brush: php; title: ; notranslate">
/* Add function to the widgets_ hook. */
// hook is commented out until development is finished, allows WP's default calendar widget to work
add_action( 'widgets_init', 'events_calendar_load_featured_widget',100);
//add_action( 'widgets_init', 'get_calendar_custom' );
//function get_calendar_custom(){echo &quot;hi&quot;;}
/* Function that registers widget. */
function events_calendar_load_featured_widget() {
register_widget( 'TribeEventsFeatureWidget' );
// load text domain after class registration
load_plugin_textdomain( 'tribe-events-calendar-pro', false, basename(dirname(dirname(__FILE__))) . '/lang/');
}
</pre>
<p>This will prevent conflicts with the existing widget code.</p>
<h3>Register Your Widget</h3>
<p>You&#8217;ve unregistered the default widget and copied the code from it. Now you need to register your copy. Simply paste the following code into functions.php or your include:</p>
<pre class="brush: php; title: ; notranslate">
function activate_of_widgets() {
register_widget( 'CustomTribeEventsFeatureWidget' );
}
add_action( 'widgets_init', 'activate_of_widgets' );
</pre>
<h3>Make Your Modifications</h3>
<p>As I stated in the beginning a forum user asked if they can only display the featured thumbnail for the first Next Event post. We&#8217;ve got to make a few modifications to our widget code now to achieve this functionality. First, the Next Event widget only pulls in the one next event post so we&#8217;ll want to change this to pull in more than one post. Look for this function in your widget code:</p>
<pre class="brush: php; title: ; notranslate">
if( function_exists( 'tribe_get_events' ) ) {
$posts = tribe_get_events( 'eventDisplay=upcoming&amp;amp;numResults=1&amp;amp;eventCat=' . $category );
$template = TribeEventsTemplates::getTemplateHierarchy('widget-featured-display');
}
</pre>
<p>And change &#8216;numResults&#8217; to -1 instead of 1 which will bring in all events (or change it to however many you want to bring in (2, 3, 4, 5, etc.). So the code should now look like:</p>
<pre class="brush: php; title: ; notranslate">
if( function_exists( 'tribe_get_events' ) ) {
$posts = tribe_get_events( 'eventDisplay=upcoming&amp;amp;numResults=-1&amp;amp;eventCat=' . $category );
$template = TribeEventsTemplates::getTemplateHierarchy('widget-featured-display');
}
</pre>
<p>The next step is we need to add a counter to determine what event we&#8217;re looking at so we can conditionally only show the Featured Thumbnail for the first event in the list. Find the following in your widget code:</p>
<pre class="brush: php; title: ; notranslate">
if ( $posts ) {
/* Display list of events. */
foreach( $posts as $post ) :
setup_postdata($post);
include $template;
endforeach;
}
</pre>
<p>And change to:</p>
<pre class="brush: php; title: ; notranslate">
if ( $posts ) {
/* Display list of events. */
$i = 0;
foreach( $posts as $post ) :
setup_postdata($post);
include $template;
endforeach;
}
</pre>
<p>&#8230;adding a variable with which to count by.</p>
<h3>Update the View Template</h3>
<p>Next we need to go into our actual widget view template which I covered in this (<a title="How do I show featured thumbnails in the “Next Event” widget?" href="http://tri.be/faq/how-do-i-show-featured-thumbnails-in-the-next-event-widget/">http://tri.be/how-to-show-featured-thumbnails-in-the-next-events-widget/</a>) tutorial. If you don&#8217;t know what I&#8217;m talking about then go read that tutorial first to setup that file.</p>
<p>In widget-featured-display.php we need to now look at the counter variable we declared in our widget code and see if we&#8217;re on the first record and display the thumbnail code if we are and if not remove the thumbnail code. To do that we just need to use an if statement to check if the counter variable is 0 (on the first record), then display the event details with the featured thumbnail or else just display the event details. So it would look something like this:</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php if($i == 0) { ?&gt;

&lt;div class=&quot;event&quot;&gt;
	&lt;?php if(has_post_thumbnail($post-&gt;ID, 'thumbnail')):
   	$image_id = get_post_thumbnail_id($post-&gt;ID);
   	$image_url = wp_get_attachment_image_src($image_id, 'thumbnail', true); ?&gt;
		&lt;a href=&quot;&lt;?php echo get_permalink($post-&gt;ID) ?&gt;&quot; class=&quot;post-thumb&quot;&gt;&lt;img src=&quot;&lt;?php echo $image_url[0]; ?&gt;&quot; alt=&quot;&lt;?php echo $post-&gt;post_title ?&gt;&quot; /&gt;&lt;/a&gt;
	&lt;?php endif; ?&gt;
	&lt;a href=&quot;&lt;?php echo get_permalink($post-&gt;ID) ?&gt;&quot;&gt;&lt;?php echo $post-&gt;post_title ?&gt;&lt;/a&gt;
&lt;/div&gt;
&lt;div class=&quot;when&quot;&gt;
	&lt;?php
		echo tribe_get_start_date( $post-&gt;ID, isset($start) ? $start : null );

		if($event-&gt;AllDay &amp;&amp; $start)
			echo ' &lt;small&gt;('.__('All Day','tribe-events-calendar-pro').')&lt;/small&gt;';
	?&gt;
&lt;/div&gt;
&lt;div class=&quot;loc&quot;&gt;
	&lt;?php
		if ( tribe_get_city() != '' ) {
			echo tribe_get_city() . ', ';
		}
		if (tribe_get_region() != '') {
			echo tribe_get_region() . ', ';
		}
		if (tribe_get_country() != '') {
			echo tribe_get_country();
		}
	?&gt;
&lt;/div&gt;
&lt;div class=&quot;event_body&quot;&gt;
	&lt;?php the_content('... More');?&gt;
&lt;/div&gt;
&lt;?php $alt_text = ( empty( $alt_text ) ) ? 'alt' : ''; ?&gt;

 &lt;?php } else { ?&gt;

 &lt;div class=&quot;event&quot;&gt;
	&lt;a href=&quot;&lt;?php echo get_permalink($post-&gt;ID) ?&gt;&quot;&gt;&lt;?php echo $post-&gt;post_title ?&gt;&lt;/a&gt;
&lt;/div&gt;
&lt;div class=&quot;when&quot;&gt;
	&lt;?php
		echo tribe_get_start_date( $post-&gt;ID, isset($start) ? $start : null );

		if($event-&gt;AllDay &amp;&amp; $start)
			echo ' &lt;small&gt;('.__('All Day','tribe-events-calendar-pro').')&lt;/small&gt;';
	?&gt;
&lt;/div&gt;
&lt;div class=&quot;loc&quot;&gt;
	&lt;?php
		if ( tribe_get_city() != '' ) {
			echo tribe_get_city() . ', ';
		}
		if (tribe_get_region() != '') {
			echo tribe_get_region() . ', ';
		}
		if (tribe_get_country() != '') {
			echo tribe_get_country();
		}
	?&gt;
&lt;/div&gt;
&lt;div class=&quot;event_body&quot;&gt;
	&lt;?php the_content('... More');?&gt;
&lt;/div&gt;
&lt;?php $alt_text = ( empty( $alt_text ) ) ? 'alt' : ''; ?&gt;

 &lt;?php }
 $i++;
 ?&gt;
</pre>
<h3>Conclusion</h3>
<p>That&#8217;s about it! You should now only see the thumbnail for the first event displayed in the widget.</p>
<p>Unregistering and registering your own copies of widgets can be super helpful in general because if there&#8217;s certain functionality in a plugins widget you want, you don&#8217;t have to modify the core and worry about losing your changes when there are updates to that plugin. You simply make a copy of the widget code, unregister the widget you copied from and register your own copy with your changes!</p>
<p>If you have any questions, hit me up in the comments  </p>
<h4>Full functions.php Source: <a href="http://pastebin.com/cuYhhXWz">http://pastebin.com/cuYhhXWz</a></h4>
<h4>Full widget-featured-display.php Source: <a href="http://pastebin.com/UqvxU0uk">http://pastebin.com/UqvxU0uk</a></h4>
]]></content:encoded>
			<wfw:commentRss>http://tri.be/how-to-completely-customize-widgets/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>