Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //teste para a Gi
- add_filter( 'post_thumbnail_html', 'cms_post_image_html', 10, 3 );
- function cms_post_image_html( $html, $post_id, $post_image_id ) {
- if( is_singular(array('produtos', 'maquinas')) ){
- $large_image_url = wp_get_attachment_image_src( get_post_thumbnail_id($post_id), 'large');
- $html = '<a rel="lightbox" href="' . $large_image_url[0] . '" title="' . esc_attr( get_post_field( 'post_title', $post_id ) ) . '">' . $html . '</a>';
- } else {
- $html = '<a href="' . get_permalink( $post_id ) . '" title="' . esc_attr( get_post_field( 'post_title', $post_id ) ) . '">' . $html . '</a>';
- }
- return $html;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement