Skip to content

Instantly share code, notes, and snippets.

View kadai's full-sized avatar

Kadai Crosshansen kadai

View GitHub Profile
<?php
function dtorrer_agregar_seguimiento_envio() {
?>
<script type="text/javascript">
document.addEventListener( 'wpcf7mailsent', function( event ) {
location = 'https://dtorrer.com/url-destino';
}, false );
</script>
<?php
<?php
function mostrar_busqueda( $items, $args ){
/* SI NO ES EL MENU PRINCIPAL, REGRESAMOS EL MENU SIN TOCAR */
if ( "primary" != $args->theme_location ){
return $items;
}
$formulario = get_search_form(FALSE);
@kadai
kadai / htaccess
Last active November 8, 2017 07:23
php_value memory_limit 256M
<?php
add_action( 'wp_footer', 'funcion_codigo_especial' );
function funcion_codigo_especial(){
/* AQUÍ IMPRIMIMOS EL CÓDIGO JAVASCRIPT A USAR */
/* O LO PODEMOS DELIMITAR ENTRE "?>" Y <?php" */
}
?>
#CAMBIA "xxx.xxx" CON TU DIRECCIÓN IP
SetEnvIF X-Forwarded-For xxx.xxx Allowed
order deny,allow
allow from env=Allowed
deny from all
#LE PERMITIMOS A TODOS ACCEDER AL AJAX
<Files "admin-ajax.php">
Order allow,deny
<?php if (current_user_can('update_core')) { ?>
<p><?php echo get_num_queries() ?> queries. <?php if (function_exists('memory_get_usage')) { $unit=array('b','kb','mb','gb','tb','pb'); echo @round(memory_get_usage(true)/pow(1024,($i=floor(log(memory_get_usage(true),1024)))),2).' '.$unit[$i]; ?> Memory usage. <?php } timer_stop(1) ?> seconds.</p>
<?php } ?>
@kadai
kadai / dummy_funct.php
Last active July 1, 2017 09:08
Conjunto de código de ejemplo
<?php
add_filter( 'wp_title', 'myfunction_cambiandoimagen' );
?>
@kadai
kadai / modify-topposts02.php
Last active June 26, 2017 07:23
Functions to add to the functions.php to change "Top Posts" widget from Jetpack (part 2)
<?php
function jetpackcustom_changeimage($get_image_options){
$default = 150;
$get_image_options['avatar_size'] = $default;
$get_image_options['width'] = $default;
$get_image_options['height'] = $default;
return $get_image_options;
}
add_action( 'jetpack_top_posts_widget_image_options', 'jetpackcustom_changeimage' );
@kadai
kadai / topppost-change03.css
Created June 26, 2017 06:51
CSS to change the appearance of the Top Posts widget (Part 3)
.top_posts_date {
margin-top: 3px;
font-size: 0.75em;
font-weight: 700;
text-transform: uppercase;
letter-spacing: 1px;
color: #888;
}
@kadai
kadai / topppost-change02.css
Created June 26, 2017 06:50
CSS to change the appearance of the Top Posts widget (part 2)
.widgets-list-layout-links a {
font-family: 'Playfair Display',Georgia,serif;
line-height: 140%;
font-weight: 700;
color: #111;
}
.widgets-list-layout-links a:hover {
color: #111;
text-decoration: underline;