Collapse Pro Matic – Adding 2nd Trigger in Excerpt

Collapse-Pro-Matic version 1.3.15 introduces a couple new features dealing with secondary triggers and excerpt filtering. The following demonstrates the new features by using a filter to add a second trigger with it’s own swaptitle to all excerpts.

The following code, when placed in the child-theme’s function.php file, will add an extra ‘…read more’ trigger to the end of all excerpts. The data-swaptitle attribute defines the swaptitle for this extra trigger.

 add_filter( 'colomat_excerpt', 'my_excerpt', 10, 2 );
 function my_excerpt( $id, $excerpt ) {
     $excerpt .= ' <span class="collapseomatic" id="extra1-'.$id.'" data-swaptitle=" ...read less"> ...read more</span>';
     return $excerpt;
 }

Then each shortcode that contains an excerpt will include the second trigger:

[expand title="I am a little tea-pot" excerpt="short and stout"]Here is my handle, here is my spout.[/expand]

And here is an example of the above in action:

I am a little tea-pot
short and stout
Here is my handle, here is my spout.

Next, what happens when there are multiple triggers with swaptitles? Let’s see.

[expand title="main trigger" swaptitle="main trigger swap" id="mankey"]this is the hidden text for this multi-target test[/expand]
<div id="extra1-mankey" class="collapseomatic" data-swaptitle="Trigger 2 Swap Titlte">Trigger 2</div>
<div id="extra2-mankey" class="collapseomatic" data-swaptitle="Trigger 3 Swap Titlte">Trigger 3</div>
main trigger
this is the hidden text for this multi-target test
Trigger 2
Trigger 3
MORE ⬇
hey dude

T(-) Countdown Second Tuesday of The Month

This is a test to see if using t=’second tuesday’ will schedule a T(-) Countdown correctly:

[tminus t="second tuesday"]

weeks
0
1
days
0
4
hours
0
4
minutes
2
5
seconds
0
5

Yup, looks like it works just fine.
It’s no T(-) Countdown Control, but in a pinch, it will work.

Edit.. nope, this will just countdown to the second Tuesday from today. To countdown to the second Tuesday of the MONTH you need to add the month and year.

[tminus t="may 2015 second tuesday"]

weeks
-46
-7
days
0
-3
hours
-2
0
minutes
-3
-5
seconds
-5
-5