Answer the question
In order to leave comments, you need to log in
How to make two output pages of one wordpress post?
Good afternoon, the essence is simple, I want to add an additional layout for each page - I want to make an html letter ready for sending from each news, so I need to figure out how to add a second output template for the record, url, of course, I also need a second one, I also need to come up with how to hide it from indexing)) Does anyone have an idea how to implement it?
Answer the question
In order to leave comments, you need to log in
An easy way is to add a get parameter to the pages and check it in the template, if it exists, then display the second version of the template, hide from indexing by the presence of this get parameter.
There is a more correct option, but more difficult. You need to register a new query_var, add new processing rules with this value to the url through add_rewrite_rule, check it through the template_include filter and call the new template file.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question