I have created portfolio page which contains a image-slid-menu for navigation. For an menu item to appear as open, javascript gets instruction like ?id=0 appended to the url. for instance portfolio/art.php?id=0. However wordpress does not allow url slug containing ? or = for pages. What should I do now? I already setup the slider with these pages working: www.gransar.net/portfolio/ www.gransar.net/portfolio/design

did I complete screw up thinking this could be easily implemented? I'm using the following: http://www.ajaxblender.com/demos/menu/imagemenu/

  • Fix the JavaScript to use an hash like #id=1.
    – fuxia
    Feb 3 '13 at 8:48
  • # or = are not allowed
    – Deano
    Feb 3 '13 at 8:53
  • Of course they are. You just have to change the script. WordPress will never see or touch it.
    – fuxia
    Feb 3 '13 at 9:01
  • when I insert those characters in the Permalink wordpress automatically reformats and removes them from the slug. How are they allowed can you explain what you do? I'm running wordpress 3.5.1
    – Deano
    Feb 3 '13 at 9:05
  • You have to add these per JavaScript. Look how the Anything Slider does it.
    – fuxia
    Feb 3 '13 at 9:08

Here's a potential solution using the page_link filter and testing for the presence of a meta key to add a query arg:

function wpa84303_page_query_arg( $permalink, $page, $sample ) {
    if( $query_arg = get_post_meta( $page, 'query_arg', true ) )
        $permalink = add_query_arg( 'id', '0', $permalink );
    return $permalink;
add_filter( 'page_link', 'wpa84303_page_query_arg', 10, 3 );

Add a custom field to the page with the key query_arg and give it any value, if the key exists then ?id=0 will be appended via the add_query_arg function.


Ok... so I read the documentation for the slider and there is a function called Open that I added

<script type="text/javascript"> 
window.addEvent('domready', function(){
var myMenu = new ImageMenu($$('#imageMenu a'),{
openWidth:310, open:1, border:2, onOpen:function(e,i){window.location=(e);}

and everything is fine now. thanks everyone.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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