Über die Filterfunktion habe ich es nun gemacht. Idee von http://wordpress.stackexchange.com/questions/7729…-attachment-php
PHP
<?php
add_filter( 'previous_image_link', 'wpse_77296_img_link_class' );
add_filter( 'next_image_link', 'wpse_77297_img_link_class' );
/**
* Add CSS class to image navigation links.
*
* @wp-hook previous_image_link
* @wp-hook next_image_link
* @param string $link Complete markup
* @return string
*/
function wpse_77296_img_link_class( $link )
{
$class = 'next_image_link' === current_filter() ? 'next' : 'prev';
return str_replace( '<a ', '<a class="left carousel-control" data-slide="prev" ', $link );
}
function wpse_77297_img_link_class( $link )
{
$class = 'next_image_link' === current_filter() ? 'next' : 'prev';
return str_replace( '<a ', '<a class="right carousel-control" data-slide="next" ', $link );
}
?>
Alles anzeigen