Skip to content

Instantly share code, notes, and snippets.

View sibaberpollo's full-sized avatar

José Pino sibaberpollo

View GitHub Profile
@sibaberpollo
sibaberpollo / jquery-the_excerpt()
Created November 24, 2015 19:31
jQuery para acortar los intro (the_excerpt()) de Wordpress. Muy útil con Visual Composer.
<script type="text/javascript">
jQuery(window).bind("load", function() {
jQuery(".proy-descripcion").text(function(index, currentText) {
//return currentText.substr(0, 75);
return currentText.substr(0, 75) + ' ...';
});
});
</script>
@sibaberpollo
sibaberpollo / style.css
Last active April 2, 2019 16:00
Bootstrap 3 - Cambiar el punto de quiebre del menu a 1200 píxeles
/* Colapsar menu antes del quiebre de Bootstrap */
@media (max-width: 1200px) {
.navbar-header {
float: none;
}
.navbar-toggle {
display: block;
}
.navbar-collapse {
$(".tabs #linea-rota").each(function() {
var width = $(window).width();
if (width <= 768) {
var html = $(this).html().split(" ");
html = html[0] + "<br>" + html.slice(1).join(" ");
$(this).html(html);
}
});
@sibaberpollo
sibaberpollo / iframe.js
Last active January 25, 2016 19:43
Cambiar el tamaño de un iframe al alto completo de una página
<script type="text/javascript">
$ = jQuery;
$(document).ready(function () {
updateContainer();
$(window).resize(function() {
updateContainer();
});
});
function updateContainer() {
var first_time = true;
$(document).ready(function () {
updateContainer();
$(window).resize(function() {
updateContainer();
console.log(first_time);
});
});
function updateContainer() {
@sibaberpollo
sibaberpollo / responsive-Awesome-Flickr-Gallery.js
Created January 27, 2016 17:19
responsive Awesome Flickr Gallery
@sibaberpollo
sibaberpollo / cols-mismo-alto.js
Created February 15, 2016 20:08
Funciones para tener div con mismo alto y centrar imágenes según su posición
function altoFila() {
$('.fila-eventos').each(function(){
var highestBox = 0;
var width = $(window).width();
if (width >= 768) {
$('.column', this).each(function(){
if($(this).height() > highestBox)
highestBox = $(this).height();
});
console.log(highestBox);
<?php
add_filter( 'auto_update_plugin', '__return_false' );
add_filter( 'auto_update_theme', '__return_false' );
/* Remover version de Woprdpress */
add_action('init', 'myoverride', 100);
function myoverride() {
remove_action('wp_head', array(visual_composer(), 'addMetaData'));
}
$('.panel-body section').each(function(index) {
if (index > 1) {
$(".panel-body").ready(function(){
$("<button>Contáctanos</button>").insertBefore("section");
});
}
});
@sibaberpollo
sibaberpollo / functions.php
Last active April 6, 2016 15:46
en la función save de wordpress, mueve la imagen destacada a un directorio y agrega un texto
<?php
function save_id_to_file($post_id){
//use your file creation/save function here
header ("Content-type: image/jpeg");
$path = "C:\TEMP";
$imageName = $path."\\meme-".$post_id.".png";
$imageNameFeat = $path."\\meme-".$post_id."-feat.png";
$elTitulo = get_field('conduccion');