Skip to content

Instantly share code, notes, and snippets.

@Carlosvva
Last active May 27, 2020 02:33
Show Gist options
  • Save Carlosvva/712e6dfb93ee7b058ac2721c7df878d3 to your computer and use it in GitHub Desktop.
Save Carlosvva/712e6dfb93ee7b058ac2721c7df878d3 to your computer and use it in GitHub Desktop.
Archivos a modificar para agregar las descripciones de los item Familia de Concretos y Mezclas Listas
<?php
/**
* A Simple Category Template
*/
get_header(); ?>
<?php echo do_shortcode('[bannersc]'); ?>
<?php
$params = array('posts_per_page' => 20, 'category_name' => 'acabados-especiales');
$wc_query = new WP_Query($params);
?>
<style>
.fcrt_cont_article {
display: flex;
justify-content: space-between;
flex-wrap: wrap;
margin-top: 20px;
}
</style>
<div class="container">
<div class="fcrt_cont_article">
<div class="descitem">
<div class="content">
<p><?php echo category_description(); ?></p>
</div>
</div>
<?php
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
$args = array(
'cat' => 7,
'post_type' => 'post',
'posts_per_page' =>20,
'orderby'=>'date',
'order' => 'DESC',
'paged' => $paged
);
$r = new WP_Query($args); ?>
<?php
if ($r->have_posts()):
$i = 1;
while ($r->have_posts()):
$r->the_post();
?>
<div class="mzl_pst_cont_all">
<div class="fctr_cont_img_ico_btn">
<div class="mzl_img_blog">
<?php if (has_post_thumbnail() ) : the_post_thumbnail('large'); endif; ?>
<a onclick="myFunction('mzl_modal<?php echo $i; ?>')" class="fcrt_btn_vm">usos<span class="fcrt_btn_mas"></span></a>
</div>
</div>
<div class="mzl_txt_blog">
<h3 class="mzl_pst_tt"><?php echo the_title(); ?></h3>
<p class="mzl_pst_exec"><?php echo the_excerpt(); ?></p>
<a class="btn_general flo_l" href="<?php echo get_post_meta($post->ID, 'descargar pdf', true); ?>" target="_blank">ficha técnica</a>
</div>
<!-- CONTENIDO MODAL -->
<div id="mzl_modal<?php echo $i; ?>" class="mzl_modal_usos">
<div onclick="myFunction()" class="mzlmd">
<div class="mzlcont_modal_usos">
<div class="mzlmd">
<div onclick="cerrar('mzl_modal<?php echo $i; ?>')" class="cerrar"></div>
</div>
<div class="mzl_md_body">
<?php echo the_content(); ?>
</div>
</div>
</div>
</div>
<!-- FIN CONTENIDO MODAL -->
</div>
<?php
$i++;
endwhile; ?>
<?php
endif;
?>
<?php $total_pages = $r->max_num_pages;
if ($total_pages > 1){
$current_page = $paged;
$big = 999999999; // need an unlikely integer
$links= paginate_links(array(
'base' => str_replace( $big, '%#%', get_pagenum_link( $big )),
'format' => '?paged=%#%',
'current' => $current_page,
'total' => $total_pages,
'prev_text' => __('«'),
'prev_next' => false,
'next_text' => __('»'),
'type' => 'array'
));
if( is_array( $links ) ) {
echo '<div class="pagination-wrap "><ul class="pagination container blog-pag">';
if ($paged != 1){
$n = $paged - 1;
echo '<li><a class="prev page-numbers" href="'.get_site_url()."/category/mezclas-listas/acabados-especiales/page/".$n.'"><i class="fa fa-angle-left" aria-hidden="true"></i></a></li>';
} else {
// echo '<li><a class="prev page-numbers" href="#"><i class="fa fa-angle-left" aria-hidden="true"></i></a></li>';
}
$cont = 1;
$class= "bulletactive";
foreach ( $links as $page ) {
if ($cont == $paged){
$class = "bulletactive";
} else {
$class = "";
}
echo "<li class='".$class." element'><a href='".get_site_url()."/category/mezclas-listas/acabados-especiales/page/".$cont."'>".$cont."</a></li>";
$cont ++;
}
if ($paged != $total_pages){
$n = $paged + 1;
echo '<li><a class="next page-numbers" href="'.get_site_url()."/category/mezclas-listas/acabados-especiales/page/".$n.'"><i class="fa fa-angle-right" aria-hidden="true"></i></a></li>';
} else {
// echo '<li><a class="next page-numbers" href="#"><i class="fa fa-angle-right" aria-hidden="true"></i></a></li>';
}
echo '</ul></div>';
}
}
?>
</div>
</div>
<script>
function myFunction(modal) {
$("#"+modal).toggle();
}
function cerrar(modal){
$("#"+modal).toggle();
}
// var modal = document.getElementById('mzl_modal');
// var flex = document.getElementById('mzlmd');
// var abrir = document.getElementById('abrir');
// var cerrar = document.getElementById('cerrar');
// abrir.addEventListener('click', function(){
// modal.style.display = 'block';
// });
// cerrar.addEventListener('click', function(){
// modal.style.display = 'none';
// });
// window.addEventListener('click', function(e){
// if(e.target == flex){
// modal.style.display = 'none';
// }
// });
</script>
<?php get_footer(); ?>
<?php
/**
* A Simple Category Template
*/
get_header(); ?>
<?php echo do_shortcode('[bannersc]'); ?>
<?php
$params = array('posts_per_page' => 20, 'category_name' => 'concretos');
$wc_query = new WP_Query($params);
?>
<style>
.fcrt_cont_article {
display: flex;
justify-content: space-between;
flex-wrap: wrap;
margin-top: 20px;
}
</style>
<div class="container">
<div class="fcrt_cont_article">
<div class="descitem">
<div class="content">
<p><?php echo category_description(); ?></p>
</div>
</div>
<?php
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
$args = array(
'cat' => 5,
'post_type' => 'post',
'posts_per_page' =>20,
'orderby'=>'date',
'order' => 'DESC',
'paged' => $paged
);
$r = new WP_Query($args); ?>
<?php
if ($r->have_posts()):
$i = 1;
while ($r->have_posts()):
$r->the_post();
?>
<div class="mzl_pst_cont_all">
<div class="fctr_cont_img_ico_btn">
<div class="mzl_img_blog">
<?php if (has_post_thumbnail() ) : the_post_thumbnail('large'); endif; ?>
<a onclick="myFunction('mzl_modal<?php echo $i; ?>')" class="fcrt_btn_vm">usos<span class="fcrt_btn_mas"></span></a>
</div>
</div>
<div class="mzl_txt_blog">
<h3 class="mzl_pst_tt"><?php echo the_title(); ?></h3>
<p class="mzl_pst_exec"><?php echo the_excerpt(); ?></p>
<a class="btn_general flo_l" href="<?php echo get_post_meta($post->ID, 'descargar pdf', true); ?>" target="_blank">ficha técnica</a>
</div>
<!-- CONTENIDO MODAL -->
<div id="mzl_modal<?php echo $i; ?>" class="mzl_modal_usos">
<div onclick="myFunction()" class="mzlmd">
<div class="mzlcont_modal_usos">
<div class="mzlmd">
<div onclick="cerrar('mzl_modal<?php echo $i; ?>')" class="cerrar"></div>
</div>
<div class="mzl_md_body">
<?php echo the_content(); ?>
</div>
</div>
</div>
</div>
<!-- FIN CONTENIDO MODAL -->
</div>
<?php
$i++;
endwhile; ?>
<?php
endif;
?>
<?php $total_pages = $r->max_num_pages;
if ($total_pages > 1){
$current_page = $paged;
$big = 999999999; // need an unlikely integer
$links= paginate_links(array(
'base' => str_replace( $big, '%#%', get_pagenum_link( $big )),
'format' => '?paged=%#%',
'current' => $current_page,
'total' => $total_pages,
'prev_text' => __('«'),
'prev_next' => false,
'next_text' => __('»'),
'type' => 'array'
));
if( is_array( $links ) ) {
echo '<div class="pagination-wrap "><ul class="pagination container blog-pag">';
if ($paged != 1){
$n = $paged - 1;
echo '<li><a class="prev page-numbers" href="'.get_site_url()."/blog/page/".$n.'"><i class="fa fa-angle-left" aria-hidden="true"></i></a></li>';
} else {
// echo '<li><a class="prev page-numbers" href="#"><i class="fa fa-angle-left" aria-hidden="true"></i></a></li>';
}
$cont = 1;
$class= "bulletactive";
foreach ( $links as $page ) {
if ($cont == $paged){
$class = "bulletactive";
} else {
$class = "";
}
echo "<li class='".$class." element'><a href='".get_site_url()."/blog/page/".$cont."'>".$cont."</a></li>";
$cont ++;
}
if ($paged != $total_pages){
$n = $paged + 1;
echo '<li><a class="next page-numbers" href="'.get_site_url()."/blog/page/".$n.'"><i class="fa fa-angle-right" aria-hidden="true"></i></a></li>';
} else {
// echo '<li><a class="next page-numbers" href="#"><i class="fa fa-angle-right" aria-hidden="true"></i></a></li>';
}
echo '</ul></div>';
}
}
?>
</div>
</div>
<script>
function myFunction(modal) {
$("#"+modal).toggle();
}
function cerrar(modal){
$("#"+modal).toggle();
}
// var modal = document.getElementById('mzl_modal');
// var flex = document.getElementById('mzlmd');
// var abrir = document.getElementById('abrir');
// var cerrar = document.getElementById('cerrar');
// abrir.addEventListener('click', function(){
// modal.style.display = 'block';
// });
// cerrar.addEventListener('click', function(){
// modal.style.display = 'none';
// });
// window.addEventListener('click', function(e){
// if(e.target == flex){
// modal.style.display = 'none';
// }
// });
</script>
<?php get_footer(); ?>
<?php
/**
* A Simple Category Template
*/
get_header(); ?>
<?php echo do_shortcode('[bannersc]'); ?>
<?php
$params = array('posts_per_page' => 20, 'category_name' => 'estabilizador');
$wc_query = new WP_Query($params);
?>
<style>
.fcrt_cont_article {
display: flex;
justify-content: space-between;
flex-wrap: wrap;
margin-top: 20px;
}
</style>
<div class="container">
<div class="fcrt_cont_article">
<div class="descitem">
<div class="content">
<p><?php echo category_description(); ?></p>
</div>
</div>
<?php
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
$args = array(
'cat' => 8,
'post_type' => 'post',
'posts_per_page' =>20,
'orderby'=>'date',
'order' => 'DESC',
'paged' => $paged
);
$r = new WP_Query($args); ?>
<?php
if ($r->have_posts()):
$i = 1;
while ($r->have_posts()):
$r->the_post();
?>
<div class="mzl_pst_cont_all">
<div class="fctr_cont_img_ico_btn">
<div class="mzl_img_blog">
<?php if (has_post_thumbnail() ) : the_post_thumbnail('large'); endif; ?>
<a onclick="myFunction('mzl_modal<?php echo $i; ?>')" class="fcrt_btn_vm">usos<span class="fcrt_btn_mas"></span></a>
</div>
</div>
<div class="mzl_txt_blog">
<h3 class="mzl_pst_tt"><?php echo the_title(); ?></h3>
<p class="mzl_pst_exec"><?php echo the_excerpt(); ?></p>
<a class="btn_general flo_l" href="<?php echo get_post_meta($post->ID, 'descargar pdf', true); ?>" target="_blank">ficha técnica</a>
</div>
<!-- CONTENIDO MODAL -->
<div id="mzl_modal<?php echo $i; ?>" class="mzl_modal_usos">
<div onclick="myFunction()" class="mzlmd">
<div class="mzlcont_modal_usos">
<div class="mzlmd">
<div onclick="cerrar('mzl_modal<?php echo $i; ?>')" class="cerrar"></div>
</div>
<div class="mzl_md_body">
<?php echo the_content(); ?>
</div>
</div>
</div>
</div>
<!-- FIN CONTENIDO MODAL -->
</div>
<?php
$i++;
endwhile; ?>
<?php
endif;
?>
<?php $total_pages = $r->max_num_pages;
if ($total_pages > 1){
$current_page = $paged;
$big = 999999999; // need an unlikely integer
$links= paginate_links(array(
'base' => str_replace( $big, '%#%', get_pagenum_link( $big )),
'format' => '?paged=%#%',
'current' => $current_page,
'total' => $total_pages,
'prev_text' => __('«'),
'prev_next' => false,
'next_text' => __('»'),
'type' => 'array'
));
if( is_array( $links ) ) {
echo '<div class="pagination-wrap "><ul class="pagination container blog-pag">';
if ($paged != 1){
$n = $paged - 1;
echo '<li><a class="prev page-numbers" href="'.get_site_url()."/blog/page/".$n.'"><i class="fa fa-angle-left" aria-hidden="true"></i></a></li>';
} else {
// echo '<li><a class="prev page-numbers" href="#"><i class="fa fa-angle-left" aria-hidden="true"></i></a></li>';
}
$cont = 1;
$class= "bulletactive";
foreach ( $links as $page ) {
if ($cont == $paged){
$class = "bulletactive";
} else {
$class = "";
}
echo "<li class='".$class." element'><a href='".get_site_url()."/blog/page/".$cont."'>".$cont."</a></li>";
$cont ++;
}
if ($paged != $total_pages){
$n = $paged + 1;
echo '<li><a class="next page-numbers" href="'.get_site_url()."/blog/page/".$n.'"><i class="fa fa-angle-right" aria-hidden="true"></i></a></li>';
} else {
// echo '<li><a class="next page-numbers" href="#"><i class="fa fa-angle-right" aria-hidden="true"></i></a></li>';
}
echo '</ul></div>';
}
}
?>
</div>
<style>
.singlehomeproyectvideo1 {
position: relative;
height: 223px;
width: 100%;
margin-bottom: 20px;
cursor: pointer;
display: flex;
overflow: hidden;
align-items: center;
}
.singlehomeproyectvideo1:hover .fondopro {
opacity: 0;
display: block !important;
visibility: hidden;
}
.singlehomeproyectvideo1 img {
width: 100%;
position: absolute;
height: 100%;
transition: all 0.3s;
height: auto !important;
}
.singlehomeproyectvideo1 h2 {
color: #FFF;
margin-top: 5px;
padding-top: 0;
font-size: 1.625rem;
font-weight: bold;
}
.singlehomeproyectvideo2 {
position: relative;
height: 223px;
width: 100%;
margin-bottom: 20px;
cursor: pointer;
display: flex;
overflow: hidden;
align-items: center;
}
.singlehomeproyectvideo2:hover .fondopro {
opacity: 0;
display: block !important;
visibility: hidden;
}
.singlehomeproyectvideo2 img {
width: 100%;
position: absolute;
height: 100%;
transition: all 0.3s;
height: auto !important;
}
.singlehomeproyectvideo2 h2 {
color: #FFF;
margin-top: 5px;
padding-top: 0;
font-size: 1.625rem;
font-weight: bold;
}
.singlehomeproyectvideo3 {
position: relative;
height: 223px;
width: 100%;
margin-bottom: 20px;
cursor: pointer;
display: flex;
overflow: hidden;
align-items: center;
}
.singlehomeproyectvideo3:hover .fondopro {
opacity: 0;
display: block !important;
visibility: hidden;
}
.singlehomeproyectvideo3 img {
width: 100%;
position: absolute;
height: 100%;
transition: all 0.3s;
height: auto !important;
}
.singlehomeproyectvideo3 h2 {
color: #FFF;
margin-top: 5px;
padding-top: 0;
font-size: 1.625rem;
font-weight: bold;
}
</style>
<div class="cproyectos">
<div class="mt-separator">
<h2 class="sep-line-one">Videos</h2>
</div>
<div class="row">
<div class="col-lg-4 col-md-4 col-sm-6 col-xs-12">
<div class="singlehomeproyectvideo1">
<img src="<?= site_url(); ?>/wp-content/uploads/2019/10/1.jpg">
<div class="fondopro">
<div class="containerpros row">
<div class="col-lg-3">
<div class="botonplay">
<i class="fa fa-play"></i>
</div>
</div>
<div class="col-lg-9">
<h2>Terraforte - Retalhuleu</h2>
</div>
</div>
</div>
</div>
</div>
<div class="col-lg-4 col-md-4 col-sm-6 col-xs-12">
<div class="singlehomeproyectvideo2">
<img src="<?= site_url(); ?>/wp-content/uploads/2019/10/2.jpg">
<div class="fondopro">
<div class="containerpros row">
<div class="col-lg-3">
<div class="botonplay">
<i class="fa fa-play"></i>
</div>
</div>
<div class="col-lg-9">
<h2>Terraforte - Santa Rosa</h2>
</div>
</div>
</div>
</div>
</div>
<div class="col-lg-4 col-md-4 col-sm-6 col-xs-12">
<div class="singlehomeproyectvideo3">
<img src="<?= site_url(); ?>/wp-content/uploads/2019/10/3.jpg">
<div class="fondopro">
<div class="containerpros row">
<div class="col-lg-3">
<div class="botonplay">
<i class="fa fa-play"></i>
</div>
</div>
<div class="col-lg-9">
<h2>TERRAFORTE</h2>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script type="text/javascript">
function cerrarmodal1(){
$("#modalvideo1").hide();
stopVideo("modalvideo1");
}
$( document ).ready(function() {
$( ".singlehomeproyectvideo1" ).click(function() {
$("#modalvideo1").toggle();
});
});
function cerrarmodal2(){
$("#modalvideo2").hide();
stopVideo("modalvideo2");
}
$( document ).ready(function() {
$( ".singlehomeproyectvideo2" ).click(function() {
$("#modalvideo2").toggle();
});
});
function cerrarmodal3(){
$("#modalvideo3").hide();
stopVideo("modalvideo3");
}
$( document ).ready(function() {
$( ".singlehomeproyectvideo3" ).click(function() {
$("#modalvideo3").toggle();
});
});
function stopVideo(modal) {
$('#'+modal).contents().find('video').each(function ()
{
this.currentTime = 0;
this.pause();
});
}
</script>
<div id="modalvideo1" class="mzl_modal_usos">
<div class="mzlmd">
<div class="mzlcont_modal_usos">
<div class="mzlmd">
<div onclick="cerrarmodal1()" class="cerrar"></div>
</div>
<div class="mzl_md_body">
<video controls="" name="media" style ="width : 100%; height: 400px">
<source src="<?= site_url(); ?>/wp-content/uploads/2019/10/Terraforte_Retalhuleu_Xela_Alta.mp4?rel=0&amp;cc_load_policy=1" type="video/mp4">
</video>
</div>
</div>
</div>
</div>
<div id="modalvideo2" class="mzl_modal_usos">
<div class="mzlmd">
<div class="mzlcont_modal_usos">
<div class="mzlmd">
<div onclick="cerrarmodal2()" class="cerrar"></div>
</div>
<div class="mzl_md_body">
<video controls="" name="media" style ="width : 100%; height: 400px">
<source src="<?= site_url(); ?>/wp-content/uploads/2019/10/Terraforte_Santa_Rosa_Alta.mp4" type="video/mp4">
</video>
</div>
</div>
</div>
</div>
<div id="modalvideo3" class="mzl_modal_usos">
<div class="mzlmd">
<div class="mzlcont_modal_usos">
<div class="mzlmd">
<div onclick="cerrarmodal3()" class="cerrar"></div>
</div>
<div class="mzl_md_body">
<video controls="" name="media" style ="width : 100%; height: 400px">
<source src="<?= site_url(); ?>/wp-content/uploads/2019/10/TERRAFORTE_final_marzo_2017.mp4" type="video/mp4">
</video>
</div>
</div>
</div>
</div>
<br>
<br>
<?php
$params = array('posts_per_page' => 3, 'category_name' => 'proyectos');
$r = new WP_Query($params);
$contador = 0;
?>
<div class="cproyectos" style="display: none;">
<div class="mt-separator">
<h2 class="sep-line-one">Proyectos</h2>
</div>
<?php while ($r->have_posts()):
$r->the_post(); ?>
<?php $contador++; ?>
<?php if ($contador == 1): ?>
<div class="row">
<?php endif; ?>
<div class="col-lg-4 col-md-4 col-sm-6 col-xs-12">
<!--<a href="<?= get_permalink(); ?>">-->
<div class="singlehomeproyect">
<img src="<?= get_the_post_thumbnail_url(); ?>">
<div class="fondopro">
<div class="containerpros row">
<div class="col-lg-3">
<div class="botonplay">
<i class="fa fa-play"></i>
</div>
</div>
<div class="col-lg-9">
<h2><?= the_title(); ?></h2>
</div>
</div>
</div>
</div>
<!--</a>-->
</div>
<?php
if ($contador == 3): ?>
</div>
<?php $contador=0; ?>
<?php endif; ?>
<?php endwhile; ?>
<?php if ($contador != 3): ?>
</div>
<?php $contador=0; ?>
<?php endif; ?>
<!-- <div class="rowfull mtop50"> -->
<?//= do_shortcode( '[rev_slider alias="solucionesvialeshome"]' ); ?>
<!-- </div> -->
</div>
</div>
<div class="bg_sv_est mtop50">
<div class="container hm_banner_sv">
<img src="<?= site_url(); ?>/wp-content/uploads/2019/08/Grupo-2650.png" alt="">
<div>
<p>Conoce las obras que hemos trabajado junto a Soluciones Viales</p>
<p><a href="#">ver página</a></p>
</div>
</div>
</div>
<script>
function myFunction(modal) {
$("#"+modal).toggle();
}
function cerrar(modal){
$("#"+modal).toggle();
}
// var modal = document.getElementById('mzl_modal');
// var flex = document.getElementById('mzlmd');
// var abrir = document.getElementById('abrir');
// var cerrar = document.getElementById('cerrar');
// abrir.addEventListener('click', function(){
// modal.style.display = 'block';
// });
// cerrar.addEventListener('click', function(){
// modal.style.display = 'none';
// });
// window.addEventListener('click', function(e){
// if(e.target == flex){
// modal.style.display = 'none';
// }
// });
</script>
<script type="text/javascript">
function cerrarmodal(){
$("#modalvideo").hide();
}
$( document ).ready(function() {
$( ".singlehomeproyect" ).click(function() {
$("#modalvideo").toggle();
});
});
</script>
<div id="modalvideo" class="mzl_modal_usos">
<div class="mzlmd">
<div class="mzlcont_modal_usos">
<div class="mzlmd">
<div onclick="cerrarmodal()" class="cerrar"></div>
</div>
<div class="mzl_md_body">
<iframe id="kaltura_player" title="Reproductor de Kaltura" src="https://cdnapisec.kaltura.com/p/2148081/sp/214808100/embedIframeJs/uiconf_id/35255771/partner_id/2148081?iframeembed=true&amp;playerId=kaltura_player&amp;entry_id=0_oak1bfit&amp;flashvars[mediaProtocol]=rtmp&amp;flashvars[streamerType]=rtmp&amp;flashvars[streamerUrl]=rtmp://www.kaltura.com:1935&amp;flashvars[rtmpFlavors]=1&amp;flashvars[localizationCode]=es&amp;flashvars[leadWithHTML5]=true&amp;flashvars[sideBarContainer.plugin]=true&amp;flashvars[sideBarContainer.position]=left&amp;flashvars[sideBarContainer.clickToClose]=true&amp;flashvars[chapters.plugin]=true&amp;flashvars[chapters.layout]=vertical&amp;flashvars[chapters.thumbnailRotator]=false&amp;flashvars[streamSelector.plugin]=true&amp;flashvars[EmbedPlayer.SpinnerTarget]=videoHolder&amp;flashvars[dualScreen.plugin]=true&amp;flashvars[Kaltura.addCrossoriginToIframe]=true&amp;&amp;wid=0_nydwlqh5" width="100%" height="400px" frameborder="0" allowfullscreen="allowfullscreen"></iframe>
</div>
</div>
</div>
</div>
<?php get_footer(); ?>
<?php
/**
* A Simple Category Template
*/
get_header(); ?>
<?php echo do_shortcode('[bannersc]'); ?>
<?php
$params = array('posts_per_page' => 20, 'category_name' => 'mezclas-de-levantados');
$wc_query = new WP_Query($params);
?>
<style>
.fcrt_cont_article {
display: flex;
justify-content: space-between;
flex-wrap: wrap;
margin-top: 20px;
}
</style>
<div class="container">
<div class="fcrt_cont_article">
<div class="descitem">
<div class="content">
<p><?php echo category_description(); ?></p>
</div>
</div>
<?php
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
$args = array(
'cat' => 6,
'post_type' => 'post',
'posts_per_page' =>20,
'orderby'=>'date',
'order' => 'DESC',
'paged' => $paged
);
$r = new WP_Query($args); ?>
<?php
if ($r->have_posts()):
$i = 1;
while ($r->have_posts()):
$r->the_post();
?>
<div class="mzl_pst_cont_all">
<div class="fctr_cont_img_ico_btn">
<div class="mzl_img_blog">
<?php if (has_post_thumbnail() ) : the_post_thumbnail('large'); endif; ?>
<a onclick="myFunction('mzl_modal<?php echo $i; ?>')" class="fcrt_btn_vm">usos<span class="fcrt_btn_mas"></span></a>
</div>
</div>
<div class="mzl_txt_blog">
<h3 class="mzl_pst_tt"><?php echo the_title(); ?></h3>
<p class="mzl_pst_exec"><?php echo the_excerpt(); ?></p>
<a class="btn_general flo_l" href="<?php echo get_post_meta($post->ID, 'descargar pdf', true); ?>" target="_blank">ficha técnica</a>
</div>
<!-- CONTENIDO MODAL -->
<div id="mzl_modal<?php echo $i; ?>" class="mzl_modal_usos">
<div onclick="myFunction()" class="mzlmd">
<div class="mzlcont_modal_usos">
<div class="mzlmd">
<div onclick="cerrar('mzl_modal<?php echo $i; ?>')" class="cerrar"></div>
</div>
<div class="mzl_md_body">
<?php echo the_content(); ?>
</div>
</div>
</div>
</div>
<!-- FIN CONTENIDO MODAL -->
</div>
<?php
$i++;
endwhile; ?>
<?php
endif;
?>
<?php $total_pages = $r->max_num_pages;
if ($total_pages > 1){
$current_page = $paged;
$big = 999999999; // need an unlikely integer
$links= paginate_links(array(
'base' => str_replace( $big, '%#%', get_pagenum_link( $big )),
'format' => '?paged=%#%',
'current' => $current_page,
'total' => $total_pages,
'prev_text' => __('«'),
'prev_next' => false,
'next_text' => __('»'),
'type' => 'array'
));
if( is_array( $links ) ) {
echo '<div class="pagination-wrap "><ul class="pagination container blog-pag">';
if ($paged != 1){
$n = $paged - 1;
echo '<li><a class="prev page-numbers" href="'.get_site_url()."/blog/page/".$n.'"><i class="fa fa-angle-left" aria-hidden="true"></i></a></li>';
} else {
// echo '<li><a class="prev page-numbers" href="#"><i class="fa fa-angle-left" aria-hidden="true"></i></a></li>';
}
$cont = 1;
$class= "bulletactive";
foreach ( $links as $page ) {
if ($cont == $paged){
$class = "bulletactive";
} else {
$class = "";
}
echo "<li class='".$class." element'><a href='".get_site_url()."/blog/page/".$cont."'>".$cont."</a></li>";
$cont ++;
}
if ($paged != $total_pages){
$n = $paged + 1;
echo '<li><a class="next page-numbers" href="'.get_site_url()."/blog/page/".$n.'"><i class="fa fa-angle-right" aria-hidden="true"></i></a></li>';
} else {
// echo '<li><a class="next page-numbers" href="#"><i class="fa fa-angle-right" aria-hidden="true"></i></a></li>';
}
echo '</ul></div>';
}
}
?>
</div>
</div>
<script>
function myFunction(modal) {
$("#"+modal).toggle();
}
function cerrar(modal){
$("#"+modal).toggle();
}
// var modal = document.getElementById('mzl_modal');
// var flex = document.getElementById('mzlmd');
// var abrir = document.getElementById('abrir');
// var cerrar = document.getElementById('cerrar');
// abrir.addEventListener('click', function(){
// modal.style.display = 'block';
// });
// cerrar.addEventListener('click', function(){
// modal.style.display = 'none';
// });
// window.addEventListener('click', function(e){
// if(e.target == flex){
// modal.style.display = 'none';
// }
// });
</script>
<?php get_footer(); ?>
<?php /* Template Name: Familia de concretos Pag */
get_header(); ?>
<style type="text/css">
.mzlcont_modal_usos{
top: 11%;
}
</style>
<div class="container">
<?php
while ( have_posts() ) : the_post();
the_content();
endwhile; // End of the loop.
?>
</div>
<?php
$params = array('posts_per_page' => 4, 'category_name' => 'familia-de-concretos');
$wc_query = new WP_Query($params);
?>
<div class="wrap">
<div class="fcrt_cont_article">
<?php
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
$args = array(
'cat' => 9,
'post_type' => 'post',
'posts_per_page' =>6,
'orderby'=>'date',
'order' => 'DESC',
'paged' => $paged
);
$r = new WP_Query($args); ?>
<?php
while ($r->have_posts()):
$r->the_post();
?>
<div class="enlacomplet" onclick="enlacefami('enla<?= $post->ID; ?>')">
<div class="fcrt_cont_all">
<div class="fctr_cont_img_ico_btn">
<div class="fcrt_img_blog">
<?php if (has_post_thumbnail() ) : the_post_thumbnail('large'); endif; ?>
<img class="fcrt_ico" src="<?php echo get_post_meta($post->ID, 'icono familia concretos', true); ?>" alt="Familia de concretos">
<a style="visibility: hidden;" id="enla<?= $post->ID; ?>" class="fcrt_btn_vm" href="<?php echo get_permalink(); ?>">ver más<span class="fcrt_btn_mas"></span></a>
</div>
</div>
<div class="txt_blog">
<a href="<?php echo get_permalink(); ?>">
<h2 class="fcrt_tt"><?php echo the_title(); ?></h2>
</a>
<p class="fcrt_exec"><?php //echo the_excerpt(); ?></p>
</div>
<div class="descitem" style="margin-bottom: 30px;">
<div class="content">
<?php echo wp_trim_words( get_the_content(), 19 );; ?>
</div>
</div>
<a href="<?php echo get_permalink(); ?>" class="btn_general">Ver Más</a>
</div>
</div>
<?php endwhile; ?>
<?php $total_pages = $r->max_num_pages;
if ($total_pages > 1){
$current_page = $paged;
$big = 999999999; // need an unlikely integer
$links= paginate_links(array(
'base' => str_replace( $big, '%#%', get_pagenum_link( $big )),
'format' => '?paged=%#%',
'current' => $current_page,
'total' => $total_pages,
'prev_text' => __('«'),
'prev_next' => false,
'next_text' => __('»'),
'type' => 'array'
));
if( is_array( $links ) ) {
echo '<div class="pagination-wrap "><ul class="pagination container blog-pag">';
if ($paged != 1){
$n = $paged - 1;
echo '<li><a class="prev page-numbers" href="'.get_site_url()."/blog/page/".$n.'"><i class="fa fa-angle-left" aria-hidden="true"></i></a></li>';
} else {
// echo '<li><a class="prev page-numbers" href="#"><i class="fa fa-angle-left" aria-hidden="true"></i></a></li>';
}
$cont = 1;
$class= "bulletactive";
foreach ( $links as $page ) {
if ($cont == $paged){
$class = "bulletactive";
} else {
$class = "";
}
echo "<li class='".$class." element'><a href='".get_site_url()."/blog/page/".$cont."'>".$cont."</a></li>";
$cont ++;
}
if ($paged != $total_pages){
$n = $paged + 1;
echo '<li><a class="next page-numbers" href="'.get_site_url()."/blog/page/".$n.'"><i class="fa fa-angle-right" aria-hidden="true"></i></a></li>';
} else {
// echo '<li><a class="next page-numbers" href="#"><i class="fa fa-angle-right" aria-hidden="true"></i></a></li>';
}
echo '</ul></div>';
}
}
?>
</div>
<div class="verlibro">
<p class="center">Conoce más sobre nuestras familias de concretos.</p>
<a class="btn_general" onclick="myFunctionpubli('libroconcretospdf')">Ver más</a>
<div id="libroconcretospdf" class="mzl_modal_usos columnasin testimonials">
<div onclick="myFunctionpubli()" class="mzlmd">
<div class="mzlcont_modal_usos">
<div class="mzlmd">
<div onclick="cerrarpubli('libroconcretospdf')" class="cerrar"></div>
</div>
<?php
// echo do_shortcode('[pdf-embedder url="'.site_url().'/wp-content/themes/twentyseventeen/assets/docs/Libro Concretos Carta rev 23 sep.pdf" title="Libro Concretos"]');
echo do_shortcode('[pdfviewer width="100%" beta="true/false"]'.site_url().'/wp-content/themes/twentyseventeen/assets/docs/Libro-Concretos-Carta-rev-23-sep.pdf[/pdfviewer] ');
?>
</div>
</div>
</div>
</div>
</div>
<script>
function myFunctionpubli(modaltwo) {
$("#"+modaltwo).toggle();
}
function cerrarpubli(modaltwo){
$("#"+modaltwo).toggle();
}
</script>
<style>
@media only screen and (min-width: 600px) {
.descitem ul {
margin-left: 20px;
}
}
</style>
<?php get_footer();
<?php /* Template Name: mezclas listas page */
get_header(); ?>
<div class="container">
<?php
while ( have_posts() ) : the_post();
the_content();
endwhile; // End of the loop.
?>
</div>
<?php
define('MEZCLASLISTAS', 4);
//Get categories List familias de concreto
$categories=get_categories(
array( 'parent' => MEZCLASLISTAS,
'meta_key' => 'orden',
'orderby' => 'meta_value',
'order' => 'ASC' )
);
//Get data category familias de concreto
$fam = get_category( MEZCLASLISTAS );
$string = explode(" ", $fam->name);
?>
<div class="container">
<div class="mzl_cont_all" >
<?php foreach($categories as $cat): ?>
<div class="mzl_cont_all_arct enlacomplet" onclick="enlacefami('enla<?= $cat->term_id; ?>')" >
<div class="mzl_cont_img_btn">
<img class="mzl_img" src="<?= the_field("imginterna","category_".$cat->term_id) ?>"/>
<div class="mzl_cont_ico">
<img class="mzl_ico" src="<?= the_field("imgaux","category_".$cat->term_id) ?>" alt="Mezclas Listas">
</div>
<a style="visibility: hidden;" id="enla<?= $cat->term_id; ?>" class="fcrt_btn_vm" href="<?= get_category_link($cat->term_id); ?>">ver más<span class="fcrt_btn_mas"></span></a>
</div>
<h2 class="mzl_tt"><?= $cat->name; ?><span class="mzl_lines"></span></h2>
<p><?= wp_trim_words( $cat->description, 19 ); ?></p>
<a href="<?= get_category_link($cat->term_id); ?>" class="btn_general">Ver Más</a>
</div>
<?php endforeach; ?>
</div>
</div>
<?php get_footer();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment