WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a one page template(muse theme) which its main menu items link to a specific part of the page in the webpage itself. I want to add # character before post name to go to the specific part of the page just like wikipedia. How can I do that in permalinks? It doesn't allow # character.

share|improve this question
Do you mean this? Is a link from wikipedia. http://en.wikipedia.org/wiki/Wordpress#Awards If yes, this only a anker inside the html, there is always possible to add to each link url. You find more information in html documentation about anker. – bueltge Apr 30 '14 at 15:09
@bueltge, No I mean its not in my post, its a navigation menu which I've defined in menus section. Its a primary menu item. – Ramin Omrani Apr 30 '14 at 15:10

Maybe this works, currently not tested. Only a idea to enhance for the custom var. Also I don't the goal right.

add_filter( 'query_vars', 'add_custom_query_var' );
function add_custom_query_var( $vars ) {

  $vars[] = '#';
  return $vars;

A other hint is the link to the codex, to filter the rewrite of WP.

share|improve this answer
It doesn't work buddy, I want localhost/#services . It produces localhost/services – Ramin Omrani Apr 30 '14 at 15:22
Do you have seen the example on the codex link? It have a example to create new rule. – bueltge Apr 30 '14 at 15:27
Yes I saw it and tried it but it doesn't work – Ramin Omrani Apr 30 '14 at 15:31

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.