コード例 #1
0
ファイル: images.php プロジェクト: serranoabq/HarvestCTC
function harvest_getImage($post_id = null, $size = 'large')
{
    if (null == $post_id) {
        global $post;
        $post_id = $post->ID;
    }
    // Check for a CTC image
    $img = get_post_meta($post_id, '_ctc_image', true);
    // Fall back to the post thumbnail
    if (empty($img)) {
        $thumbnail = wp_get_attachment_image_src(get_post_thumbnail_id($post_id), $size);
        if ($thumbnail) {
            $img = $thumbnail[0];
        }
    }
    // Fall back to the site feed logo
    if (empty($img)) {
        $img = harvest_option('feed_logo', '');
    }
    // Fall back to the site logo
    if (empty($img)) {
        $img = harvest_option('logo', '');
    }
    return $img;
}
コード例 #2
0
ファイル: ctc-support.php プロジェクト: serranoabq/HarvestCTC
function harvest_get_sermon_data($post_id)
{
    $default_img = harvest_option('feed_logo', '');
    if (empty($default_img)) {
        $default_img = harvest_option('logo', '');
    }
    if (class_exists('CTC_Extender')) {
        return ctcex_get_sermon_data($post_id, $default_img);
    } else {
        return harvest_get_default_data($post_id);
    }
}
コード例 #3
0
ファイル: footer.php プロジェクト: serranoabq/HarvestCTC
<?php 
}
if (harvest_option('twitter')) {
    ?>
					<a href="<?php 
    echo harvest_option('twitter');
    ?>
" class="twitter"><i class="fa fa-twitter-square fa-2x"></i></a>
<?php 
}
if (harvest_option('instagram')) {
    ?>
					<a href="<?php 
    echo harvest_option('instagram');
    ?>
" class="instagram"><i class="fa fa-instagram fa-2x"></i></a>
<?php 
}
if (harvest_option('google')) {
    ?>
					<a href="<?php 
    echo harvest_option('google');
    ?>
" class="google"><i class="fa fa-google-plus-square fa-2x"></i></a>
<?php 
}
if (harvest_option('youtube')) {
    ?>
					<a href="<?php 
    echo harvest_option('youtube');
    ?>
コード例 #4
0
ファイル: feeds.php プロジェクト: serranoabq/HarvestCTC
function harvest_rss_feed_add_icon($text)
{
    ?>
	<image>
		<url><?php 
    echo harvest_option('feed_logo') ? harvest_option('feed_logo') : harvest_option('logo');
    ?>
</url>
		<title><?php 
    wp_title('|', true, 'right');
    ?>
</title>
		<link><?php 
    bloginfo_rss('url');
    ?>
</link>
		<description><?php 
    echo harvest_podcast_description();
    ?>
</description>
	</image>
<?php 
}
コード例 #5
0
<?php

/* People archive */
get_header();
$title = array_shift(explode('/', harvest_option('ctc-people', __('People', 'harvest'))));
harvest_title_bar($title);
?>
		
		<div class="content_wrap">

			<div class="grid-container content">

<?php 
query_posts($query_string . '&orderby=menu_order&order=ASC&posts_per_page=-1');
if (have_posts()) {
    while (have_posts()) {
        the_post();
        get_template_part('templates/person', 'grid');
    }
}
?>

			</div> <!-- .content.grid-container -->

		</div> <!-- .content_wrap -->
		<!-- END CONTENT -->

<?php 
get_footer();
コード例 #6
0
if ($data['series']) {
    $tax_query[] = array('taxonomy' => 'ctc_sermon_series', 'field' => 'slug', 'terms' => $data['series_slug']);
    if ($data['topic']) {
        $tax_query[] = array('taxonomy' => 'ctc_sermon_topic', 'field' => 'slug', 'terms' => $data['topic_slug']);
        $tax_query['relation'] = 'AND';
    }
    $args = array('post_type' => 'ctc_sermon', 'tax_query' => $tax_query, 'order' => 'DESC');
    $query = new WP_Query($args);
    if ($query->have_posts()) {
        $i = 1;
        while ($query->have_posts()) {
            $query->the_post();
            $mpost_id = get_the_ID();
            $topic = explode('/', harvest_option('ctc-sermon-topic', __('topic', 'harvest')));
            $topic = array_pop($topic);
            $series = explode('/', harvest_option('ctc-sermon-series', __('series', 'harvest')));
            $series = array_pop($series);
            if ($mpost_id == $post_id) {
                continue;
            }
            if ($i == 1) {
                ?>
			<div class="grid-100 ctc-sermon-grid-title ctc-sermon-others">
				<h2><?php 
                echo __('Other messages from this ', 'harvest') . strtolower($series) . ($data['topic'] ? _x(' and ', 'Space before and after', 'harvest') . strtolower($topic) : '');
                ?>
</h2>
			</div>
			
<?php 
            }
コード例 #7
0
<?php

/* Sermon archive */
get_header();
global $paged;
if (empty($paged)) {
    $paged = 1;
}
$title = explode('/', harvest_option('ctc-sermons', __('Sermons', 'harvest')));
$title = array_shift($title);
harvest_title_bar($title);
?>
		
		<div class="content_wrap">

			<div class="grid-container content">

<?php 
harvest_get_tax_dropdown('ctc_sermon_topic');
?>
			

				<div class="grid-100 ctc-content-sidebar">
					<?php 
dynamic_sidebar('sermon-sidebar');
?>
				</div>

<?php 
$i = 1;
do_action('__before_loop');
コード例 #8
0
<?php

/* Sermon topic/location archive */
global $paged;
if (empty($paged)) {
    $paged = 1;
}
get_header();
$term = get_queried_object();
$title = explode('/', harvest_option('ctc-sermon-topic', __('Topic', 'harvest')));
$title = array_pop($title);
harvest_title_bar(sprintf('%s: %s', $title, $term->name));
?>
		
		<div class="content_wrap">

			<div class="grid-container content">

<?php 
harvest_get_tax_dropdown('ctc_sermon_topic');
?>

<?php 
$i = 1;
if (have_posts()) {
    while (have_posts()) {
        the_post();
        if ($paged == 1 && $i == 1) {
            // The first one is displayed with full details
            ?>
			<div class="grid-100" style="padding-bottom: 20px; text-decoration: underline"><h1><?php 
コード例 #9
0
ファイル: functions.php プロジェクト: serranoabq/HarvestCTC
function harvest_wp_title($title, $sep)
{
    global $paged, $page;
    global $wp_filter;
    // Add the site name.
    $name = get_bloginfo('name');
    if (is_feed()) {
        return $name;
    }
    // Add the site description for the home/front page.
    $tagline = '';
    if ((is_page() || is_single()) && !is_front_page()) {
        $tagline = $title;
    }
    // Taxonomies
    if (is_tax('ctc_sermon_series')) {
        $tagline = sprintf('%s: %s', harvest_option('ctc-sermon-series', _x('Series', 'Page title', 'harvest')), single_tag_title('', false));
    }
    if (is_tax('ctc_sermon_speaker')) {
        $tagline = sprintf(_x('Speaker: %s', 'Page title', 'harvest'), single_tag_title('', false));
    }
    if (is_tax('ctc_event_category')) {
        $tagline = sprintf(_x('%s Events', 'Page title', 'harvest'), single_tag_title('', false));
    }
    if (is_tax('ctc_sermon_topic')) {
        $tagline = sprintf('%s: %s', harvest_option('ctc-sermon-topic', _x('Topic', 'Page title', 'harvest')), single_tag_title('', false));
    }
    // Archives
    if (is_search()) {
        $tagline = __('Search Results', 'harvest');
    }
    if (is_author()) {
        $tagline = __('Author Archive', 'harvest');
    }
    if (is_category()) {
        $tagline = sprintf(__('Archive: %s', 'harvest'), single_cat_title('', false));
    }
    if (is_month()) {
        $tagline = sprintf(__('Archive | %s', 'harvest'), get_the_time('F'));
    }
    if (is_post_type_archive('ctc_location')) {
        $tagline = harvest_option('ctc-locations', __('Locations', 'harvest'));
    }
    if (is_post_type_archive('ctc_sermon')) {
        $tagline = harvest_option('ctc-sermons', __('Sermons', 'harvest'));
    }
    if (is_post_type_archive('ctc_event')) {
        $tagline = harvest_option('ctc-events', __('Events', 'harvest'));
    }
    $title = $name;
    if ($tagline) {
        $title = rtrim("{$name} {$sep} {$tagline}", ' | ');
    }
    return $title;
}
コード例 #10
0
<?php

/* Location archive */
get_header();
$title = explode('/', harvest_option('ctc-locations', __('Locations', 'harvest')));
$title = array_pop($title);
harvest_title_bar($title);
?>
		
		<div class="content_wrap">

			<div class="grid-container content">
				
<?php 
query_posts($query_string . '&orderby=menu_order&order=ASC');
if (have_posts()) {
    while (have_posts()) {
        the_post();
        get_template_part('templates/location', 'grid');
    }
}
?>

			</div> <!-- .content.grid-container -->

		</div> <!-- .content_wrap -->
		<!-- END CONTENT -->

<?php 
get_footer();
コード例 #11
0
ファイル: display.php プロジェクト: serranoabq/HarvestCTC
function harvest_get_tax_dropdown($tax)
{
    if (!in_array($tax, array('ctc_sermon_topic', 'ctc_event_category'))) {
        return;
    }
    $meta_query = array('key' => '_ctc_event_end_date_end_time', 'value' => date_i18n('Y-m-d H:i:s'), 'compare' => '>=', 'type' => 'DATETIME');
    $tags = get_terms($tax, array('hide_empty' => 1, 'meta_query' => $meta_query));
    foreach ($tags as $option) {
        $a_tags[] = sprintf('<option value="%s">%s</option>', get_term_link(intval($option->term_id), $tax), $option->name);
    }
    if ($a_tags) {
        $title = explode('/', harvest_option(str_replace('_', '-', $tax), __('Topic', 'harvest')));
        $title = array_pop($title);
        if ('ctc_event_category' == $tax) {
            $title = 'Category';
        }
        array_unshift($a_tags, sprintf('<option value="">' . _x('Choose a %s', 'Dropdown category instructions', 'harvest') . '</option>', $title));
        $s_tags = implode('', $a_tags);
        ?>
	
					<!-- Category dropdown -->
					<div class="grid-100 <?php 
        echo $tax . '-select';
        ?>
 ctc-category-dropdown" style="text-align: right; padding-bottom: 20px"><select onChange="window.location = jQuery(this).find('option:selected').val();">
					<?php 
        echo $s_tags;
        ?>
					</select></div>
	<?php 
    }
}
コード例 #12
0
ファイル: header.php プロジェクト: serranoabq/HarvestCTC
bloginfo('name');
?>
">
<?php 
if (harvest_option('logo')) {
    ?>
						<img src="<?php 
    echo harvest_option('logo');
    ?>
" alt="logo" />
<?php 
}
?>
 
<?php 
if (harvest_option('logo_name') == '1' || !harvest_option('logo')) {
    ?>
						<span class="logo_name"><?php 
    bloginfo('name');
    ?>
</span>
<?php 
}
?>
					</a>
				
				</div> <!-- #logo.grid-33 -->
				
				<div class="grid-66" id="menu">
					
					<nav id="header_nav_mobile" class="hide-on-desktop">
コード例 #13
0
<?php

/* Event archive */
get_header();
$title = explode('/', harvest_option('ctc-events', __('Events', 'harvest')));
$title = array_shift($title);
harvest_title_bar($title);
?>
		
		<div class="content_wrap">
			<div class="grid-container content">
			
<?php 
harvest_get_tax_dropdown('ctc_event_category');
?>

				<div class="grid-100 ctc-content-sidebar">
					<?php 
dynamic_sidebar('event-sidebar');
?>
				</div>
<?php 
do_action('__before_loop');
if (have_posts()) {
    while (have_posts()) {
        the_post();
        get_template_part('templates/event', 'grid');
    }
}
do_action('__after_loop');
?>
コード例 #14
0
ファイル: front-page.php プロジェクト: serranoabq/HarvestCTC
if (harvest_option('layout') == '66') {
    ?>
					<div class="grid-66 mobile-grid-50 tiny-grid-100 home-widget home-widget-left">
<?php 
} else {
    ?>
					<div class="grid-33 home-widget home-widget-left"> 
<?php 
}
?>
						<?php 
dynamic_sidebar('home-left');
?>
					</div><!-- .home-widget-left -->
<?php 
if (harvest_option('layout') == '33') {
    ?>
					<div class="grid-33 mobile-grid-50 tiny-grid-100 home-widget home-widget-middle">
						<?php 
    dynamic_sidebar('home-middle');
    ?>
					</div><!-- .home-widget-middle -->
<?php 
}
?>
					<div class="grid-33 mobile-grid-50 tiny-grid-100 home-widget home-widget-right">
						<?php 
dynamic_sidebar('home-right');
?>
					</div><!-- .home-widget-right -->