Support » Fixing WordPress » want to create wordpress gallery link ending with hashtag
4 years ago
Can anyone help me to make a function for wordpress attachments url ending with hashtag eg. #image
I think I need to apply filter etc
Can you explain this more?
Do you just want to append #image onto every attachement URL? For example a final output would be.
May I ask why also? Might be a better way.
sorry I didn’t explained clearly. I want to change slug.
I am not good at regular expressions and all that good stuff so I would need to fix it by trial and error.
But it would be something like below adding to functions.php
$new_rules = array();
$new_rules['attachment/(\d*)$'] = 'index.php?attachment_id=$matches';
$wp_rewrite->rules = $new_rules + $wp_rewrite->rules;
My first attempt would be changing it to
Like I said I suck at regular expressions so I can’t help you anymore than this.
Thanks for the tip. I tried but it didn’t work. No errors and no effect to urls.