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
<?php add_action('admin_head', 'c7_admin_head');
function c7_admin_head() { ?>
<style>
.select-autores {
width: 100%;
}
#asignar-autores-modal {
position: fixed;
width: 300px;
min-height: 300px;
@cesjam7
cesjam7 / index.php
Created April 25, 2020 00:40
Prueba IZIPAY
<?php if (!$_POST) { ?>
<form method="post">
<p>Comercio:<br>
<input type="text" name="I1" value="4001834" />
</p>
<p>NroOrden:<br>
<input type="text" name="I2" value="<?php echo time() ?>" />
</p>
<p>Monto:<br>
<input type="text" name="I3" value="100.00" />
function create_post_type() {
register_post_type(
'Enlaces', array(
'labels' => array('name' => 'Enlaces', 'singular_name' => 'Enlace'),
'public' => true,
'exclude_from_search' => true,
'show_in_admin_bar' => false,
'show_in_nav_menus' => false,
'publicly_queryable' => false,
'query_var' => false,
@cesjam7
cesjam7 / index.html
Created January 11, 2019 15:48
Notification push
<!DOCTYPE html>
<html>
<head>
<title>Hello!</title>
<script>
function notify(){
if (Notification.permission !== "granted") {
@cesjam7
cesjam7 / index.php
Created October 2, 2018 16:45
Obtener los videos de un canal de youtube en WordPress
<?php
$url = "https://www.googleapis.com/youtube/v3/search?part=snippet&channelId={IDCHANNEL}&maxResults=10&order=date&type=video&key={APIKEY}";
$response = wp_remote_get( $url );
$response_object = json_decode($response['body']);
echo "<pre>";
print_r($response_object);
echo "</pre>";
?>
@cesjam7
cesjam7 / index.php
Created October 2, 2018 16:44
Obtener los últimos videos de un canal de youtube
<?php
$url = "https://www.googleapis.com/youtube/v3/search?part=snippet&channelId={IDCHANNEL}&maxResults=10&order=date&type=video&key={APIKEY}";
$response = file_get_contents($url);
$response_object = json_decode($response);
echo "<pre>";
print_r($response_object);
echo "</pre>";
?>
@cesjam7
cesjam7 / index.html
Created August 22, 2018 00:55
Tablas en PDF
<script src="https://unpkg.com/jspdf@latest/dist/jspdf.min.js"></script>
<div class="col-sm-12" id="grid-ticket" style="font-size:9px;">
<!-- <div id="gridTicket" ui-grid="gridTicket" ui-grid-pagination class="grid" ui-grid-selection ui-grid-resize-columns ui-grid-move-columns ui-grid-auto-resize></div> -->
<table class="table">
<tr>
<th>Company</th>
<th>Book</th>
<th>AdvDate</th>
<th>Executed</th>
<th>PCTR</th>
@cesjam7
cesjam7 / functions.php
Last active June 5, 2018 23:01
Código para crear páginas por default al insertar un nuevo sitio en WordPress Multisite http://cesar.pe/blog/crear-un-sitio-con-paginas-por-defecto-en-wp-mu/
<?php function cesar_add_site( $blog_id ) {
$default_pages = array(
array('title'=>'Escritorio', 'template'=>'templates/escritorio.php'),
array('title'=>'Mi Perfil', 'template'=>'templates/mi-perfil.php'),
array('title'=>'Reportes', 'template'=>'templates/reportes.php')
);
switch_to_blog( $blog_id );
foreach ( $default_pages as $page ) {
$(function() {
$('a.ancla').click(function(e){
e.preventDefault();
let ancla = $(this).attr('href');
var position = $(ancla).position();
$('html, body').animate({scrollTop: (position.top - 60)}, 1000);
})
})
@cesjam7
cesjam7 / index.php
Created April 5, 2018 18:13
Listar cinco productos destacados
<?php
$query = new WP_Query(array(
"post_type" => "product",
"showposts" => 5,
"tax_query" => array(
array(
'taxonomy' => 'product_visibility',
'field' => 'name',
'terms' => 'featured',
'operator' => 'IN'