Skip to content

Instantly share code, notes, and snippets.

View ximosa's full-sized avatar

Joaquin Saez ximosa

View GitHub Profile
<?php
require('xa-register.class.php');
// En el frontend
// CSS
add_style('mi_estilo','css/estilo.css');
// JS
add_script('mi_script','js/script.js');
@ximosa
ximosa / chuleta wordpress
Last active August 29, 2015 13:57
chuleta wordpress
header.php ...................... Header Section
index.php ......................... Main Section
sidebar.php .................... Sidebar Section
single.php ....................... Post Template
page.php ......................... Page Template
comments.php .................. Comment Template
search.php ...................... Search Content
searchform.php ............ Search Form Template
archive.php ................... Archive Template
functions.php ................ Special Functions
@ximosa
ximosa / PHP en widgets de texto
Last active August 29, 2015 13:57
PHP en widgets de texto
//Ejecutar PHP en widgets de texto
function ejecutar_php($html){
if(strpos($html,"<"."?php")!==false){
ob_start();
eval("?".">".$html);
$html=ob_get_contents();
ob_end_clean();
}
return $html;
}
@ximosa
ximosa / modal con css
Last active August 29, 2015 13:57
modal con css
/* esto es como se creara el html */
<p><a href="#modal"> Activar ventana</a></p>
<div id="modal">
<div class="modal-content">
<div class="header">
<h2>Titulo de la ventana</h2>
@ximosa
ximosa / contacto wordpress
Last active August 29, 2015 13:57
contacto wordpress
/*Lo primero es crear el archivo es la cabecera para indicar que es una página:*/
<?php
/*
Template name: Pagina de Contacto
*/
?>
<?php
//Si se envía el formulario
if(isset($_POST['submitted'])) {
@ximosa
ximosa / plugin personificado
Last active August 29, 2015 13:57
plugin personificado
<?php
/*
Plugin Name: usuarios
Plugin URI: http://webgae.com/
Description: Plugin para usuarios wordpress .
Version: 1.0
Author: Joaquin Saez
Author URI: http://webgae.com
License: GPLv2 o posterior
*/
@ximosa
ximosa / Añadir adsense con Shortcode
Last active August 29, 2015 13:57
Añadir adsense con Shortcode
//Personalizamos la funcion con nuestro código adsense
function get_adsense($atts) {
return '<script type="text/javascript"><!--
google_ad_client = "pub-su numero de adsense";
/* 468x60, created 9/13/10 */
google_ad_slot = "su numero de adsense/";
google_ad_width = 468;
google_ad_height = 60;
//-->
@ximosa
ximosa / Boton en editor
Last active August 29, 2015 13:57
Añadir boton sobre editor de wordpress
//Creamos la funcion
function mi_generador_boton( $page = null, $target = null ) {
//Añádimos css
echo '<style>
#modal {
left:50%;
margin:-250px 0 0 -40%;
@ximosa
ximosa / abrir cerrar
Last active August 29, 2015 13:57
Abrir y cerrar shorcode contoogle de jquery para wordpress
/**
* añadir esto a tu init.js si tienes uno o crera uno y añadir ver
http://codex.wordpress.org/Function_Reference/wp_enqueue_script
añadir
jQuery(document).ready(function(){
jQuery(".toggle_content").hide();
jQuery(".toggle_title").click(function() {
jQuery(this).toggleClass("toggle_active").next().slideToggle('fast');
return false;
@ximosa
ximosa / css gravity
Last active August 29, 2015 13:57
estilo css para gravity forms
.gform_wrapper ul {
padding-left: 0;
list-style: none; }
.gform_wrapper li {
margin-bottom: 15px; }
.gform_wrapper form {
margin-bottom: 0; }