Title: need help
Last modified: August 19, 2016

---

# need help

 *  [digows](https://wordpress.org/support/users/digows/)
 * (@digows)
 * [15 years ago](https://wordpress.org/support/topic/need-help-70/)
 * hi. need your help to modify this code so it will add rel to attachment page 
   also
 *     ```
       add_filter('the_content', 'addshadowboxrel', 12);
       add_filter('get_comment_text', 'addshadowboxrel');
       function addshadowboxrel ($content)
       {   global $post;
       	$pattern = "/<a(.*?)href=('|\")([^>]*).(bmp|gif|jpeg|jpg|png)('|\")(.*?)>(.*?)<\/a>/i";
           $replacement = '<a$1href=$2$3.$4$5 rel="shadowbox['.$post->ID.']"$6>$7</a>';
           $content = preg_replace($pattern, $replacement, $content);
           return $content;
       }
       ```
   
 * this works only for images but i’d like to open an attachment page in shadowbox
   also
 * thanks

Viewing 1 replies (of 1 total)

 *  Thread Starter [digows](https://wordpress.org/support/users/digows/)
 * (@digows)
 * [15 years ago](https://wordpress.org/support/topic/need-help-70/#post-2060389)
 * please, anyone?

Viewing 1 replies (of 1 total)

The topic ‘need help’ is closed to new replies.

## Tags

 * [REL](https://wordpress.org/support/topic-tag/rel/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 1 participant
 * Last reply from: [digows](https://wordpress.org/support/users/digows/)
 * Last activity: [15 years ago](https://wordpress.org/support/topic/need-help-70/#post-2060389)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
