Skip to content

Instantly share code, notes, and snippets.

View cesjam7's full-sized avatar
🍊
Working from home

César Jefferson Aquino Maximiliano cesjam7

🍊
Working from home
View GitHub Profile
@cesjam7
cesjam7 / index.html
Created March 16, 2016 03:09
codigo basico de bootstrap
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Mi pagina con Bootstrap</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" />
</head>
<body>
<div class="container">
<!-- Titulo -->
<div class="panel panel-primary">
<script>
$(document).ready(function() {
var max_fields = 10; //maximum input boxes allowed
var wrapper = $("#datos_extras"); //Fields wrapper
var add_button = $(".agregar_datos"); //Add button ID
<?php $datos = get_post_meta(get_the_id(), "datos_extras", true);
if($datos==null) $datos = 0; ?>
var x = <?php echo $datos ; ?>;
$(add_button).click(function(e){ //on add input button click
<?php
// Function add orden data
function insert_orden($idpost, $idauto, $idcliente, $idarrendatario, $contacto_nombre, $contacto_telefono, $contacto_email, $facturar, $ruc, $direccion, $fecha_ingreso, $hora_ingreso, $fecha_diagnostico) {
global $wpdb;
$table = "wp_ordenes";
$wpdb->insert($table, array('idpost'=>$idpost,
'idauto'=>$idauto,
'idcliente'=>$idcliente,
'idarrendatario'=>$idarrendatario,
'contacto_nombre'=>$contacto_nombre,
@cesjam7
cesjam7 / gist:ace4a6584b0eb4c2fd64
Created September 2, 2014 22:15
taxonomia.php
$args = array(
'post_type'=> 'noticias',
'showposts'=> '4',
'tax_query' => array(
array(
'taxonomy' => 'categoria',
'field' => 'slug',
'terms' => 'educacion',
),
),
<?php
register_post_type( 'noticias', array(
'label' => __( 'noticias', 'anqatv' ),
'description' => __( 'Entradas para las noticias de AnqaTV', 'anqatv' ),
'labels' => array(
'name' => _x( 'Anqa Noticias', 'Post Type General Name', 'anqatv' ),
'singular_name' => _x( 'Noticia', 'Post Type Singular Name', 'anqatv' ),
'menu_name' => __( 'Noticias', 'anqatv' ),
'parent_item_colon' => __( 'De la Noticia:', 'anqatv' ),
'all_items' => __( 'Todas las Noticias', 'anqatv' ),
@cesjam7
cesjam7 / ayuda_harry.php
Created September 2, 2014 16:20
filtrar por post_type y categoria
<?php query_posts( array('post_type' => 'noticias', 'cat' => 104, 'showposts' => 4) );
if (have_posts()) :
while (have_posts()) : the_post(); ?>
<p><?php the_title(); ?></p>
<?php endwhile;
endif; ?>
@cesjam7
cesjam7 / archivos_adjuntos_wp.php
Created April 2, 2014 22:12
Traer archivos adjuntos de una página wordpress
<?php
/* Con esta función podremos traer los archivos adjuntos de una página. Solo ponemos este código en la página deseada y nos mostrará los archivos. */
$args = array(
'post_type' => 'attachment',
'numberposts' => null,
'post_status' => null,
'post_parent' => $post->ID
);