-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcustom-proyectos.php
More file actions
120 lines (118 loc) · 3.79 KB
/
Copy pathcustom-proyectos.php
File metadata and controls
120 lines (118 loc) · 3.79 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
<?php
/**
* Template Name: Blog/Noticias
* The main template file.
*
* This is the most generic template file in a WordPress theme
* and one of the two required files for a theme (the other being style.css).
* It is used to display a page when nothing more specific matches a query.
* E.g., it puts together the home page when no home.php file exists.
* Learn more: http://codex.wordpress.org/Template_Hierarchy
*
* @package _s
*/
get_header();
$urlFeaturred = wp_get_attachment_url( get_post_thumbnail_id($post->ID, 'thumbnail') );
?>
<style type="text/css">
.proyec-container-top {
background-image: url(<?php echo $urlFeaturred; ?>);
background-size: 110%;
background-repeat: no-repeat;
background-position: 48.8879% 24.444%;
}
.sep-top-md {
padding-top: 1em;
}
#secondary {
display:none;
}
</style>
<?php
// set up or arguments for our custom query
$paged = ( get_query_var('paged') ) ? get_query_var('paged') : 1;
$query_args = array(
'post_type' => 'post',
'category_name' => 'proyectos',
'posts_per_page' => 3,
'paged' => $paged
);
// create a new instance of WP_Query
$the_query = new WP_Query( $query_args );
?>
<main>
<div class="proyec-container-top">
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<div class="proyec-container-title-top"><h4><?php the_title(); ?></h4></div>
<?php endwhile; else: endif; ?>
</div>
<div class="container content-proyects">
<div class="row">
<div class="col-md-9 contenido">
<?php if ( $the_query->have_posts() ) : while ( $the_query->have_posts() ) : $the_query->the_post(); // run the loop ?>
<div class="row proyect-cat">
<?php the_tags('','',''); ?>
</div>
<div class="row">
<div class="col-md-9">
<a href="<?php the_permalink(); ?>"><h3><?php the_title(); ?></h3></a>
<small><?php //the_date(); ?></small>
</div>
<div class="col-md-3 post-info sep-top-md">
<a href="<?php the_permalink(); ?>"><?php ottavio_social_share(); ?></a>
</div>
</div>
<div class="row exceprt-proyect">
<div class="col-md-4">
<?php echo get_the_post_thumbnail($post_id, 'playervid', array('class' => 'alignleft')); ?>
</div>
<div class="col-md-8">
<?php the_excerpt(); ?>
</div>
</div>
<hr>
<?php endwhile; ?>
</div>
<?php if ( $sidebar_position != 'hide' ) : ?>
<aside id="sidebar" class="col-md-3 sep-top-lg sidebar <?php if ( $sidebar_position == 'left' ) : ?>col-md-pull-9<?php endif; ?>" role="complementary">
<!-- start sidebar-->
<?php get_sidebar('video-sidebar'); ?>
<!-- end sidebar-->
</aside>
<?php endif; ?>
</div>
</div>
<div class="container">
<?php if ($the_query->max_num_pages > 1) { // check if the max number of pages is greater than 1 ?>
<!--
<nav class="prev-next-posts">
<div class="prev-posts-link">
<?php echo get_next_posts_link( 'Más proyectos', $the_query->max_num_pages ); // display older posts link ?>
</div>
<div class="next-posts-link">
<?php echo get_previous_posts_link( 'Menos proyectos' ); // display newer posts link ?>
</div>
</nav>
-->
<div class="row foter-proyect">
<div class="col-md-9">
<div class="col-md-6 nav-left">
<?php echo get_previous_posts_link( 'Menos proyectos' ); // display newer posts link ?>
</div>
<div class="col-md-6 text-right nav-right">
<?php echo get_next_posts_link( 'Más proyectos', $the_query->max_num_pages ); // display older posts link ?>
</div>
</div>
<div class="col-md-3">
</div>
</div>
<?php } ?>
<?php else: ?>
<article>
<h1>Disculpe...</h1>
<p><?php _e('Disculpe, no hay contenidos para mostrar'); ?></p>
</article>
<?php endif; ?>
</div>
</main>
<?php get_footer(); ?>