• Do u know how can i open different single.php in wordpress based on some parameter passed.

    For some reason when i pass the parameter with the permlink – get_permalink($post->ID).’?name=rahul’ the parameter doesn’t reaches the page and it is taken off from the url as well.

    Any clues?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Moderator keesiemeijer

    (@keesiemeijer)

    Try changing the name parameter. if I do this I get a 404:

    <a href="<?php echo get_permalink($post->ID).'?name=rahul' ?>"><?php echo $post->post_title;  ?></a>

    but if i do this:

    <a href="<?php echo get_permalink($post->ID).'?the_name=rahul' ?>"><?php echo $post->post_title;  ?></a>

    it works.
    Maybe “name” is a reserved (query) parameter.

    Thread Starter thoughtchirps

    (@thoughtchirps)

    Thanks. I will try this and let you know this asap.

    Thread Starter thoughtchirps

    (@thoughtchirps)

    Works like a charm. Thanks for the tip.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Multiple single.php based on some custom parameter’ is closed to new replies.