Agregar código Wordpress
Publicado por Jesús Villegas (11 intervenciones) el 08/12/2017 19:51:24
Quiero agregar código php a visual composer, como hago para insertar este códgio que les muestro en el maquetador de visual composer, saludos
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
<style>
.grid {
position: absolute;
right: 0;
width: 80vw;
}
.section {
min-height: 200vh;
}
</style>
<?php
$page = 4;
$pages = 10;
$paged = 1;
if (isset($_POST['page'])){
$paged = $_POST['page'];
}
echo '<script>
function siguiente() {
document.getElementById("page").value = parseInt(document.getElementById("page").value) + 1
document.form1.submit();
}
function anterior() {
document.getElementById("page").value = parseInt(document.getElementById("page").value) - 1
document.form1.submit();
}
</script>';
//$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
query_posts("category_name=Productos&paged=".$paged."");
/* Start the Loop */
while ( have_posts() ) : the_post();
$post = get_post();
$post_id = $post->ID;
if(get_the_category( $post_id )[0]->name == "Productos"){
?>
<div class="post" style="line-height:100%;" >
<p class="descripcionP" style="line-height:1;"><?php the_title(); ?></p><br>
<img src="<?php the_post_thumbnail('full'); ?>
<br>
<button class="detallesP" type="button" style="height:25px;border-radius:2px" onclick="location.href='<?php echo get_permalink($post_id); ?>'">Ver detalles</button>
</div>
<?php
}
endwhile; // End of the loop.
//<div style="cursor:pointer" onclick="enviar()"><a href="">SIGUIENTE »</a></div>
// if ($page == 1) echo ""; else echo "<li><a href='?p=$page'>« PREVIO</li></a>";
// if ($page == $pages) echo "";
// else echo "<li><a href='?page=3'>SIGUIENTE »</li></a>";
echo '<form id="form1" method="post" style="position:absolute;top: 74%;margin-left: 15%">
<input type="hidden" name="page" id="page" value="'.$paged.'" />
<input type="submit" class="btn btn-success" value="Anterior" onclick="anterior()">
<input type="submit" class="btn btn-success" value="Siguiente" onclick="siguiente()">
</form>';
?>
Valora esta pregunta


0