Skip to content

Instantly share code, notes, and snippets.

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

Fernando Agüero fjaguero

🏠
Working from home
View GitHub Profile
@fjaguero
fjaguero / Lightbox for Galleria.io
Created July 26, 2012 15:07
Extend Galleria using Lightbox when clicking the main image -for Desktops-
// Remember to load jQuery & Galleria.Js
<script>
// Load the classic theme
Galleria.loadTheme('galleria.classic.js');
// Initialize Galleria
Galleria.run('#galleria', {
@fjaguero
fjaguero / wordpress-next-prev-nav.php
Created September 20, 2012 10:40
Wordpress: Previos-Next Post Navigation
<div class="navigation">
<div class="alignleft">
<?php previous_post_link($format='%link', $link='< Anterior', $in_same_cat = true) ?>
</div>
<div class="alignright">
<?php next_post_link($format='%link', $link='Siguiente >', $in_same_cat = true) ?>
</div>
@fjaguero
fjaguero / gist:3810097
Created October 1, 2012 07:29
Wordpress the_time dd/mm/yy function format
<span class="post-date"><?php the_time(__('d/m/Y')) ?></span>
@fjaguero
fjaguero / wp_alt_title_thumb.php
Created October 9, 2012 11:17
Wordpress: Get ALT and TITLE for the post thumbnail
<?php if ( has_post_thumbnail() ) :?>
<a href="<?php the_permalink() ?>" class="thumb"><?php the_post_thumbnail('thumbnail', array(
'alt' => trim(strip_tags( $post->post_title )),
'title' => trim(strip_tags( $post->post_title )),
)); ?></a>
<?php endif; ?>
@fjaguero
fjaguero / opengraph-wordpress.php
Created October 17, 2012 08:32
Add Facebook Open Graph Meta Data to Wordpress
//Adding the Open Graph in the Language Attributes - functions.php
function add_opengraph_doctype( $output ) {
return $output . ' xmlns:og="http://opengraphprotocol.org/schema/" xmlns:fb="http://www.facebook.com/2008/fbml"';
}
add_filter('language_attributes', 'add_opengraph_doctype');
//Lets add Open Graph Meta Info
function insert_fb_in_head() {
@fjaguero
fjaguero / wp-menu-custom-title-category.php
Created October 17, 2012 12:33
PHP: Show the title of a menu element depending the current category
/* ----------------------------- FUNCTIONS.PHP --------------------------*/
/* @Workether ------------------------------------------------------------
Get Category ID by his name.
--------------------------------------------------------------------------*/
function get_category_id($cat_name){
$term = get_term_by('name', $cat_name, 'category');
return $term->term_id;
}
@fjaguero
fjaguero / font-face.css
Created October 19, 2012 10:34
CSS: @font-face standard css
@font-face {
font-family: 'ModernNo.20Regular';
src: url('../fonts/mod20-webfont.eot');
src: url('../fonts/mod20-webfont.eot?#iefix') format('embedded-opentype'),
url('../fonts/mod20-webfont.woff') format('woff'),
url('../fonts/mod20-webfont.ttf') format('truetype');
font-weight: normal;
font-style: normal;
}
@fjaguero
fjaguero / php-facebook-wordpressLoop.php
Created October 19, 2012 16:22
PHP: Facebook like for Wordpress Loop
<div id="fb-root"></div>
<script>(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/all.js#xfbml=1&appId=224015364350232";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
@fjaguero
fjaguero / css_tranistions_sprites.css
Created October 31, 2012 09:16
CSS - Transitions with Sprites
.icon-facebook {
background-position: -50px 0;
width: 20px;
height: 19px;
position: relative;
text-indent: -9999px;
display: inline-block;
}
.icon-facebook:after{
background: url("images/sprites/sprite-icons.png") no-repeat scroll -75px 0 transparent;
@fjaguero
fjaguero / test.html
Created December 12, 2012 22:43
Form
<!doctype html>
<header> </header>
<body>
<span style="float:left;">
<label for="id1">label1:</label>
<input type="text" id="id1"/><br>