-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgallery.php
More file actions
69 lines (48 loc) · 2.06 KB
/
Copy pathgallery.php
File metadata and controls
69 lines (48 loc) · 2.06 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
<?php
$type = 'gallery';
if ( get_query_var('paged') ) { $paged = get_query_var('paged'); }
elseif ( get_query_var('page') ) { $paged = get_query_var('page'); }
else { $paged = 1; }
$args = array(
'post_type' => $type,
'post_status' => 'publish',
'paged' => $paged,
'posts_per_page' => -1,
'ignore_sticky_posts'=> 1
);
$temp = $wp_query; // assign ordinal query to temp variable for later use
$wp_query = null;
$wp_query = new WP_Query($args);?>
<li class="sidebar-widget">
<span class="sidebar-widget-header"><h3 class="sidebar-widget-header">Galería</h3></span>
<div class="category-dark">
<div class="cat-dark-bottom">
<ul>
<?php if (have_posts()) : while(have_posts()) : the_post(); ?>
<?php
$images_url = get_post_meta( get_the_ID(), '_cg_meta_images_url', true );
$images_title = get_post_meta( get_the_ID(), '_cg_meta_images_title', true );
$img_url = array();
foreach ( $images_url as $key => $image_url ) :
$img_url[] = $image_url;
endforeach;
?>
<li>
<a href="<?php echo get_permalink(get_the_ID()); ?>">
<img width="85" height="54" src="<?php echo $img_url[1]; ?>" class="attachment-small-thumb wp-post-image" alt="<?php echo get_the_title(); ?>">
</a>
<!--
<span class="list-byline">
<a href="http://www.extralucha.com/author/bryan" title="Entradas de Bryan" rel="author">Bryan</a> | 7 febrero 2014
</span>-->
<p>
<a href="<?php echo get_permalink(get_the_ID()); ?>"><?php echo get_the_title(); ?></a>
</p>
</li>
<?php endwhile;?>
<?php endif; ?>
<?php $wp_query = $temp; ?>
</ul>
</div><!--cat-dark-bottom-->
</div>
</li>