/
page.php
72 lines (62 loc) · 2.01 KB
/
page.php
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
<?php
/**
* Genesis Framework.
*
* WARNING: This file is part of the core Genesis Framework. DO NOT edit this file under any circumstances.
* Please do all modifications in the form of a child theme.
*
* @package Genesis\Templates
* @author StudioPress
* @license GPL-2.0+
* @link http://my.studiopress.com/themes/genesis/
*/
//* This file handles pages, but only exists for the sake of child theme forward compatibility.
add_action('genesis_entry_footer','custom_entry_footer');
function custom_entry_footer(){
$posts = get_field('include_posts');
if( $posts ):
echo '<div id="featured-posts">';
global $post;
$i=0;
foreach( $posts as $post ):
setup_postdata($post);
echo '<a href="'.get_permalink().'">';
echo '<div class="excerpt-section">';
$image = get_field('front_thumbnail');
//echo "<pre>"; var_dump($image); echo '</pre>';
echo '<div class="thumb">';
if( $image ) {
echo wp_get_attachment_image( $image, 'home-thumbnail',false, array('alt'=>get_the_title(),'class'=>'front_thumbnail') );
}
echo '</div>';
echo '<h5 class="title">';
if(get_field('short_title')):the_field('short_title');
else: the_title(); endif;
echo '</h5>';
echo '<div class="excerpt">';
if(get_field('custom_excerpt')){
the_field('custom_excerpt');
}
else{
the_excerpt(); }
echo '</div>';
echo '<a class="read-more" href="'. get_permalink() .'">Read More</a>';
echo '</div></a>';
endforeach;
wp_reset_postdata();
do_action( 'genesis_after_endwhile' );
endif;
}
add_action('genesis_after','scripts');
function scripts(){ ?>
<script type="text/javascript">
jQuery(document).ready(function(){
<?php if( is_user_logged_in() ): ?>
$('.page-id-113 #submit-manuscript').attr('class','');
<?php elseif( !is_user_logged_in() ): ?>
$('.page-id-113 #submit-manuscript').attr('href','/wp-admin/');
<?php endif; ?>
});
</script><?php
}
genesis();