Skip to content

Instantly share code, notes, and snippets.

Avatar

GaSatrya satrya

View GitHub Profile
@satrya
satrya / thumbnail-list.php
Created Jul 8, 2013
Display all list thumbnail that already registered in WordPress.
View thumbnail-list.php
<?php
function list_thumbnail_sizes(){
global $_wp_additional_image_sizes;
$sizes = array();
foreach( get_intermediate_image_sizes() as $s ){
$sizes[ $s ] = array( 0, 0 );
if( in_array( $s, array( 'thumbnail', 'medium', 'large' ) ) ){
$sizes[ $s ][0] = get_option( $s . '_size_w' );
$sizes[ $s ][1] = get_option( $s . '_size_h' );
}else{
@satrya
satrya / rel.php
Last active Dec 17, 2015 — forked from corsonr/Add rel attribute to wordpress gallery
Add rel attribute to WordPress gallery
View rel.php
<?php
add_filter('wp_get_attachment_link', 'rc_add_rel_attribute');
function rc_add_rel_attribute($link) {
global $post;
return str_replace('<a href', '<a rel="prettyPhoto[pp_gal]" href', $link);
}
?>