Hallo,
diesen Code hier benutze ich für eine Lightbox:
PHP
<?php # -*- coding: utf-8 -*-
/**
* Plugin Name: T5 Add Thickbox Support
* Plugin URI: http://toscho.de/?p=1997
* Description: Enables the Thickbox script for the theme.
* Version: 2012.08.12
* Author: Thomas Scholz <info@toscho.de>
* Author URI: http://toscho.de
* License: MIT
* License URI: http://www.opensource.org/licenses/mit-license.php
*/
add_action( 'wp_enqueue_scripts', 'add_thickbox' );
add_action( 'wp_footer', 't5_thickbox_jquery' );
/**
* Print JavaScript to make linked images thickboxy.
*
* @return void
*/
function t5_thickbox_jquery()
{
?>
<script>
jQuery( 'a img.size-medium, a img.attachment-thumbnail' )
.parent()
.addClass( 'thickbox' )
.attr( 'rel', 'page' );
</script>
<?php
}
Alles anzeigen
Quelle: http://hechtmediaarts.com/wordpress-lightbox-easy/
Das funktioniert auch, allerdings läd er immer die nicht verkleinerten Orginal-Bilder,
obwohl
img.size-medium
benutzt wird.
Weiß jemand wie man das ändern kan, ohne das ich alle Bilder neu
in der kleineren größe hochladen muss.
Es sollen also wirklich die Medium-Bilder geladen werden, die Wordpress
beim Upload angelegt hat.
MfG