Timeline for WordPress calls archive page instead of Custom Page Template
Current License: CC BY-SA 3.0
13 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Jul 12, 2016 at 4:47 | comment | added | Tim Malone | @TESTacy Could you perhaps edit your question to add some details on why you want to do this? It doesn't make a lot of sense, so perhaps we can suggest another solution for your problem. | |
| Jul 6, 2016 at 4:11 | comment | added | IAmMilinPatel | For now I did it as per the archive way. Still am looking for a solution to get it directly in a page template! | |
| Jul 6, 2016 at 4:08 | comment | added | Tim Malone | How did you go with this in the end, @TESTacy? | |
| May 23, 2016 at 3:59 | comment | added | Tim Malone | Hmm.. try visiting the Settings -> Permalinks page after creating your page/updating the slug. Permalinks might need a refresh to take over the CPT archive. Thanks for the vote :) | |
| May 23, 2016 at 3:54 | comment | added | IAmMilinPatel | Although, I'd vote up your answer because it does work if you want to go the archive way! :) | |
| May 23, 2016 at 3:53 | comment | added | IAmMilinPatel | Okay! So if I still want to use the page template and not the archive page, then how can I do that? Because I also tried adjusting the page slug as you mentioned but it didn't work. Still got the same result. | |
| May 23, 2016 at 2:50 | comment | added | Tim Malone | Yes you can use a page template instead - but Wordpress will already do the querying work for you if you use an archive template :) Using a page template will probably only really be useful if you want to add custom content from the page itself as well. | |
| May 23, 2016 at 2:49 | comment | added | IAmMilinPatel | So this will work only with the archive page? Wont a page template do the job instead? | |
| May 23, 2016 at 1:34 | comment | added | Tim Malone | @TESTacy I just edited my answer to add another para at the end, which I think now might be what you're after. | |
| May 23, 2016 at 1:34 | history | edited | Tim Malone | CC BY-SA 3.0 | Add note on changing page slug to replace CPT archive page |
| May 23, 2016 at 1:32 | comment | added | Tim Malone | If you want to use the template as a page template as well, then yes, you can include Template Name in there. However, usually you would create a separate template for your post type archive and for a page you wish to set a custom template for. | |
| May 23, 2016 at 1:31 | comment | added | IAmMilinPatel | Hi, thanks for the suggestion. I will definitely try it. But, if we don't have /* Template Name: Projects */, then how can we create a dynamic page for it from the WP backend UI? | |
| May 23, 2016 at 1:29 | history | answered | Tim Malone | CC BY-SA 3.0 |