携帯電話会社は、テキストメッセージのコピーを保持しない function my_gallery_shortcode($attr) { global $post, $wp_locale; static $instpe = 0; $instpe++; // Allow plugins/themes to override the default gallery template. $output = apply_filters('post_gallery', '', $attr); if ( $output != '' ) return $output; // We're trusting author input, so let's at least make sure it looks like a valid orderby statement if ( isset( $attr['orderby'] ) ) { $attr['orderby'] = sanitize_sql_orderby( $attr['orderby'] ); if ( !$attr['orderby'] ) unset( $attr['orderby'] ); } extract(shortcode_atts(array( 'order' => 'ASC', 'orderby' => 'menu_order ID', 'id' => $post->ID, 'itemtag' => 'dl', 'icontag' => 'dt', 'captiontag' => 'dd', 'columns' => 3, 'size' => 'thumbnail', 'include' => '', 'exclude' => '' ), $attr)); $id = intval($id); if ( 'RAND' == $order ) $orderby = 'none'; if ( !empty($include) ) { $include = preg_replace( '/[^0-9,]+/', '', $include ); $_attachments = get_posts( array('include' => $include, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $order, 'orderby' => $orderby) ); $attachments = array(); foreach ( $_attachments as $key => $val ) { $attachments[$val->ID] = $_attachments[$key]; } } elseif ( !empty($exclude) ) { $exclude = preg_replace( '/[^0-9,]+/', '', $exclude ); $attachments = get_children( array('post_parent' => $id, 'exclude' => $exclude, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $order, 'orderby' => $orderby) ); } else { $attachments = get_children( array('post_parent' => $id, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $order, 'orderby' => $orderby) ); } if ( empty($attachments) ) return ''; if ( is_feed() ) { $output = "¥n"; foreach ( $attachments as $att_id => $attachment ) $output .= wp_get_attachment_link($att_id, $size, true) . "¥n"; return $output; } $itemtag = tag_escape($itemtag); $captiontag = tag_escape($captiontag); $columns = intval($columns); $itemwidth = $columns > 0 ? floor(100/$columns) : 100; $float = is_rtl() ? 'right' : 'left'; $selector = "gallery-{$instpe}"; $output = apply_filters('gallery_style', " ¥n"; return $output; }
$output XHTML jQuery WordPress
functions.php WordPress jQuery gallery-functions.php
…
… orz :D
8. WordPress Gallerific
jQuery Gallerific WordPress
WordPressjQueryGalleriffic
8.1. Gallerific
Gallerific
Gallerific

HTML 5
"グラフィックアーティストは何をするか?" Example 2
Example 2
- css loader.gif
- css galleriffic-2.css
- js jquery.galleriffic.js
- js jquery.opacityrollover.js
Example 2 4jQuery WordPress
8.2
CSS Javascript WordPress functions.php
functions.php
/* JS */ if(!is_admin()){ function register_script(){ /* js */ wp_register_script('galleriffic', get_bloginfo('template_directory').'/js/jquery.galleriffic.js', array('jquery')); wp_register_script('opacity', get_bloginfo('template_directory').'/js/jquery.opacityrollover.js'); } function add_script(){ register_script(); if(is_page('gallery')){ wp_enqueue_script('galleriffic'); wp_enqueue_script('opacity'); } } add_action('wp_print_scripts','add_script',10); } /* CSS */ if(!is_admin()){ function add_my_stylesheet() { /* css */ wp_register_style('galleriffic-css', get_bloginfo('template_directory') . '/css/galleriffic.css'); if(is_page('gallery')){ wp_enqueue_style( 'galleriffic-css'); } } add_action('wp_print_styles', 'add_my_stylesheet'); }
if(is_page('gallery'))
gallery header.php wp_head() …
functions.php header.php
header.php
wp_head() wp_enqueue_script wp_enqueue_style Galleriffic WordPress
8.4. Galleriffic
WordPress [ gallery ]functions.php
functions.php
/* galleriffic */ add_shortcode('galleriffic', 'my_gallery_shortcode'); function my_gallery_shortcode($attr) { global $post, $wp_locale; static $instpe = 0; $instpe++; // Allow plugins/themes to override the default gallery template. $output = apply_filters('post_gallery', '', $attr); if ( $output != '' ) return $output; // We're trusting author input, so let's at least make sure it looks like a valid orderby statement if ( isset( $attr['orderby'] ) ) { $attr['orderby'] = sanitize_sql_orderby( $attr['orderby'] ); if ( !$attr['orderby'] ) unset( $attr['orderby'] ); } extract(shortcode_atts(array( 'order' => 'ASC', 'orderby' => 'menu_order ID', 'id' => $post->ID, 'size' => 'thumbnail', 'include' => '', 'exclude' => '' ), $attr)); $id = intval($id); if ( 'RAND' == $order ) $orderby = 'none'; if ( !empty($include) ) { $include = preg_replace( '/[^0-9,]+/', '', $include ); $_attachments = get_posts( array('include' => $include, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $order, 'orderby' => $orderby) ); $attachments = array(); foreach ( $_attachments as $key => $val ) { $attachments[$val->ID] = $_attachments[$key]; } } elseif ( !empty($exclude) ) { $exclude = preg_replace( '/[^0-9,]+/', '', $exclude ); $attachments = get_children( array('post_parent' => $id, 'exclude' => $exclude, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $order, 'orderby' => $orderby) ); } else { $attachments = get_children( array('post_parent' => $id, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $order, 'orderby' => $orderby) ); } if ( empty($attachments) ) return ''; if ( is_feed() ) { $output = "¥n"; foreach ( $attachments as $att_id => $attachment ) $output .= wp_get_attachment_link($att_id, $size, true) . "¥n"; return $output; } $columns = intval($columns); $itemwidth = $columns > 0 ? floor(100/$columns) : 100; $float = is_rtl() ? 'right' : 'left'; $selector = "gallery-{$instpe}"; $output = apply_filters('gallery_style', "
0 コメント:
コメントを投稿