コード例 #1
0
ファイル: content-event.php プロジェクト: Ardnived/Karma
<?php

global $post;
$startdate = Karma_Events::get_startdate();
$enddate = Karma_Events::get_enddate();
$class = strtolower(date("M", $startdate));
$class .= has_post_thumbnail() ? " img" : "";
$class .= Karma_Events::$hero_slug == $post->post_name ? " hero" : "";
$subscribed = Karma_Subscriber::is_subscribed($post->ID);
$subscriber_count = Karma_Subscriber::get_subscriber_count($post->ID);
?>
<article id="<?php 
echo $post->post_name;
?>
" class="event event-<?php 
the_ID();
?>
 <?php 
echo $class;
?>
" data-permalink="<?php 
the_permalink();
?>
">
	<header>
		<?php 
the_post_thumbnail();
?>
		<div class="date">
			<div class="startdate">
				<div class="month"><?php 
コード例 #2
0
?>
; padding: 10px;">
		<th style="padding: 0 0.9em;">
			<h3 style="color: white; text-transform: uppercase; margin: 0;"><?php 
the_title();
?>
</h3>
		</th>
	</tr>
	<tr style="background: #EFEFEF;">
		<td style="text-align: right; padding: 2px 1em; text-transform: uppercase; font-size: 80%; font-weight: bold;">
			<?php 
echo date("M j", Karma_Events::get_startdate());
?>
 - <?php 
echo date("M j, Y", Karma_Events::get_enddate());
?>
		</td>
	</tr>
	<tr style="background: #EFEFEF;">
		<td style="padding: 1em; padding-top: 0;">
			<?php 
the_excerpt();
?>
			<a href="<?php 
the_permalink();
?>
" style="font-size: 90%;">Read more online</a>
			<b style="font-size: 80%;"> OR </b>
			<a href="<?php 
the_permalink();
コード例 #3
0
ファイル: home.php プロジェクト: Ardnived/Karma
for ($i = 0; $i < count($data); $i++) {
    $data[$i]['startdate'] = strtotime($data[$i]['startdate']);
    $data[$i]['enddate'] = strtotime($data[$i]['enddate']);
    $event = $data[$i];
    Karma_Events_Display::register($data[$i]);
}
while (have_posts()) {
    the_post();
    $links = array();
    $contacts = Karma_Events::get_contacts();
    if (!empty($contacts)) {
        foreach ($contacts as $index => $contact) {
            $links[$contact['name']] = $contact['link'];
        }
    }
    Karma_Events_Display::register(array('startdate' => Karma_Events::get_startdate(), 'enddate' => Karma_Events::get_enddate(), 'title' => get_the_title(), 'content' => get_the_content(), 'links' => $links));
}
/*
Karma_Events::register( array(
	'startdate' => strtotime( "2015/08/10" ),
	'enddate' => strtotime( "2015/08/12" ),
	'title' => "London Yuva Seminar",
	'content' => "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras tincidunt lorem quam, id bibendum eros feugiat id. Curabitur tortor orci, iaculis id massa vel, tempus eleifend elit. Donec euismod elit at est gravida, in congue metus facilisis.",
	'links' => array(
		"Website" => "http://www.realizecanada.ca"
	),
) );

Karma_Events::register( array(
	'startdate' => strtotime( "2015/08/17" ),
	'enddate' => strtotime( "2015/08/24" ),