How can I show the same post content with two different post layouts on two different URLs?

For example


1 Answer 1


You can pass the layout name as a GET parameter and then change the design based on that. So your URL should be something like this:


Now in your single.php file or whatever file that renders the template, you can do this check to show the different layouts:

// If the header is different two, you should call for different headers too, 
// Check this for showing different headers
// https://developer.wordpress.org/reference/functions/get_header/
if( isset( $_GET['layout'] )  && $_GET['layout'] == 'layout-1' ) {
    // Show the design for for the first layout 
else if ( ... ) {
    // Show the design for other layouts 
  • Thank you very much it will work
    – Mano Odin
    May 6, 2021 at 21:12

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.