Skip to content

Instantly share code, notes, and snippets.

View larodiel's full-sized avatar

Victor Larodiel larodiel

View GitHub Profile
function autogen_featured_img() {
global $post;
if (!has_post_thumbnail($post->ID)) {
$attached_image =
get_children( "post_parent=$post->ID&post_type=attachment&post_mime_type=image&numberposts=1" );
if ($attached_image) {
foreach ($attached_image as $attachment_id => $attachment) {
set_post_thumbnail($post->ID, $attachment_id);
}
@larodiel
larodiel / preloader.js
Last active October 21, 2015 21:24 — forked from adamesque/preloader.js
Uses jQuery's new Deferred object to help with image loading
var preloadImages = function(srcs) {
var dfd, i, img, l, p, promises;
jQuery.whenArray = function(array) {
return jQuery.when.apply(this, array);
};
dfd = $.Deferred();
promises = [];
img;
l;
p;
{
"estados": [
{
"sigla": "AC",
"nome": "Acre",
"cidades": [
"Acrelândia",
"Assis Brasil",
"Brasiléia",
"Bujari",

Copied from http://code.lancepollard.com/complete-list-of-html-meta-tags/

Basic HTML Meta Tags

<meta charset='UTF-8'>
<meta name='keywords' content='your, tags'>
<meta name='description' content='150 words'>
<meta name='subject' content='your website's subject'>
<meta name='copyright' content='company name'>