-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
167 lines (132 loc) · 5.07 KB
/
index.php
File metadata and controls
167 lines (132 loc) · 5.07 KB
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
<?php
/**
*/
get_header(); ?>
</div>
</div>
<div id="headerFull">
<div class="max-width">
<header id="branding" role="banner">
<?php
$query_images_args = array(
'post_type' => 'attachment', 'post_mime_type' =>'image', 'post_status' => 'inherit', 'posts_per_page' => -1
);
$query_images = new WP_Query( $query_images_args );
$images = array();
$header_thumb = array();
$image_names = array();
$imagelink1 = array();
$imagelink2 = array();
foreach ( $query_images->posts as $image) {
$alt = get_post_meta($image->ID, '_wp_attachment_image_alt', true);
if( strpos($alt, "/?slide") !== FALSE ){
$images[]= wp_get_attachment_url( $image->ID );
$imagelink1[] = $alt;
}elseif(strpos($alt, "/?thumb") !== FALSE ){
$header_thumb[]= wp_get_attachment_url( $image->ID );
$imagelink2[] = $alt;
}
}
?>
<script type='text/javascript'>
var slideShow = <?php echo json_encode($images); ?>;
var slideShowURL = <?php echo json_encode($imagelink1); ?>;
var slideShowIndex = 0;
window.slideShowIndex++;
if(window.slideShowIndex >= window.slideShow.length){
window.slideShowIndex = 0;
}
$('#slideShowImg').attr('src', window.slideShow[window.slideShowIndex]);
$('#slideshow_1 .slideshowLink').attr('href', window.slideShowURL[window.slideShowIndex]);
</script>
<div id="headerContent">
<div id="headerLeft">
<div id="left">
<div class="padding30">
<h1>Movies This Week on Spuul</h1>
<!-- slideshow -->
<div id="slideshow_1" class="ngg-slideshow">
<div id="imageContainer">
<a class="slideshowLink" href="<?php echo $imagelink1[0]; ?>" target="_blank"><?php echo "<img id='slideShowImg' src='$images[0]' style='height:135px;width:578px;position:relative;top:0px;left:0px;display:block;z-index:0'>" ?>
</div>
</div>
<!--<div id="movieThumbWeek" style="display:none;">
<a href="<?php echo $imagelink2[0]; ?>" target="_blank"><img src="<?php echo $header_thumb[0]; ?>" class="header_thumb"/></a>
<a href="<?php echo $imagelink2[1]; ?>" target="_blank"><img src="<?php echo $header_thumb[1]; ?>" class="header_thumb gap"/></a>
</div> -->
</div>
</div>
<div style="clear:both;"></div>
</div>
<div id="headerRight" style="display:none;">
<div class="padding_header">
<div class="padding_header_left">
<?php
$idNum = 162;//838 blog staging //162 localhost
$my_postid = $idNum;//This is page id or post id
$content_post = get_post($my_postid);
$content = $content_post->post_content;
$content = apply_filters('the_content', $content);
$content = str_replace(']]>', ']]>', $content);
?>
<h1><?php echo get_the_title($idNum); ?></h2>
<?php
echo $content;
?>
</div>
</div>
</div>
<div style="clear:both;"></div>
</div>
</header><!-- #branding -->
</div><!-- max-width -->
</div><!-- headerFull-->
<div id="page" class="hfeed">
<div id="main">
<div id="primary">
<div id="content" role="main">
<div class="content_padding" style="display:none;">
<div id="recent_movies">
<h1 class="titlePost">Recent Movies</h1>
<?php
global $post;
//cat staging 25, local 5
$args = array( 'numberposts' => 5, 'offset'=> 0, 'category' => 25, 'post_status' => draft );
$myposts = get_posts( $args );
foreach( $myposts as $post ) : setup_postdata($post); ?>
<div style="display:none;"><?php the_content(); // recent movie container ?>
</div>
<script type="text/javascript">
$('.movieCol').each(function(){
$('#movielist')
.append('<li class="movieCol"><img src="'+$(this).children('img').attr('src')+'"/><div class="desc"><ul><li><h1>'+$(this).find('h1').text()+'</h1></li><li><a href="'+$(this).find('a').attr('href')+'">'+$(this).find('a').text()+'</a></li><li><p>'+$(this).find('p').text()+'</p></li></ul></div></li>');
});
</script>
<ul id="movielist">
</ul>
<?php endforeach; ?>
</div>
<div style="clear:both;"></div>
</div>
<?php if ( have_posts() ) : ?>
<?php twentyeleven_content_nav( 'nav-above' ); ?>
<?php /* Start the Loop */ ?>
<?php while ( have_posts() ) : the_post(); ?>
<?php get_template_part( 'content', get_post_format() ); ?>
<?php endwhile; ?>
<?php twentyeleven_content_nav( 'nav-below' ); ?>
<?php else : ?>
<article id="post-0" class="content_padding">
<header class="entry-header">
<h1 class="entry-title"><?php _e( 'Nothing Found', 'twentyeleven' ); ?></h1>
</header><!-- .entry-header -->
<div class="entry-content">
<p><?php _e( 'Apologies, but no results were found for the requested archive. Perhaps searching will help find a related post.', 'twentyeleven' ); ?></p>
<?php get_search_form(); ?>
</div><!-- .entry-content -->
</article><!-- #post-0 -->
<?php endif; ?>
</div><!-- #content -->
</div><!-- #primary -->
<?php get_sidebar(); ?>
<?php get_footer(); ?>