Viewing 7 replies - 1 through 7 (of 7 total)
  • Michael Beckwith

    (@tw2113)

    The BenchPresser

    The standard WordPress hierarchy will still apply with BadgeOS. So archive-$achievement_slug.php would take over instead of just the regular archive.php, for example.

    Thread Starter funeral

    (@funeral)

    i have a full width page i would like it to use,how could i change it? when creating the page i selected it in the page template but its still using the archive template

    Michael Beckwith

    (@tw2113)

    The BenchPresser

    Custom Post Types don’t get a template dropdown like standard pages. You’ll need to rename your template file to match the archive-$achievement_slug.php format or do some conditonal logic with the template_include filter to get it loaded properly.

    Thread Starter funeral

    (@funeral)

    how would i fix this?

    if you go to https://ap3pclan.com/badges/

    it doesnt show correctly

    Michael Beckwith

    (@tw2113)

    The BenchPresser

    Did you take your custom template file, name it accurately, and put it in your theme folder? In this case, archive-badges.php ?

    Thread Starter funeral

    (@funeral)

    Yeah i tried that but it just came out blank or comes out REALLY big

    Michael Beckwith

    (@tw2113)

    The BenchPresser

    Not sure what’s going on with that, but that’s the route to go with this. If the intended template file was actually loaded at that point, then the rest is figuring out why it was ending up blank or REALLY big, and moving forward from there.

    The only other way I can think of that is more akin to the select input on the post editor is very custom using a metabox and loading with pre-selected templates from your theme folder, and allowing the user to choose which to use, and save that value to post meta. Then, you hook into the template_include hook, grab the selected meta value, which will store the template name/path and tell the template_include hook to use that file. A bit complicated if you’re not a developer, but I got the same idea to work for standard posts and custom templates for a client site once.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Change which template it calls from?’ is closed to new replies.