• Resolved harhut

    (@harhut)


    I made an edit to the only page (not post) on my blog that uses a page template, the search page. When I set it up in around May 2022 I selected a page template (I’d created separately) from a drop down menu that (I think) was in the Page Attributes box. Today when I saved the change, the search page had somehow “un-linked” from the page template, and no longer works.

    The search field input box, and the content that was on the search page has all vanished, only the title remains. That makes sense though as all of this was on the page template file, which I had called searchpage.php

    I searched around and see the process for selecting page templates was changed sometime around WP 5.8. Now there’s meant to be a box or option called “Templates” in the sidebar, along with the usual things like Publish, Page Attributes, and Featured Image, but Templates is not visible on the editor page sidebar (see screenshot: https://imgur.com/a/t529U1o).

    Has anyone else seen this? I made the theme myself in May 2022 (as I have a couple of times since adopting WP in 2007) so cannot get support from a theme developer. I’m no pro, I just followed the then latest guidelines in the WP codex, plus the info on a couple of reputable WP blogs, when creating the theme last year. The site has otherwise functioned perfectly since I built the theme.

    A few other things: I’m running the latest version of WP (6.2.2), and all plugins are up to date. I also use the classic editor plugin, but when I switched over to the Block Editor it made no difference.

    Any advice would be greatly appreciated ??

Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator bcworkz

    (@bcworkz)

    Do you have a block theme (.html templates) or “classic” theme (.php templates)?

    Custom page templates should still work for classic themes. Templates are managed very differently with block themes. If your template is in the right folder (theme root or /page-templates) and has the proper comment header as shown in the above linked article, it should appear as an optional page template in the editors.

    I have custom templates in my classic theme and they still appear as optional templates in the editors. Note that in the block editor the template selection is part of the page summary, it’s not in the page attributes meta box like it is in the classic editor.

    Thread Starter harhut

    (@harhut)

    @bcworkz, thanks for the reply. Um, yes, no template header, somehow I never added one, and that was the one crucial detail I missed in the hours I spent troubleshooting this problem.

    The theme is classic (has php files) but I’ve been reading more about block themes the last couple of days, something I’d much misunderstood until now. Here I was thinking block themes were tied to the Guttenberg editor, which frustrates the heck out of me. I’d see things like “select a block to edit” or some such, and lol thought that’s what everyone meant by block themes!

    So, anyway, thanks, problem all sorted out now ??

    • This reply was modified 1 year, 4 months ago by harhut. Reason: typo
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘WP Pages: “page template” dropdown not visible – SELF MADE THEME’ is closed to new replies.