CINXE.COM

WP_Theme | Andrew Nacin

<!DOCTYPE html> <!--[if IE 6]> <html id="ie6" xmlns:fb="http://ogp.me/ns/fb#" xmlns:og="http://ogp.me/ns#" lang="en-US"> <![endif]--> <!--[if IE 7]> <html id="ie7" xmlns:fb="http://ogp.me/ns/fb#" xmlns:og="http://ogp.me/ns#" lang="en-US"> <![endif]--> <!--[if IE 8]> <html id="ie8" xmlns:fb="http://ogp.me/ns/fb#" xmlns:og="http://ogp.me/ns#" lang="en-US"> <![endif]--> <!--[if !(IE 6) | !(IE 7) | !(IE 8) ]><!--> <html xmlns:fb="http://ogp.me/ns/fb#" xmlns:og="http://ogp.me/ns#" lang="en-US"> <!--<![endif]--> <head><script type="text/javascript" src="/_static/js/bundle-playback.js?v=HxkREWBo" charset="utf-8"></script> <script type="text/javascript" src="/_static/js/wombat.js?v=txqj7nKC" charset="utf-8"></script> <script>window.RufflePlayer=window.RufflePlayer||{};window.RufflePlayer.config={"autoplay":"on","unmuteOverlay":"hidden"};</script> <script type="text/javascript" src="/_static/js/ruffle/ruffle.js"></script> <script type="text/javascript"> __wm.init("https://web.archive.org/web"); __wm.wombat("http://nacin.com/tag/wp_theme/","20130115230838","https://web.archive.org/","web","/_static/", "1358291318"); </script> <link rel="stylesheet" type="text/css" href="/_static/css/banner-styles.css?v=S1zqJCYt" /> <link rel="stylesheet" type="text/css" href="/_static/css/iconochive.css?v=3PDvdIFv" /> <!-- End Wayback Rewrite JS Include --> <meta charset="UTF-8"/> <meta name="viewport" content="width=device-width"/> <title>WP_Theme | Andrew Nacin</title> <link rel="profile" href="http://gmpg.org/xfn/11"/> <link rel="stylesheet" type="text/css" media="all" href="https://web.archive.org/web/20130115230838cs_/http://nacin.com/wp-content/themes/nacin/style.css?v=20120207"/> <link rel="pingback" href="http://nacin.com/xmlrpc.php"/> <!--[if lt IE 9]> <script src="http://nacin.com/wp-content/themes/twentyeleven/js/html5.js" type="text/javascript"></script> <![endif]--> <link rel="alternate" type="application/rss+xml" title="Nacin 禄 Feed" href="https://web.archive.org/web/20130115230838/http://nacin.com/feed/"/> <link rel="alternate" type="application/rss+xml" title="Nacin 禄 Comments Feed" href="https://web.archive.org/web/20130115230838/http://nacin.com/comments/feed/"/> <link rel="alternate" type="application/rss+xml" title="Nacin 禄 WP_Theme Tag Feed" href="https://web.archive.org/web/20130115230838/http://nacin.com/tag/wp_theme/feed/"/> <script type="text/javascript" src="https://web.archive.org/web/20130115230838js_/http://platform.twitter.com/anywhere.js?id=Wlwwu33eguA1CNHitnH0Ag&amp;v=1"></script> <link rel="EditURI" type="application/rsd+xml" title="RSD" href="http://nacin.com/xmlrpc.php?rsd"/> <link rel="wlwmanifest" type="application/wlwmanifest+xml" href="http://nacin.com/wp-includes/wlwmanifest.xml"/> <meta name="generator" content="WordPress 3.6-alpha-23288"/> <meta property="og:site_name" content="Nacin"/> <meta property="fb:app_id" content="163662570313065"/> <meta property="og:locale" content="en_US"/> <link rel="shortcut icon" href="/web/20130115230838im_/http://nacin.com/favicon.ico?2"/> <meta id="syntaxhighlighteranchor" name="syntaxhighlighter-version" content="3.1.3"/> </head> <body class="archive tag tag-wp_theme tag-257 single-author one-column content"> <div id="page" class="hfeed"> <header id="branding" role="banner"> <hgroup> <h1 id="site-title"><span><a href="https://web.archive.org/web/20130115230838/http://nacin.com/" title="Nacin" rel="home">Nacin</a></span></h1> <h2 id="site-description">WordPress Core Developer</h2> </hgroup> <a href="https://web.archive.org/web/20130115230838/http://nacin.com/"> <img src="https://web.archive.org/web/20130115230838im_/http://andrewnacin.com/wp-content/themes/twentyten/images/headers/inkwell.jpg" width="1000" height="288" alt=""/> </a> <form method="get" id="searchform" action="https://web.archive.org/web/20130115230838/http://nacin.com/"> <label for="s" class="assistive-text">Search</label> <input type="text" class="field" name="s" id="s" placeholder="Search"/> <input type="submit" class="submit" name="submit" id="searchsubmit" value="Search"/> </form> <nav id="access" role="navigation"> <h3 class="assistive-text">Main menu</h3> <div class="skip-link"><a class="assistive-text" href="#content" title="Skip to primary content">Skip to primary content</a></div> <div class="skip-link"><a class="assistive-text" href="#secondary" title="Skip to secondary content">Skip to secondary content</a></div> <div class="menu-main-container"><ul id="menu-main" class="menu"><li id="menu-item-244" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-home menu-item-244"><a href="https://web.archive.org/web/20130115230838/http://nacin.com/">Home</a></li> <li id="menu-item-245" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-245"><a href="https://web.archive.org/web/20130115230838/http://nacin.com/about/">About</a></li> <li id="menu-item-249" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-249"><a href="https://web.archive.org/web/20130115230838/http://nacin.com/contact/">Contact</a></li> <li id="menu-item-3405" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-3405"><a href="https://web.archive.org/web/20130115230838/http://nacin.com/donate/">Donate</a></li> <li id="menu-item-359" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-359"><a>Plugins</a> <ul class="sub-menu"> <li id="menu-item-360" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-360"><a href="https://web.archive.org/web/20130115230838/http://wordpress.org/extend/plugins/log-deprecated-notices/">Log Deprecated&nbsp;Notices</a></li> <li id="menu-item-361" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-361"><a href="https://web.archive.org/web/20130115230838/http://wordpress.org/extend/plugins/hide-welcome-panel-for-multisite/">Hide Welcome Panel for&nbsp;Multisite</a></li> <li id="menu-item-3609" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-3609"><a href="https://web.archive.org/web/20130115230838/http://wordpress.org/extend/plugins/filtered-html-for-editors/">Filtered HTML for&nbsp;Editors</a></li> <li id="menu-item-362" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-362"><a href="https://web.archive.org/web/20130115230838/http://wordpress.org/extend/plugins/simple-footnotes/">Simple&nbsp;Footnotes</a></li> </ul> </li> </ul></div> </nav><!-- #access --> </header><!-- #branding --> <div id="main"> <section id="primary"> <div id="content" role="main"> <header class="page-header"> <h1 class="page-title">Tag Archives: <span>WP_Theme</span></h1> </header> <article id="post-4003" class="post-4003 post type-post status-publish format-standard hentry tag-page-templates tag-wordpress tag-wordpress-3-4 tag-wp_theme"> <header class="entry-header"> <h1 class="entry-title"><a href="https://web.archive.org/web/20130115230838/http://nacin.com/2012/03/29/page-templates-in-subdirectories-new-in-wordpress-3-4/" title="Permalink to Page templates in subdirectories, new in WordPress聽3.4" rel="bookmark">Page templates in subdirectories, new in WordPress&nbsp;3.4</a></h1> <div class="entry-meta"> <span class="sep">Posted on </span><a href="https://web.archive.org/web/20130115230838/http://nacin.com/2012/03/29/page-templates-in-subdirectories-new-in-wordpress-3-4/" title="12:33 pm" rel="bookmark"><time class="entry-date" datetime="2012-03-29T12:33:43+00:00">March 29, 2012</time></a><span class="by-author"> <span class="sep"> by </span> <span class="author vcard"><a class="url fn n" href="https://web.archive.org/web/20130115230838/http://nacin.com/author/nacin/" title="View all posts by Andrew Nacin" rel="author">Andrew Nacin</a></span></span> </div><!-- .entry-meta --> <div class="comments-link"> <a href="https://web.archive.org/web/20130115230838/http://nacin.com/2012/03/29/page-templates-in-subdirectories-new-in-wordpress-3-4/#comments" title="Comment on Page templates in subdirectories, new in WordPress聽3.4">83</a> </div> </header><!-- .entry-header --> <div class="entry-content"> <p>In WordPress 3.4, themes can now <strong>place page templates inside a subdirectory of their theme</strong>.</p> <p>I&#8217;ve spent much of the 3.4 development cycle <a href="https://web.archive.org/web/20130115230838/http://core.trac.wordpress.org/ticket/20103">working on a new API</a> called WP_Theme. But it&#8217;s not something you&#8217;ll find in the release announcement.</p> <p>That&#8217;s because the vast majority of plugin and theme developers will never use it, nor should they. It&#8217;s an under-the-hood enhancement that was aimed at strengthening our internals, and it enabled us to improve quite a bit. For example, we were able to find huge performance improvements in both memory and speed. And it enhances the ability to localize themes. (More on these changes when I start working on the 3.4 <a href="https://web.archive.org/web/20130115230838/http://nacin.com/tag/field-guide/">field guide</a>.)</p> <p>It feels nice to be working with a modern, well-written API, even if I&#8217;m the only one using it. That&#8217;s okay, because <a href="https://web.archive.org/web/20130115230838/http://core.trac.wordpress.org/changeset/20318">look how easy it was</a> to add support for page templates in a subdirectory. This is just the beginning.</p> <p>Child themes can override these templates the same as before &#8212; the child theme will just need to create the same directory structure to do it. (So, /page-templates/one-column.php needs to be overridden with /page-templates/one-column.php, not /one-column.php.) And yes, we&#8217;re only looking one level down.</p> <p><strong>Updated&#8230; Caution:</strong> Renaming a page template &#8212; and that includes moving all of top-level page templates into a directory &#8212; will unassign that page template for all pages currently using it. This is a new tool in your toolbox, but use it wisely.</p> <p class="share-sfc-stc"><a href="https://web.archive.org/web/20130115230838/http://twitter.com/share?url=http%3A%2F%2Fwp.me%2FpQEdq-12z&amp;count=horizontal&amp;related=nacin&amp;text=Page%20templates%20in%20subdirectories%2C%20new%20in%20WordPress%203.4" class="twitter-share-button" data-text="Page templates in subdirectories, new in WordPress 3.4" data-url="https://web.archive.org/web/20130115230838/http://wp.me/pQEdq-12z" data-counturl="http://nacin.com/2012/03/29/page-templates-in-subdirectories-new-in-wordpress-3-4/" data-count="horizontal" data-via="nacin" data-related="nacin"></a></p> </div><!-- .entry-content --> <footer class="entry-meta"> <span class="tag-links"> <span class="entry-utility-prep entry-utility-prep-tag-links">Tagged</span> <a href="https://web.archive.org/web/20130115230838/http://nacin.com/tag/page-templates/" rel="tag">page templates</a>, <a href="https://web.archive.org/web/20130115230838/http://nacin.com/tag/wordpress/" rel="tag">WordPress</a>, <a href="https://web.archive.org/web/20130115230838/http://nacin.com/tag/wordpress-3-4/" rel="tag">WordPress 3.4</a>, <a href="https://web.archive.org/web/20130115230838/http://nacin.com/tag/wp_theme/" rel="tag">WP_Theme</a> </span> <span class="sep"> | </span> <span class="comments-link"><a href="https://web.archive.org/web/20130115230838/http://nacin.com/2012/03/29/page-templates-in-subdirectories-new-in-wordpress-3-4/#comments" title="Comment on Page templates in subdirectories, new in WordPress聽3.4"><b>83</b> Replies</a></span> </footer><!-- .entry-meta --> </article><!-- #post-4003 --> </div><!-- #content --> </section><!-- #primary --> </div><!-- #main --> <footer id="colophon" role="contentinfo"> <div id="supplementary" class="two"> <div id="first" class="widget-area" role="complementary"> <aside id="text-3" class="widget widget_text"><h3 class="widget-title">About Me</h3> <div class="textwidget"><p><img src="https://web.archive.org/web/20130115230838im_/http://0.gravatar.com/avatar/01cfe9feaafb068590891bbd1f6a7f5a?size=75" style="float:right; margin:0 0 7px 7px"/> Hi, I'm Andrew Nacin, a Lead Developer of WordPress and Tech Ninja at Audrey Capital. I live in Washington, D.C. <a href="/web/20130115230838/http://nacin.com/about/">More...</a></p> </div> </aside><aside id="text-6" class="widget widget_text"><h3 class="widget-title">Find Me</h3> <div class="textwidget"><ul> <li><a href="https://web.archive.org/web/20130115230838/http://twitter.com/nacin">@nacin on Twitter</a></li> <li><a href="https://web.archive.org/web/20130115230838/http://ohloh.net/accounts/nacin">on Ohloh</a></li> <li><a href="https://web.archive.org/web/20130115230838/http://gravatar.com/nacin">on Gravatar</a></li> <li><a href="https://web.archive.org/web/20130115230838/http://about.me/nacin">on about.me</a></li> <li><a href="/web/20130115230838/http://nacin.com/contact/">Contact me directly</a></li> <li><a href="/web/20130115230838/http://nacin.com/feed/">This blog's RSS feed</a></li> </ul></div> </aside><aside id="linkcat-9" class="widget widget_links"><h3 class="widget-title">WordPress</h3> <ul class="xoxo blogroll"> <li><a href="https://web.archive.org/web/20130115230838/http://wpdevel.wordpress.com/" title="A P2 blog where we discuss the upcoming release">Development Updates</a></li> <li><a href="https://web.archive.org/web/20130115230838/http://core.trac.wordpress.org/">WordPress Trac</a></li> <li><a href="https://web.archive.org/web/20130115230838/http://wordpress.org/about/">WordPress.org</a></li> </ul> </aside> </div><!-- #first .widget-area --> <div id="second" class="widget-area" role="complementary"> <aside id="text-10" class="widget widget_text"><h3 class="widget-title">Tweets</h3> <div class="textwidget"><ul id="twitter_update_list"></ul> <script type="text/javascript"> function twitterCallback2(c){for(var b=[],a=0;a<c.length;a++){var e=c[a].user.screen_name,f=c[a].text.replace(/((https?|s?ftp|ssh)\:\/\/[^"\s\<\>]*[^.,;'">\:\s\<\>\)\]\!])/g,function(d){return'<a href="'+d+'">'+d+"</a>"}).replace(/\B@([_a-z0-9]+)/ig,function(d){return d.charAt(0)+'<a href="https://web.archive.org/web/20130115230838/http://twitter.com/'+d.substring(1)+'">'+d.substring(1)+"</a>"});b.push('<li><span class="status">'+f+'</span> <a class="time" href="https://web.archive.org/web/20130115230838/http://twitter.com/'+e+"/statuses/"+c[a].id+'">'+relative_time(c[a].created_at)+ "</a></li>")}document.getElementById("twitter_update_list").innerHTML=b.join("")} function relative_time(c){var b=c.split(" ");c=b[1]+" "+b[2]+", "+b[5]+" "+b[3];var a=Date.parse(c);b=arguments.length>1?arguments[1]:new Date;a=parseInt((b.getTime()-a)/1E3,10);a+=b.getTimezoneOffset()*60;return a<60?"less than a minute ago":a<120?"about a minute ago":a<3600?parseInt(a/60,10).toString()+" minutes ago":a<7200?"about an hour ago":a<86400?"about "+parseInt(a/3600,10).toString()+" hours ago":a<172800?"1 day ago":parseInt(a/86400,10).toString()+" days ago"}; </script> <script type="text/javascript" src="https://web.archive.org/web/20130115230838js_/http://api.twitter.com/1/statuses/user_timeline.json?include_rts=true&amp;screen_name=nacin&amp;count=4&amp;callback=twitterCallback2"></script></div> </aside> <aside id="stc-follow-3" class="widget widget_stc-follow"> <div id="stcFollow-nacin"></div> <script type="text/javascript"> twttr.anywhere(function (twitter) { twitter('#stcFollow-nacin').followButton('nacin') }); </script> </aside> </div><!-- #second .widget-area --> </div><!-- #supplementary --> <div id="site-generator"> <a href="https://web.archive.org/web/20130115230838/http://wordpress.org/" title="Semantic Personal Publishing Platform">Proudly powered by WordPress</a> </div> </footer><!-- #colophon --> </div><!-- #page --> <script type="text/javascript"> twttr.anywhere(function (T) { T.linkifyUsers(); }); </script> <script type="text/javascript" src="https://web.archive.org/web/20130115230838js_/http://platform.twitter.com/widgets.js"></script><script type="text/javascript" src="https://web.archive.org/web/20130115230838js_/http://nacin.com/wp-includes/js/jquery/jquery.js?ver=1.9.0b1"></script> <script type="text/javascript" src="https://web.archive.org/web/20130115230838js_/http://nacin.com/wp-includes/js/jquery/jquery-migrate.js?ver=1.0.0b1"></script> <script type="text/javascript" src="https://web.archive.org/web/20130115230838js_/http://s.gravatar.com/js/gprofiles.js?aa&amp;ver=3.6-alpha-23288"></script> <script type="text/javascript"> /* <![CDATA[ */ var WPGroHo = {"my_hash":""}; /* ]]> */ </script> <script type="text/javascript" src="https://web.archive.org/web/20130115230838js_/http://nacin.com/wp-content/plugins/jetpack/modules/wpgroho.js?ver=3.6-alpha-23288"></script> <div style="display:none"> </div> <link rel="stylesheet" id="embedly_font_end-css" href="https://web.archive.org/web/20130115230838cs_/http://nacin.com/wp-content/plugins/embedly/css/embedly-frontend.css?ver=3.6-alpha-23288" type="text/css" media="all"/> <script type="text/javascript" src="https://web.archive.org/web/20130115230838js_/http://s0.wp.com/wp-content/js/devicepx-jetpack.js?ver=201303"></script> <div id="fb-root"></div> <script type="text/javascript"> window.fbAsyncInit = function() { FB.init({"appId":"163662570313065","channelUrl":"https:\/\/web.archive.org\/web\/20130115230838\/http:\/\/nacin.com\/?sfc-channel-file=1","status":true,"cookie":true,"xfbml":true,"oauth":true}); }; (function(d){ var js, id = 'facebook-jssdk'; if (d.getElementById(id)) {return;} js = d.createElement('script'); js.id = id; js.async = true; js.src = "//web.archive.org/web/20130115230838/http://connect.facebook.net/en_US/all.js"; d.getElementsByTagName('head')[0].appendChild(js); }(document)); </script> <script src="https://web.archive.org/web/20130115230838js_/http://stats.wordpress.com/e-201303.js" type="text/javascript"></script> <script type="text/javascript"> st_go({v:'ext',j:'1:1.6.1',blog:'12547648',post:'0'}); var load_cmc = function(){linktracker_init(12547648,0,2);}; if ( typeof addLoadEvent != 'undefined' ) addLoadEvent(load_cmc); else load_cmc(); </script> </body> </html> <!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/ Page Caching using apc Object Caching 814/814 objects using apc Served from: nacin.com @ 2013-01-15 18:08:38 --><!-- FILE ARCHIVED ON 23:08:38 Jan 15, 2013 AND RETRIEVED FROM THE INTERNET ARCHIVE ON 05:43:22 Dec 04, 2024. JAVASCRIPT APPENDED BY WAYBACK MACHINE, COPYRIGHT INTERNET ARCHIVE. ALL OTHER CONTENT MAY ALSO BE PROTECTED BY COPYRIGHT (17 U.S.C. SECTION 108(a)(3)). --> <!-- playback timings (ms): captures_list: 0.512 exclusion.robots: 0.026 exclusion.robots.policy: 0.016 esindex: 0.01 cdx.remote: 16.057 LoadShardBlock: 78.757 (3) PetaboxLoader3.datanode: 86.699 (4) load_resource: 95.16 PetaboxLoader3.resolve: 50.866 -->

Pages: 1 2 3 4 5 6 7 8 9 10