[wp-trac] [WordPress Trac] #23209: Template pages to override Twenty Eleven theme layout for next update.

WordPress Trac noreply at wordpress.org
Tue Jan 9 15:19:17 UTC 2024


#23209: Template pages to override Twenty Eleven theme layout for next update.
---------------------------+----------------------
 Reporter:  theBrettman    |       Owner:  (none)
     Type:  enhancement    |      Status:  closed
 Priority:  normal         |   Milestone:
Component:  Bundled Theme  |     Version:  3.5
 Severity:  normal         |  Resolution:  wontfix
 Keywords:  close          |     Focuses:
---------------------------+----------------------

Comment (by alexsaim78):

 Open your theme's functions.php file. In it, create a function called
 custom_override_layout. Inside this function, check if the current page
 uses a specific template (like 'custom-template.php'). If so, set a custom
 layout using the $layout variable. You can add more conditions for other
 page templates.
 Also, register three default page templates (e.g., template1.php,
 template2.php, template3.php) using the custom_register_page_templates
 function. These templates can serve as examples, and you can create your
 own templates using them as a guide.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/23209#comment:6>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list