Skip to content

Instantly share code, notes, and snippets.

View jmarreros's full-sized avatar
🏠
Working from home

Jhon Marreros Guzman jmarreros

🏠
Working from home
View GitHub Profile
@media (max-width:768px){
.header-image .site-title > a{
background-image:url(/wp-content/uploads/2016/06/logo-movil.png);
}
}
@media (max-width:768px){
.custom-logo-link{
background-image:url(/wordpress/wp-content/uploads/2016/06/logo-movil.png);
margin:auto;
width:157px;
height:59px;
}
.custom-logo-link img{
display:none;
}
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
<?php
/*
Hacemos referencia al archivo wp-blog-header.php para
que nuestro archivo incluya la funcionalidad de Wordpress
*/
define('WP_USE_THEMES', false);
require('../wp-blog-header.php');
?>
@jmarreros
jmarreros / db-error.php
Last active October 14, 2016 13:18
Página personalizada de Error de Base de Datos en WordPress
<?php
// Página de error de Base de Datos personalizada
// Referencia @ digwp.com
header('HTTP/1.1 503 Service Temporarily Unavailable');
header('Status: 503 Service Temporarily Unavailable');
header('Retry-After: 3600');
mail("admin@dominio.com", "Error Base de datos", "Hay un error en la BD, verifica!");
?>
<!DOCTYPE HTML>
<html dir="ltr" lang="es-ES">
@jmarreros
jmarreros / Empaquetar WordPress con install.php
Last active October 26, 2016 11:35
Usar este código en un plugin dependiente install.php de WordPress
<?php
if (array_key_exists("step",$_REQUEST) && $_REQUEST["step"] == 2){
add_action("shutdown", "dcms_install_data");
}
function dcms_install_data() {
global $wpdb, $wp_rewrite;
if (!get_option("blogname", false)) {
return;
}
@jmarreros
jmarreros / tabla.html
Created November 6, 2016 01:20
Ejemplo de tabla HTML
<table>
<thead>
<tr>
<th>Nombre</th>
<th>Ene</th>
<th>Feb</th>
<th>Mar</th>
<th>Abr</th>
<th>May</th>
<th>Jun</th>
@jmarreros
jmarreros / RESTAPI_creacion_entrada.php
Last active November 13, 2016 03:36
Creación de Entrada usando WP REST API
<?php
$host = 'http://tudominio.com/wp-json/wp/v2/posts/';
$data = array('title' => 'Titulo Post Nuevo', 'content' => 'Contenido nueva entrada', 'status' => 'publish');
$data_string = json_encode($data);
$headers = array(
'Content-Type:application/json',
'Content-Length: ' . strlen($data_string),
@jmarreros
jmarreros / RESTAPI_modificacion_entrada.php
Last active November 18, 2016 13:14
En donde 123 es el ID del posts a modificar
<?php
$host = 'http://tudominio.com/wp-json/wp/v2/posts/123';
$data = array('title' => 'Titulo Post Nuevo Modif', 'content' => 'Contenido de prueba Modif', 'status' => 'publish');
$data_string = json_encode($data);
$headers = array(
'Content-Type:application/json',
'Content-Length: ' . strlen($data_string),
@jmarreros
jmarreros / RESTAPI_borrado_entrada.php
Created November 13, 2016 03:45
En donde 123 es el ID del post a eliminar.
<?php
$host = 'http:/tudominio.com/wp-json/wp/v2/posts/123';
$headers = array(
'Content-Type:application/json',
'Authorization: Basic '. base64_encode('admin:clave')
);
$ch = curl_init($host);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'DELETE');