您可以将徽标作为图库插入帖子内容,并自行编写图库输出。
add_filter( \'post_gallery\', \'your_gallery_output_function\', 10, 2 );
function your_gallery_output_function( $output, $attr ) {
global $post;
$args = array(
\'post_type\' => \'attachment\',
\'post_status\' => \'inherit\',
\'post_mime_type\' => \'image\',
\'orderby\' => $orderby,
\'post_parent\' => $post->ID,
\'number_of_posts\' => -1
);
// get images
$images = get_posts( $args );
// if no images are found
if ( empty( $images ) )
return;
// add a wrapper around all images
$output = \'<div class="your-gallery-wrapper">\';
// loop through the images
foreach ( $images as $an_image ) {
// .. do something with all the logos here
// and add them to $output...
}
// close wrapper
$output.= \'</div>\';
return $output;
}