festival_lgbt /wp-content/themes/eclipse/core/actions/global-actions.php

Language PHP Lines 222
MD5 Hash 537af1fa6d3e62f51532aff341a94081
Repository https://github.com/Bochet/festival_lgbt.git View Raw File
  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
<?php
/**
* Global actions used by response.
*
* Author: Tyler Cunningham
* Copyright: Š 2012
* {@link http://cyberchimps.com/ CyberChimps LLC}
*
* Released under the terms of the GNU General Public License.
* You should have received a copy of the GNU General Public License,
* along with this software. In the main directory, see: /licensing/
* If not, see: {@link http://www.gnu.org/licenses/}.
*
* @package response
* @since 1.0
*/

/**
* response global actions
*/

add_action( 'response_loop', 'response_loop_content' );
add_action( 'response_post_byline', 'response_post_byline_content' );
add_action( 'response_mobile_post_byline', 'response_mobile_post_byline_content' );
add_action( 'response_edit_link', 'response_edit_link_content' );
add_action( 'response_post_tags', 'response_post_tags_content' );
add_action( 'response_post_bar', 'response_post_bar_content' );
add_action( 'response_fb_like_plus_one', 'response_fb_like_plus_one_content' );

/**
* Check for post format type, apply filter based on post format name for easy modification.
*
* @since 1.0
*/
function response_loop_content($content) { 

	global $options, $ec_themeslug, $post; //call globals
	
	if (is_single()) {
		 $post_formats = $options->get($ec_themeslug.'_single_post_formats');
		 $featured_images = $options->get($ec_themeslug.'_single_show_featured_images');
		 $excerpts = $options->get($ec_themeslug.'_single_show_excerpts');
	}
	elseif (is_archive()) {
		 $post_formats = $options->get($ec_themeslug.'_archive_post_formats');
		 $featured_images = $options->get($ec_themeslug.'_archive_show_featured_images');
		 $excerpts = $options->get($ec_themeslug.'_archive_show_excerpts');
	}
	else {
		 $post_formats = $options->get($ec_themeslug.'_post_formats');
		 $featured_images = $options->get($ec_themeslug.'_show_featured_images');
		 $excerpts = $options->get($ec_themeslug.'_show_excerpts');
	}
	
	if (get_post_format() == '') {
		$format = "default";
	}
	else {
		$format = get_post_format();
	} ?>
	<?php ob_start(); ?>
			
			<!--Call @response Meta hook-->
			<div class="row">
			<div class="byline three columns"><?php response_post_byline(); ?></div>
				<div class="entry nine columns">
					<h2 class="posts_title"><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></h2>
					
					<?php
				if ( has_post_thumbnail() && $featured_images == '1' ) {
 		 			echo '<div class="featured-image">';
 		 			echo '<a href="' . get_permalink($post->ID) . '" >';
 		 				the_post_thumbnail();
  					echo '</a>';
  					echo '</div>';
				}
			?>	
			<?php response_mobile_post_byline(); ?>
					<?php 
						if ($excerpts == '1' && !is_single() ) {
						the_excerpt();
						}
						else {
							the_content(__('<img class="continue_img" src="' .get_bloginfo('template_directory'). '/images/continue.png"> Continue Reading', 'response'));
						}
					 ?>
					 <div class='clear'>&nbsp;</div>
				<!--Begin @response link pages hook-->
					<?php response_link_pages(); ?>
				<!--End @response link pages hook-->
			
				<!--Begin @response post edit link hook-->
					<?php response_edit_link(); ?>
				<!--End @response post edit link hook-->
				</div><!--end entry-->
			</div><!--end row-->
			<?php	
		
		$content = ob_get_clean();
		$content = apply_filters( 'response_post_formats_'.$format.'_content', $content );
	
		echo $content; 
}

/**
* Sets the post byline information (author, date, category). 
*
* @since 1.0
*/
function response_post_byline_content() {
	global $options, $ec_themeslug; //call globals.  
	if (is_single()) {
		$hidden = $options->get($ec_themeslug.'_single_hide_byline'); 
		 $post_formats = $options->get($ec_themeslug.'_single_post_formats');
	}
	elseif (is_archive()) {
		$hidden = $options->get($ec_themeslug.'_archive_hide_byline'); 
		 $post_formats = $options->get($ec_themeslug.'_archive_post_formats');
	}
	else {
		$hidden = $options->get($ec_themeslug.'_hide_byline'); 
		$post_formats = $options->get($ec_themeslug.'_post_formats');
	}
	if (get_post_format() == '') {
		$format = "default";
	}
	else {
		$format = get_post_format();
	}?>
	
	<?php if ($post_formats != '0') : ?>
		<div class="postformats hide-on-phones"><!--begin format icon-->
			<img src="<?php echo get_template_directory_uri(); ?>/images/formats/<?php echo $format ;?>.png" alt="formats" />
		</div><!--end format-icon-->
	<?php endif; ?>
	<div class="meta hide-on-phones">
	<ul>
		<li class="metadate"><?php if (($hidden[$ec_themeslug.'_hide_date']) != '0'):?><a href="<?php the_permalink() ?>"><?php echo get_the_date(); ?></a><?php endif;?></li>
		<li class="metacomments"><?php if (($hidden[$ec_themeslug.'_hide_comments']) != '0'):?><?php comments_popup_link( __('No Comments', 'response' ), __('1 Comment', 'response' ), __('% Comments' , 'response' )); //need a filer here ?><?php endif;?></li>
		<li class="metaauthor"><?php if (($hidden[$ec_themeslug.'_hide_author']) != '0'):?><?php the_author_posts_link(); ?><?php endif;?></li>
		<li class="metacat"><?php if (($hidden[$ec_themeslug.'_hide_categories']) != '0'):?> <?php the_category(', ') ?><?php endif;?></li>
		<li class="metatags"><?php response_post_tags(); ?></li>
	</ul>
	</div> <?php
}

/**
* Sets the responsive post byline information (author, date, category). 
*
* @since 1.0
*/
function response_mobile_post_byline_content() {
	global $options, $ec_themeslug; //call globals.  
	if (is_single()) {
		$hidden = $options->get($ec_themeslug.'_single_hide_byline'); 
		 $post_formats = $options->get($ec_themeslug.'_single_post_formats');
	}
	elseif (is_archive()) {
		$hidden = $options->get($ec_themeslug.'_archive_hide_byline'); 
		 $post_formats = $options->get($ec_themeslug.'_archive_post_formats');
	}
	else {
		$hidden = $options->get($ec_themeslug.'_hide_byline'); 
		$post_formats = $options->get($ec_themeslug.'_post_formats');
	}
	if (get_post_format() == '') {
		$format = "default";
	}
	else {
		$format = get_post_format();
	}?>
	
		<div class="meta-mobile show-on-phones">
	<ul><?php if ($post_formats != '0') : ?>
		<li class="postformats show-on-phones"><img src="<?php echo get_template_directory_uri(); ?>/images/formats/<?php echo $format ;?>.png" alt="formats" />
</li><?php endif; ?>
		<li class="metadate"><?php if (($hidden[$ec_themeslug.'_hide_date']) != '0'):?><?php printf( __( '', 'response' )); ?><a href="<?php the_permalink() ?>"><?php echo get_the_date(); ?></a><?php endif;?></li>
		<li class="metacomments"><?php if (($hidden[$ec_themeslug.'_hide_comments']) != '0'):?><?php comments_popup_link( __('No Comments', 'response' ), __('1 Comment', 'response' ), __('% Comments' , 'response' )); //need a filer here ?><?php endif;?></li>
		<li class="metaauthor"><?php if (($hidden[$ec_themeslug.'_hide_author']) != '0'):?><?php printf( __( '', 'response' )); ?><?php the_author_posts_link(); ?><?php endif;?></li>
		<li class="metacat"><?php if (($hidden[$ec_themeslug.'_hide_categories']) != '0'):?><?php printf( __( '', 'response' )); ?> <?php the_category(', ') ?><?php endif;?></li>
		<li class="metatags"><?php response_post_tags(); ?></li>
	</ul>
	</div> <?php
}


/**
* Sets up the WP edit link
*
* @since 1.0
*/
function response_edit_link_content() {
	edit_post_link('Edit', '<p>', '</p>');
}

/**
* Sets up the tag area
*
* @since 1.0
*/
function response_post_tags_content() {
	global $options, $ec_themeslug; 
	if (is_single()) {
		$hidden = $options->get($ec_themeslug.'_single_hide_byline'); 
	}
	elseif (is_archive()) {
		$hidden = $options->get($ec_themeslug.'_archive_hide_byline'); 
	}
	else {
		$hidden = $options->get($ec_themeslug.'_hide_byline'); 
	}?>

	<?php if (has_tag() AND ($hidden[$ec_themeslug.'_hide_tags']) != '0'):?>
			<?php the_tags('', ', ', ''); ?>
	<?php endif;
}

/**
* End
*/

?>
Back to Top