| | 547 | * Add anchor hash to image attachment links. |
| | 548 | * |
| | 549 | * Appends a hash anchor to attachment link URLs, which moves the focus down to |
| | 550 | * the main content area to view the image when the attachment page loads. |
| | 551 | * |
| | 552 | * @since Twenty Thirteen 1.0 |
| | 553 | * |
| | 554 | * @param string $url The image attachment URL |
| | 555 | * @return string |
| | 556 | */ |
| | 557 | function twentythirteen_attachment_link( $url ) { |
| | 558 | if ( wp_attachment_is_image() ) |
| | 559 | $url .= '#main'; |
| | 560 | |
| | 561 | return $url; |
| | 562 | } |
| | 563 | add_filter( 'attachment_link', 'twentythirteen_attachment_link' ); |
| | 564 | |
| | 565 | /** |