Skip to content

Instantly share code, notes, and snippets.

View fgrweb's full-sized avatar

Fernando Garcia Rebolledo fgrweb

View GitHub Profile
@fgrweb
fgrweb / genesis-open-graph.php
Created February 3, 2018 10:35 — forked from bradonomics/genesis-open-graph.php
Adding Open Graph Meta Tags to the Genesis Theme Head
<?php
//* Call the First Image in a Post (Used in the Open Graph Call Below)
function catch_first_image() {
global $post, $posts;
$first_img = '';
ob_start();
ob_end_clean();
$output = preg_match_all('/<img.+src=[\'"]([^\'"]+)[\'"].*>/i', $post->post_content, $matches);
$first_img = $matches [1] [0];
@fgrweb
fgrweb / 0_reuse_code.js
Created May 30, 2017 11:46
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console