Skip to content

Instantly share code, notes, and snippets.

@keeguon
keeguon / countries.json
Created April 5, 2012 11:11
A list of countries in JSON
[
{name: 'Afghanistan', code: 'AF'},
{name: 'Åland Islands', code: 'AX'},
{name: 'Albania', code: 'AL'},
{name: 'Algeria', code: 'DZ'},
{name: 'American Samoa', code: 'AS'},
{name: 'AndorrA', code: 'AD'},
{name: 'Angola', code: 'AO'},
{name: 'Anguilla', code: 'AI'},
{name: 'Antarctica', code: 'AQ'},
@erkattak
erkattak / NextGEN-Cover-Image.php
Created May 30, 2011 21:40
WordPress - Pull NextGEN Gallery Preview Image using Gallery ID
<?php
$gallery_id = 1; // Use the PODS column, custom post field or however you would get this ID
$results = $wpdb->get_results("SELECT ng.path, np.filename FROM wp_ngg_pictures np, wp_ngg_gallery ng WHERE np.galleryid=ng.gid AND np.galleryid=".$gallery_id." AND np.pid=ng.previewpic",ARRAY_A);
if(!empty($results[0]['path']) && !empty($results[0]['filename'])) :
$imgpath = $results[0]['path'].'/'.$results[0]['filename'];
endif;