CINXE.COM

Page templates in subdirectories, new in WordPress 3.4 | 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:80/2012/03/29/page-templates-in-subdirectories-new-in-wordpress-3-4/","20130130071049","https://web.archive.org/","web","/_static/", "1359529849"); </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>Page templates in subdirectories, new in WordPress 3.4 | 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/20130130071049cs_/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/20130130071049/http://nacin.com/feed/"/> <link rel="alternate" type="application/rss+xml" title="Nacin » Comments Feed" href="https://web.archive.org/web/20130130071049/http://nacin.com/comments/feed/"/> <link rel="alternate" type="application/rss+xml" title="Nacin » Page templates in subdirectories, new in WordPress 3.4 Comments Feed" href="https://web.archive.org/web/20130130071049/http://nacin.com/2012/03/29/page-templates-in-subdirectories-new-in-wordpress-3-4/feed/"/> <script type="text/javascript" src="https://web.archive.org/web/20130130071049js_/http://nacin.com/wp-includes/js/comment-reply.min.js?ver=3.6-alpha-23334"></script> <script type="text/javascript" src="https://web.archive.org/web/20130130071049js_/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"/> <link rel="prev" title="WordPress: So Easy a Congressman Can Do It" href="https://web.archive.org/web/20130130071049/http://nacin.com/2012/03/15/wordpress-so-easy-a-congressman-can-do-it/"/> <link rel="next" title="iPads in education" href="https://web.archive.org/web/20130130071049/http://nacin.com/2012/10/25/ipads-in-education/"/> <meta name="generator" content="WordPress 3.6-alpha-23334"/> <link rel="canonical" href="https://web.archive.org/web/20130130071049/http://nacin.com/2012/03/29/page-templates-in-subdirectories-new-in-wordpress-3-4/"/> <link rel="shortlink" href="https://web.archive.org/web/20130130071049/http://wp.me/pQEdq-12z"/> <meta property="og:type" content="article"/> <meta property="og:title" content="Page templates in subdirectories, new in WordPress 3.4"/> <meta property="og:url" content="https://web.archive.org/web/20130130071049/http://nacin.com/2012/03/29/page-templates-in-subdirectories-new-in-wordpress-3-4/"/> <meta property="og:description" content="In WordPress 3.4, themes can now place page templates inside a subdirectory of their theme. I've spent much of the 3.4 development cycle working on a new API called WP_Theme. But it's not something you'll find in the release announcement. That's because the vast majority of plugin and theme developers will never use it, nor should they. It'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 field guide.) It feels nice to be working with a modern, well-written API, even if I'm the only one using it. That's okay, because look how easy it was to add support for … <a href=&quot;http://nacin.com/2012/03/29/page-templates-in-subdirectories-new-in-wordpress-3-4/&quot;>Continue reading <span class=&quot;meta-nav&quot;>→</span></a>"/> <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/20130130071049im_/http://nacin.com/favicon.ico?2"/> <meta id="syntaxhighlighteranchor" name="syntaxhighlighter-version" content="3.1.3"/> </head> <body class="single single-post postid-4003 single-format-standard single-author singular 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/20130130071049/http://nacin.com/" title="Nacin" rel="home">Nacin</a></span></h1> <h2 id="site-description">WordPress Lead Developer</h2> </hgroup> <a href="https://web.archive.org/web/20130130071049/http://nacin.com/"> <img src="https://web.archive.org/web/20130130071049im_/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/20130130071049/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/20130130071049/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/20130130071049/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/20130130071049/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/20130130071049/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/20130130071049/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/20130130071049/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/20130130071049/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/20130130071049/http://wordpress.org/extend/plugins/simple-footnotes/">Simple&nbsp;Footnotes</a></li> </ul> </li> </ul></div> </nav><!-- #access --> </header><!-- #branding --> <div id="main"> <div id="primary"> <div id="content" role="main"> <nav id="nav-single"> <h3 class="assistive-text">Post navigation</h3> <span class="nav-previous"><a href="https://web.archive.org/web/20130130071049/http://nacin.com/2012/03/15/wordpress-so-easy-a-congressman-can-do-it/" rel="prev"><span class="meta-nav">&larr;</span> Previous</a></span> <span class="nav-next"><a href="https://web.archive.org/web/20130130071049/http://nacin.com/2012/10/25/ipads-in-education/" rel="next">Next <span class="meta-nav">&rarr;</span></a></span> </nav><!-- #nav-single --> <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">Page templates in subdirectories, new in WordPress&nbsp;3.4</h1> <div class="entry-meta"> <span class="sep">Posted on </span><a href="https://web.archive.org/web/20130130071049/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/20130130071049/http://nacin.com/author/nacin/" title="View all posts by Andrew Nacin" rel="author">Andrew Nacin</a></span></span> </div><!-- .entry-meta --> </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/20130130071049/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/20130130071049/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/20130130071049/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/20130130071049/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/20130130071049/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"> This entry was posted in and tagged <a href="https://web.archive.org/web/20130130071049/http://nacin.com/tag/page-templates/" rel="tag">page templates</a>, <a href="https://web.archive.org/web/20130130071049/http://nacin.com/tag/wordpress/" rel="tag">WordPress</a>, <a href="https://web.archive.org/web/20130130071049/http://nacin.com/tag/wordpress-3-4/" rel="tag">WordPress 3.4</a>, <a href="https://web.archive.org/web/20130130071049/http://nacin.com/tag/wp_theme/" rel="tag">WP_Theme</a> by <a href="https://web.archive.org/web/20130130071049/http://nacin.com/author/nacin/">Andrew Nacin</a>. Bookmark the <a href="https://web.archive.org/web/20130130071049/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">permalink</a>. </footer><!-- .entry-meta --> </article><!-- #post-4003 --> <div id="comments"> <h2 id="comments-title"> 84 thoughts on &ldquo;<span>Page templates in subdirectories, new in WordPress&nbsp;3.4</span>&rdquo; </h2> <ol class="commentlist"> <li class="comment even thread-even depth-1" id="li-comment-137775"> <article id="comment-137775" class="comment"> <footer class="comment-meta"> <div class="comment-author vcard"> <img alt="" src="https://web.archive.org/web/20130130071049im_/http://0.gravatar.com/avatar/8ab6d765ed3b8aec211f22d40454ece5?s=68&amp;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D68&amp;r=G" class="avatar avatar-68 photo" height="68" width="68"/><span class="fn"><a href="https://web.archive.org/web/20130130071049/http://wpsmith.net/" rel="external nofollow" class="url">Travis Smith</a></span> on <a href="https://web.archive.org/web/20130130071049/http://nacin.com/2012/03/29/page-templates-in-subdirectories-new-in-wordpress-3-4/#comment-137775"><time datetime="2012-03-29T12:57:01+00:00">March 29, 2012 at 12:57 pm</time></a> <span class="says">said:</span> </div><!-- .comment-author .vcard --> </footer> <div class="comment-content"><p>Nacin,</p> <p>Could there be a way to define the folder name (e.g. templates and not just page-templates) or whatever?</p> <p>Thanks,</p> </div> <div class="reply"> <a class="comment-reply-link" href="/web/20130130071049/http://nacin.com/2012/03/29/page-templates-in-subdirectories-new-in-wordpress-3-4/?replytocom=137775#respond" onclick="return addComment.moveForm(&quot;comment-137775&quot;, &quot;137775&quot;, &quot;respond&quot;, &quot;4003&quot;)">Reply <span>&darr;</span></a> </div><!-- .reply --> </article><!-- #comment-## --> <ul class="children"> <li class="comment byuser comment-author-koop odd alt depth-2" id="li-comment-137799"> <article id="comment-137799" class="comment"> <footer class="comment-meta"> <div class="comment-author vcard"> <img alt="" src="https://web.archive.org/web/20130130071049im_/http://0.gravatar.com/avatar/84e6e5080ee6af9e93464012cf084b8f?s=39&amp;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D39&amp;r=G" class="avatar avatar-39 photo" height="39" width="39"/><span class="fn"><a href="https://web.archive.org/web/20130130071049/http://darylkoop.com/" rel="external nofollow" class="url">Daryl Koopersmith</a></span> on <a href="https://web.archive.org/web/20130130071049/http://nacin.com/2012/03/29/page-templates-in-subdirectories-new-in-wordpress-3-4/#comment-137799"><time datetime="2012-03-29T14:04:34+00:00">March 29, 2012 at 2:04 pm</time></a> <span class="says">said:</span> </div><!-- .comment-author .vcard --> </footer> <div class="comment-content"><p>You actually don&#8217;t have to define a directory name — we now automatically detect any page template in the theme directory or direct subdirectory.</p> <p>So /my-page-template.php will work, as will /a-subdirectory/my-page-template.php, but not /two/subdirectories/my-page-template.php.</p> </div> <div class="reply"> <a class="comment-reply-link" href="/web/20130130071049/http://nacin.com/2012/03/29/page-templates-in-subdirectories-new-in-wordpress-3-4/?replytocom=137799#respond" onclick="return addComment.moveForm(&quot;comment-137799&quot;, &quot;137799&quot;, &quot;respond&quot;, &quot;4003&quot;)">Reply <span>&darr;</span></a> </div><!-- .reply --> </article><!-- #comment-## --> <ul class="children"> <li class="comment even depth-3" id="li-comment-137810"> <article id="comment-137810" class="comment"> <footer class="comment-meta"> <div class="comment-author vcard"> <img alt="" src="https://web.archive.org/web/20130130071049im_/http://0.gravatar.com/avatar/8ab6d765ed3b8aec211f22d40454ece5?s=39&amp;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D39&amp;r=G" class="avatar avatar-39 photo" height="39" width="39"/><span class="fn"><a href="https://web.archive.org/web/20130130071049/http://wpsmith.net/" rel="external nofollow" class="url">Travis Smith</a></span> on <a href="https://web.archive.org/web/20130130071049/http://nacin.com/2012/03/29/page-templates-in-subdirectories-new-in-wordpress-3-4/#comment-137810"><time datetime="2012-03-29T14:33:44+00:00">March 29, 2012 at 2:33 pm</time></a> <span class="says">said:</span> </div><!-- .comment-author .vcard --> </footer> <div class="comment-content"><p>So Nacin&#8217;s point then is if the parent theme defines the template folder as page-templates then the child theme must use page-templates or can they use their own?</p> <p>In other words, if a parent theme uses page-templates as their folder containing page-blog.php, page-archives.php and then a child theme adds templates (page-404.php, page-blog.php) to its page-templates folder, will this grab all of the templates with the child page-blog.php over-writing the parent? What if a child calls their templates folder templates (and not the parents&#8217; page-templates folder)?</p> </div> <div class="reply"> <a class="comment-reply-link" href="/web/20130130071049/http://nacin.com/2012/03/29/page-templates-in-subdirectories-new-in-wordpress-3-4/?replytocom=137810#respond" onclick="return addComment.moveForm(&quot;comment-137810&quot;, &quot;137810&quot;, &quot;respond&quot;, &quot;4003&quot;)">Reply <span>&darr;</span></a> </div><!-- .reply --> </article><!-- #comment-## --> <ul class="children"> <li class="comment byuser comment-author-nacin odd alt depth-4" id="li-comment-137821"> <article id="comment-137821" class="comment"> <footer class="comment-meta"> <div class="comment-author vcard"> <img alt="" src="https://web.archive.org/web/20130130071049im_/http://0.gravatar.com/avatar/01cfe9feaafb068590891bbd1f6a7f5a?s=39&amp;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D39&amp;r=G" class="avatar avatar-39 photo" height="39" width="39"/><span class="fn"><a href="https://web.archive.org/web/20130130071049/http://www.andrewnacin.com/" rel="external nofollow" class="url">Andrew Nacin</a></span> on <a href="https://web.archive.org/web/20130130071049/http://nacin.com/2012/03/29/page-templates-in-subdirectories-new-in-wordpress-3-4/#comment-137821"><time datetime="2012-03-29T15:03:30+00:00">March 29, 2012 at 3:03 pm</time></a> <span class="says">said:</span> </div><!-- .comment-author .vcard --> </footer> <div class="comment-content"><p>My point was only with regards to child theme inheritance and overriding of templates.</p> <p>A child theme can add as many page templates as it wants, in whatever directory. But if it wants to override a parent theme&#8217;s template, they need to match the directory structure for that template. page-404.php will not override a parent theme&#8217;s templates/page-404.php.</p> </div> <div class="reply"> <a class="comment-reply-link" href="/web/20130130071049/http://nacin.com/2012/03/29/page-templates-in-subdirectories-new-in-wordpress-3-4/?replytocom=137821#respond" onclick="return addComment.moveForm(&quot;comment-137821&quot;, &quot;137821&quot;, &quot;respond&quot;, &quot;4003&quot;)">Reply <span>&darr;</span></a> </div><!-- .reply --> </article><!-- #comment-## --> </li> </ul> </li> </ul> </li> </ul> </li> <li class="comment even thread-odd thread-alt depth-1" id="li-comment-137783"> <article id="comment-137783" class="comment"> <footer class="comment-meta"> <div class="comment-author vcard"> <img alt="" src="https://web.archive.org/web/20130130071049im_/http://1.gravatar.com/avatar/1448d087d72cfb8b32fdd72f881c03ad?s=68&amp;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D68&amp;r=G" class="avatar avatar-68 photo" height="68" width="68"/><span class="fn"><a href="https://web.archive.org/web/20130130071049/http://www.deluxeblogtips.com/" rel="external nofollow" class="url">Rilwis</a></span> on <a href="https://web.archive.org/web/20130130071049/http://nacin.com/2012/03/29/page-templates-in-subdirectories-new-in-wordpress-3-4/#comment-137783"><time datetime="2012-03-29T13:11:38+00:00">March 29, 2012 at 1:11 pm</time></a> <span class="says">said:</span> </div><!-- .comment-author .vcard --> </footer> <div class="comment-content"><p>I love this featured! I often use the <code>template_include</code> hook for custom template that put in subdirectories. In fact, using subdirectories make the theme folder clearer and keep it organized. I&#8217;m very excited about the theme API in v3.4.</p> </div> <div class="reply"> <a class="comment-reply-link" href="/web/20130130071049/http://nacin.com/2012/03/29/page-templates-in-subdirectories-new-in-wordpress-3-4/?replytocom=137783#respond" onclick="return addComment.moveForm(&quot;comment-137783&quot;, &quot;137783&quot;, &quot;respond&quot;, &quot;4003&quot;)">Reply <span>&darr;</span></a> </div><!-- .reply --> </article><!-- #comment-## --> </li> <li class="comment odd alt thread-even depth-1" id="li-comment-137808"> <article id="comment-137808" class="comment"> <footer class="comment-meta"> <div class="comment-author vcard"> <img alt="" src="https://web.archive.org/web/20130130071049im_/http://0.gravatar.com/avatar/620f088a0077f7d3f8fdd633a5bb60ee?s=68&amp;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D68&amp;r=G" class="avatar avatar-68 photo" height="68" width="68"/><span class="fn"><a href="https://web.archive.org/web/20130130071049/http://www.w3-edge.com/" rel="external nofollow" class="url">Frederick Townes</a></span> on <a href="https://web.archive.org/web/20130130071049/http://nacin.com/2012/03/29/page-templates-in-subdirectories-new-in-wordpress-3-4/#comment-137808"><time datetime="2012-03-29T14:28:09+00:00">March 29, 2012 at 2:28 pm</time></a> <span class="says">said:</span> </div><!-- .comment-author .vcard --> </footer> <div class="comment-content"><p>Having not yet investigated deeply, I&#8217;m curious how traversing directories like this impacts performance (I realize that scandir() runs optimally), however that&#8217;s quite a few additional stat calls depending on how one structures their theme no &#8211; especially considering that the entire tree must be inspected? What&#8217;s the thinking there?</p> </div> <div class="reply"> <a class="comment-reply-link" href="/web/20130130071049/http://nacin.com/2012/03/29/page-templates-in-subdirectories-new-in-wordpress-3-4/?replytocom=137808#respond" onclick="return addComment.moveForm(&quot;comment-137808&quot;, &quot;137808&quot;, &quot;respond&quot;, &quot;4003&quot;)">Reply <span>&darr;</span></a> </div><!-- .reply --> </article><!-- #comment-## --> <ul class="children"> <li class="comment byuser comment-author-nacin even depth-2" id="li-comment-137818"> <article id="comment-137818" class="comment"> <footer class="comment-meta"> <div class="comment-author vcard"> <img alt="" src="https://web.archive.org/web/20130130071049im_/http://0.gravatar.com/avatar/01cfe9feaafb068590891bbd1f6a7f5a?s=39&amp;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D39&amp;r=G" class="avatar avatar-39 photo" height="39" width="39"/><span class="fn"><a href="https://web.archive.org/web/20130130071049/http://www.andrewnacin.com/" rel="external nofollow" class="url">Andrew Nacin</a></span> on <a href="https://web.archive.org/web/20130130071049/http://nacin.com/2012/03/29/page-templates-in-subdirectories-new-in-wordpress-3-4/#comment-137818"><time datetime="2012-03-29T14:58:06+00:00">March 29, 2012 at 2:58 pm</time></a> <span class="says">said:</span> </div><!-- .comment-author .vcard --> </footer> <div class="comment-content"><p>Sure, it&#8217;s a performance hit, but a small one. get_page_templates() is only available and used in the admin, and it&#8217;s only found on a few particular pages, such as the Pages screen and when editing or saving a page.</p> <p>In 3.3, we did a full scan of all PHP and CSS files for all themes whenever we needed the page templates for a single theme. Now we&#8217;re just looking for PHP files in the one theme we&#8217;re requesting. So while it ends up adding a few stat calls to what trunk was two days ago, they end up being minuscule in comparison to 3.3 and even in comparison to a complicated theme hierarchy.</p> <p>To display a page template, we simply pull the data from postmeta and check if the file exists. That didn&#8217;t change here; so frontend performance is still optimal.</p> <p>Additionally, there&#8217;s a hidden feature in WP_Theme: it allows for persistent caching of theme data. It&#8217;s off by default because a file edited in FTP wouldn&#8217;t refresh the cache, but if a plugin such as W3 Total Cache wanted to support it as an option (especially for sites with many themes), oh man, it sings. It&#8217;s designed so pulling a theme from cache doesn&#8217;t result in a single filesystem operation.</p> <p>So, I&#8217;m glad you asked. <img src="https://web.archive.org/web/20130130071049im_/http://nacin.com/wp-includes/images/smilies/icon_smile.gif" alt=":-)" class="wp-smiley"/> </p> </div> <div class="reply"> <a class="comment-reply-link" href="/web/20130130071049/http://nacin.com/2012/03/29/page-templates-in-subdirectories-new-in-wordpress-3-4/?replytocom=137818#respond" onclick="return addComment.moveForm(&quot;comment-137818&quot;, &quot;137818&quot;, &quot;respond&quot;, &quot;4003&quot;)">Reply <span>&darr;</span></a> </div><!-- .reply --> </article><!-- #comment-## --> </li> </ul> </li> <li class="comment odd alt thread-odd thread-alt depth-1" id="li-comment-137809"> <article id="comment-137809" class="comment"> <footer class="comment-meta"> <div class="comment-author vcard"> <img alt="" src="https://web.archive.org/web/20130130071049im_/http://0.gravatar.com/avatar/6cf147a5459184fdd93a2328d03ebcb4?s=68&amp;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D68&amp;r=G" class="avatar avatar-68 photo" height="68" width="68"/><span class="fn"><a href="https://web.archive.org/web/20130130071049/http://tekartist.org/" rel="external nofollow" class="url">Stephane Daury (@stephdau)</a></span> on <a href="https://web.archive.org/web/20130130071049/http://nacin.com/2012/03/29/page-templates-in-subdirectories-new-in-wordpress-3-4/#comment-137809"><time datetime="2012-03-29T14:31:53+00:00">March 29, 2012 at 2:31 pm</time></a> <span class="says">said:</span> </div><!-- .comment-author .vcard --> </footer> <div class="comment-content"><p>The WP_Theme work should definitely have its place in the release announcement. IT&#8217;S AWESOME!</p> <p>Signed: a dude who saw first hand the size of the arrays it was dealing with before. <img src="https://web.archive.org/web/20130130071049im_/http://nacin.com/wp-includes/images/smilies/icon_wink.gif" alt=";)" class="wp-smiley"/> </p> </div> <div class="reply"> <a class="comment-reply-link" href="/web/20130130071049/http://nacin.com/2012/03/29/page-templates-in-subdirectories-new-in-wordpress-3-4/?replytocom=137809#respond" onclick="return addComment.moveForm(&quot;comment-137809&quot;, &quot;137809&quot;, &quot;respond&quot;, &quot;4003&quot;)">Reply <span>&darr;</span></a> </div><!-- .reply --> </article><!-- #comment-## --> <ul class="children"> <li class="comment byuser comment-author-nacin even depth-2" id="li-comment-137820"> <article id="comment-137820" class="comment"> <footer class="comment-meta"> <div class="comment-author vcard"> <img alt="" src="https://web.archive.org/web/20130130071049im_/http://0.gravatar.com/avatar/01cfe9feaafb068590891bbd1f6a7f5a?s=39&amp;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D39&amp;r=G" class="avatar avatar-39 photo" height="39" width="39"/><span class="fn"><a href="https://web.archive.org/web/20130130071049/http://www.andrewnacin.com/" rel="external nofollow" class="url">Andrew Nacin</a></span> on <a href="https://web.archive.org/web/20130130071049/http://nacin.com/2012/03/29/page-templates-in-subdirectories-new-in-wordpress-3-4/#comment-137820"><time datetime="2012-03-29T15:01:46+00:00">March 29, 2012 at 3:01 pm</time></a> <span class="says">said:</span> </div><!-- .comment-author .vcard --> </footer> <div class="comment-content"><p>Yep &#8212; In basic testing (serializing everything and measuring the length of the string), it dropped to about one-third of what it was in 3.3 (and one-fifth of what it was a few years ago). But that&#8217;s not really where it shines the most. There&#8217;s no need to load all themes into memory if all you need is a few. A single theme can now be fetched wp_get_theme(), and wp_get_themes() is will know to skip themes that aren&#8217;t allowed in multisite (unless you ask it otherwise). Suddenly themes.php on WP.com got a whole lot faster. <img src="https://web.archive.org/web/20130130071049im_/http://nacin.com/wp-includes/images/smilies/icon_smile.gif" alt=":-)" class="wp-smiley"/> </p> </div> <div class="reply"> <a class="comment-reply-link" href="/web/20130130071049/http://nacin.com/2012/03/29/page-templates-in-subdirectories-new-in-wordpress-3-4/?replytocom=137820#respond" onclick="return addComment.moveForm(&quot;comment-137820&quot;, &quot;137820&quot;, &quot;respond&quot;, &quot;4003&quot;)">Reply <span>&darr;</span></a> </div><!-- .reply --> </article><!-- #comment-## --> <ul class="children"> <li class="comment odd alt depth-3" id="li-comment-138302"> <article id="comment-138302" class="comment"> <footer class="comment-meta"> <div class="comment-author vcard"> <img alt="" src="https://web.archive.org/web/20130130071049im_/http://0.gravatar.com/avatar/6cf147a5459184fdd93a2328d03ebcb4?s=39&amp;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D39&amp;r=G" class="avatar avatar-39 photo" height="39" width="39"/><span class="fn"><a href="https://web.archive.org/web/20130130071049/http://tekartist.org/" rel="external nofollow" class="url">Stephane Daury (@stephdau)</a></span> on <a href="https://web.archive.org/web/20130130071049/http://nacin.com/2012/03/29/page-templates-in-subdirectories-new-in-wordpress-3-4/#comment-138302"><time datetime="2012-03-30T14:43:58+00:00">March 30, 2012 at 2:43 pm</time></a> <span class="says">said:</span> </div><!-- .comment-author .vcard --> </footer> <div class="comment-content"><p>Yup. <img src="https://web.archive.org/web/20130130071049im_/http://nacin.com/wp-includes/images/smilies/icon_smile.gif" alt=":)" class="wp-smiley"/> </p> </div> <div class="reply"> <a class="comment-reply-link" href="/web/20130130071049/http://nacin.com/2012/03/29/page-templates-in-subdirectories-new-in-wordpress-3-4/?replytocom=138302#respond" onclick="return addComment.moveForm(&quot;comment-138302&quot;, &quot;138302&quot;, &quot;respond&quot;, &quot;4003&quot;)">Reply <span>&darr;</span></a> </div><!-- .reply --> </article><!-- #comment-## --> </li> </ul> </li> </ul> </li> <li class="comment even thread-even depth-1" id="li-comment-137817"> <article id="comment-137817" class="comment"> <footer class="comment-meta"> <div class="comment-author vcard"> <img alt="" src="https://web.archive.org/web/20130130071049im_/http://1.gravatar.com/avatar/3cae6d344a9ff7973753c4be966ae9d5?s=68&amp;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D68&amp;r=G" class="avatar avatar-68 photo" height="68" width="68"/><span class="fn"><a href="https://web.archive.org/web/20130130071049/http://pointandstare.com/" rel="external nofollow" class="url">Lee Rickler</a></span> on <a href="https://web.archive.org/web/20130130071049/http://nacin.com/2012/03/29/page-templates-in-subdirectories-new-in-wordpress-3-4/#comment-137817"><time datetime="2012-03-29T14:56:13+00:00">March 29, 2012 at 2:56 pm</time></a> <span class="says">said:</span> </div><!-- .comment-author .vcard --> </footer> <div class="comment-content"><p>So how will this affect using get_template_directory_uri or get_template_part for example?</p> <p>Will these calls look in everything, regardless of level, after wp-content/themes/themename/</p> <p>Also, how will it affect, for example themename/sidebar-front.php or themename/templates/sidebar-front-two.php</p> <p>etc etc etc &#8230;</p> </div> <div class="reply"> <a class="comment-reply-link" href="/web/20130130071049/http://nacin.com/2012/03/29/page-templates-in-subdirectories-new-in-wordpress-3-4/?replytocom=137817#respond" onclick="return addComment.moveForm(&quot;comment-137817&quot;, &quot;137817&quot;, &quot;respond&quot;, &quot;4003&quot;)">Reply <span>&darr;</span></a> </div><!-- .reply --> </article><!-- #comment-## --> <ul class="children"> <li class="comment byuser comment-author-nacin odd alt depth-2" id="li-comment-137823"> <article id="comment-137823" class="comment"> <footer class="comment-meta"> <div class="comment-author vcard"> <img alt="" src="https://web.archive.org/web/20130130071049im_/http://0.gravatar.com/avatar/01cfe9feaafb068590891bbd1f6a7f5a?s=39&amp;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D39&amp;r=G" class="avatar avatar-39 photo" height="39" width="39"/><span class="fn"><a href="https://web.archive.org/web/20130130071049/http://www.andrewnacin.com/" rel="external nofollow" class="url">Andrew Nacin</a></span> on <a href="https://web.archive.org/web/20130130071049/http://nacin.com/2012/03/29/page-templates-in-subdirectories-new-in-wordpress-3-4/#comment-137823"><time datetime="2012-03-29T15:05:43+00:00">March 29, 2012 at 3:05 pm</time></a> <span class="says">said:</span> </div><!-- .comment-author .vcard --> </footer> <div class="comment-content"><p>get_template_part() only looks in the main root. This enhancement is just for &#8220;Page Templates,&#8221; which really would never be called by get_template_part().</p> <p>get_template_directory_uri() and get_stylesheet_directory_uri() will continue to return the URI to the root. If you need to access a directory, simply append it. For example, get_stylesheet_directory_uri() . &#8216;/images/sprite.png&#8217;.</p> </div> <div class="reply"> <a class="comment-reply-link" href="/web/20130130071049/http://nacin.com/2012/03/29/page-templates-in-subdirectories-new-in-wordpress-3-4/?replytocom=137823#respond" onclick="return addComment.moveForm(&quot;comment-137823&quot;, &quot;137823&quot;, &quot;respond&quot;, &quot;4003&quot;)">Reply <span>&darr;</span></a> </div><!-- .reply --> </article><!-- #comment-## --> </li> </ul> </li> <li class="comment even thread-odd thread-alt depth-1" id="li-comment-137824"> <article id="comment-137824" class="comment"> <footer class="comment-meta"> <div class="comment-author vcard"> <img alt="" src="https://web.archive.org/web/20130130071049im_/http://1.gravatar.com/avatar/b766a1cdaffe639508df2a34bea15d7f?s=68&amp;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D68&amp;r=G" class="avatar avatar-68 photo" height="68" width="68"/><span class="fn"><a href="https://web.archive.org/web/20130130071049/http://www.pagelines.com/" rel="external nofollow" class="url">Andrew Powers</a></span> on <a href="https://web.archive.org/web/20130130071049/http://nacin.com/2012/03/29/page-templates-in-subdirectories-new-in-wordpress-3-4/#comment-137824"><time datetime="2012-03-29T15:07:40+00:00">March 29, 2012 at 3:07 pm</time></a> <span class="says">said:</span> </div><!-- .comment-author .vcard --> </footer> <div class="comment-content"><p>Nice dude!</p> <p>Question: Why do templates need to be static files?<br/> Can&#8217;t we find a way to make templates pluggable?</p> <p>IMO This feature would be revolutionary in plugin and framework dev.</p> </div> <div class="reply"> <a class="comment-reply-link" href="/web/20130130071049/http://nacin.com/2012/03/29/page-templates-in-subdirectories-new-in-wordpress-3-4/?replytocom=137824#respond" onclick="return addComment.moveForm(&quot;comment-137824&quot;, &quot;137824&quot;, &quot;respond&quot;, &quot;4003&quot;)">Reply <span>&darr;</span></a> </div><!-- .reply --> </article><!-- #comment-## --> <ul class="children"> <li class="comment byuser comment-author-nacin odd alt depth-2" id="li-comment-137825"> <article id="comment-137825" class="comment"> <footer class="comment-meta"> <div class="comment-author vcard"> <img alt="" src="https://web.archive.org/web/20130130071049im_/http://0.gravatar.com/avatar/01cfe9feaafb068590891bbd1f6a7f5a?s=39&amp;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D39&amp;r=G" class="avatar avatar-39 photo" height="39" width="39"/><span class="fn"><a href="https://web.archive.org/web/20130130071049/http://www.andrewnacin.com/" rel="external nofollow" class="url">Andrew Nacin</a></span> on <a href="https://web.archive.org/web/20130130071049/http://nacin.com/2012/03/29/page-templates-in-subdirectories-new-in-wordpress-3-4/#comment-137825"><time datetime="2012-03-29T15:09:00+00:00">March 29, 2012 at 3:09 pm</time></a> <span class="says">said:</span> </div><!-- .comment-author .vcard --> </footer> <div class="comment-content"><p>We&#8217;ll get there. Now that we finally have the groundwork in place, I wouldn&#8217;t be surprised if this happens in 3.5.</p> </div> <div class="reply"> <a class="comment-reply-link" href="/web/20130130071049/http://nacin.com/2012/03/29/page-templates-in-subdirectories-new-in-wordpress-3-4/?replytocom=137825#respond" onclick="return addComment.moveForm(&quot;comment-137825&quot;, &quot;137825&quot;, &quot;respond&quot;, &quot;4003&quot;)">Reply <span>&darr;</span></a> </div><!-- .reply --> </article><!-- #comment-## --> <ul class="children"> <li class="comment even depth-3" id="li-comment-137828"> <article id="comment-137828" class="comment"> <footer class="comment-meta"> <div class="comment-author vcard"> <img alt="" src="https://web.archive.org/web/20130130071049im_/http://1.gravatar.com/avatar/b766a1cdaffe639508df2a34bea15d7f?s=39&amp;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D39&amp;r=G" class="avatar avatar-39 photo" height="39" width="39"/><span class="fn"><a href="https://web.archive.org/web/20130130071049/http://www.pagelines.com/" rel="external nofollow" class="url">Andrew Powers</a></span> on <a href="https://web.archive.org/web/20130130071049/http://nacin.com/2012/03/29/page-templates-in-subdirectories-new-in-wordpress-3-4/#comment-137828"><time datetime="2012-03-29T15:18:10+00:00">March 29, 2012 at 3:18 pm</time></a> <span class="says">said:</span> </div><!-- .comment-author .vcard --> </footer> <div class="comment-content"><p>The minute you build this into core I&#8217;m canceling my plans and spending a month building features for it lol</p> </div> <div class="reply"> <a class="comment-reply-link" href="/web/20130130071049/http://nacin.com/2012/03/29/page-templates-in-subdirectories-new-in-wordpress-3-4/?replytocom=137828#respond" onclick="return addComment.moveForm(&quot;comment-137828&quot;, &quot;137828&quot;, &quot;respond&quot;, &quot;4003&quot;)">Reply <span>&darr;</span></a> </div><!-- .reply --> </article><!-- #comment-## --> </li> </ul> </li> </ul> </li> <li class="comment odd alt thread-even depth-1" id="li-comment-137826"> <article id="comment-137826" class="comment"> <footer class="comment-meta"> <div class="comment-author vcard"> <img alt="" src="https://web.archive.org/web/20130130071049im_/http://1.gravatar.com/avatar/770fdbc790b31ed8556826b45cf2e766?s=68&amp;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D68&amp;r=G" class="avatar avatar-68 photo" height="68" width="68"/><span class="fn"><a href="https://web.archive.org/web/20130130071049/http://kevinjohngallagher.com/" rel="external nofollow" class="url">Kevinjohn Gallagher</a></span> on <a href="https://web.archive.org/web/20130130071049/http://nacin.com/2012/03/29/page-templates-in-subdirectories-new-in-wordpress-3-4/#comment-137826"><time datetime="2012-03-29T15:13:12+00:00">March 29, 2012 at 3:13 pm</time></a> <span class="says">said:</span> </div><!-- .comment-author .vcard --> </footer> <div class="comment-content"><p>Hi Andrew,</p> <p>First, well done on this, it can&#8217;t have been the smallest change you&#8217;ve ever made to the core.</p> <p>Probably too forward thinking at this stage, but have you tested it for nested get_template_part() loading and variables? I only ask because on our more &#8220;CMS-y&#8221; themes, we&#8217;ve all but gotten rid of get_template_part and now use the double hit:</p> <p>include( locate_template($template . &#8216;.php&#8217;) );</p> <p>The move allows us to loop inside loops for Custom Content Objects, not just Custom Post Types/Formats; something that played well into folders/sub-folders.</p> <p>Just a thought, and thanks for all your work.</p> <p>Kev</p> </div> <div class="reply"> <a class="comment-reply-link" href="/web/20130130071049/http://nacin.com/2012/03/29/page-templates-in-subdirectories-new-in-wordpress-3-4/?replytocom=137826#respond" onclick="return addComment.moveForm(&quot;comment-137826&quot;, &quot;137826&quot;, &quot;respond&quot;, &quot;4003&quot;)">Reply <span>&darr;</span></a> </div><!-- .reply --> </article><!-- #comment-## --> <ul class="children"> <li class="comment byuser comment-author-nacin even depth-2" id="li-comment-137832"> <article id="comment-137832" class="comment"> <footer class="comment-meta"> <div class="comment-author vcard"> <img alt="" src="https://web.archive.org/web/20130130071049im_/http://0.gravatar.com/avatar/01cfe9feaafb068590891bbd1f6a7f5a?s=39&amp;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D39&amp;r=G" class="avatar avatar-39 photo" height="39" width="39"/><span class="fn"><a href="https://web.archive.org/web/20130130071049/http://www.andrewnacin.com/" rel="external nofollow" class="url">Andrew Nacin</a></span> on <a href="https://web.archive.org/web/20130130071049/http://nacin.com/2012/03/29/page-templates-in-subdirectories-new-in-wordpress-3-4/#comment-137832"><time datetime="2012-03-29T15:25:07+00:00">March 29, 2012 at 3:25 pm</time></a> <span class="says">said:</span> </div><!-- .comment-author .vcard --> </footer> <div class="comment-content"><p>Hey Kev, thanks for stopping by. Unless I&#8217;m misunderstanding, there&#8217;s actually no difference between <code>get_template_part( $template )</code> and <code>include( locate_template( "$template.php" ) )</code>. get_template_part() does support subdirectory scanning with a slug like &#8220;content/single&#8221; (it&#8217;ll look in the content directory for single.php). The behavior was accidental, but we&#8217;re keeping it.</p> </div> <div class="reply"> <a class="comment-reply-link" href="/web/20130130071049/http://nacin.com/2012/03/29/page-templates-in-subdirectories-new-in-wordpress-3-4/?replytocom=137832#respond" onclick="return addComment.moveForm(&quot;comment-137832&quot;, &quot;137832&quot;, &quot;respond&quot;, &quot;4003&quot;)">Reply <span>&darr;</span></a> </div><!-- .reply --> </article><!-- #comment-## --> <ul class="children"> <li class="comment odd alt depth-3" id="li-comment-147717"> <article id="comment-147717" class="comment"> <footer class="comment-meta"> <div class="comment-author vcard"> <img alt="" src="https://web.archive.org/web/20130130071049im_/http://0.gravatar.com/avatar/cbf8d51cc480ffef3f3102c79750f3e4?s=39&amp;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D39&amp;r=G" class="avatar avatar-39 photo" height="39" width="39"/><span class="fn"><a href="https://web.archive.org/web/20130130071049/http://twitter.com/turtlepod" rel="external nofollow" class="url">david</a></span> on <a href="https://web.archive.org/web/20130130071049/http://nacin.com/2012/03/29/page-templates-in-subdirectories-new-in-wordpress-3-4/#comment-147717"><time datetime="2012-04-25T10:12:12+00:00">April 25, 2012 at 10:12 am</time></a> <span class="says">said:</span> </div><!-- .comment-author .vcard --> </footer> <div class="comment-content"><p>Are you sure you&#8217;re keeping that?</p> <p>Here&#8217;s from justin tadlock (<a href="https://web.archive.org/web/20130130071049/http://themehybrid.com/" rel="nofollow">http://themehybrid.com</a>) forum: </p> <p>Let&#8217;s look at another problem with using get_<br/> template_part() to load files in sub-folders. In<br/> particular, this is a problematic line of code<br/> (from the core code):<br/> <code><br/> do_action( "get_template_part_{$slug}", $slug,<br/> $name );</code><br/> What happens when that action hook is fired<br/> and you&#8217;re using this code in your theme?<br/> <code><br/> get_template_part('/sub-folder/file');</code><br/> You get a hook that looks like this:<br/> <code><br/> do_action( 'get_template_part_/sub-folder/file', '/<br/> sub-folder/file', null );</code><br/> Not a very usuable hook.</p> </div> <div class="reply"> <a class="comment-reply-link" href="/web/20130130071049/http://nacin.com/2012/03/29/page-templates-in-subdirectories-new-in-wordpress-3-4/?replytocom=147717#respond" onclick="return addComment.moveForm(&quot;comment-147717&quot;, &quot;147717&quot;, &quot;respond&quot;, &quot;4003&quot;)">Reply <span>&darr;</span></a> </div><!-- .reply --> </article><!-- #comment-## --> </li> </ul> </li> </ul> </li> <li class="comment even thread-odd thread-alt depth-1" id="li-comment-137836"> <article id="comment-137836" class="comment"> <footer class="comment-meta"> <div class="comment-author vcard"> <img alt="" src="https://web.archive.org/web/20130130071049im_/http://1.gravatar.com/avatar/dfd9ca8e4db813f8e5e5eebc944385d6?s=68&amp;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D68&amp;r=G" class="avatar avatar-68 photo" height="68" width="68"/><span class="fn"><a href="https://web.archive.org/web/20130130071049/http://badfunproductions.com/" rel="external nofollow" class="url">Ken Dirschl</a></span> on <a href="https://web.archive.org/web/20130130071049/http://nacin.com/2012/03/29/page-templates-in-subdirectories-new-in-wordpress-3-4/#comment-137836"><time datetime="2012-03-29T15:39:03+00:00">March 29, 2012 at 3:39 pm</time></a> <span class="says">said:</span> </div><!-- .comment-author .vcard --> </footer> <div class="comment-content"><p>this is great. I put headers, footers and sidebars into subdirectories but got stumped on page templates. Makes for a nice, clean structure.</p> </div> <div class="reply"> <a class="comment-reply-link" href="/web/20130130071049/http://nacin.com/2012/03/29/page-templates-in-subdirectories-new-in-wordpress-3-4/?replytocom=137836#respond" onclick="return addComment.moveForm(&quot;comment-137836&quot;, &quot;137836&quot;, &quot;respond&quot;, &quot;4003&quot;)">Reply <span>&darr;</span></a> </div><!-- .reply --> </article><!-- #comment-## --> </li> <li class="comment odd alt thread-even depth-1" id="li-comment-137882"> <article id="comment-137882" class="comment"> <footer class="comment-meta"> <div class="comment-author vcard"> <img alt="" src="https://web.archive.org/web/20130130071049im_/http://1.gravatar.com/avatar/5c59d04ceb10b7ce586524221d010b76?s=68&amp;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D68&amp;r=G" class="avatar avatar-68 photo" height="68" width="68"/><span class="fn"><a href="https://web.archive.org/web/20130130071049/http://justintadlock.com/" rel="external nofollow" class="url">Justin Tadlock</a></span> on <a href="https://web.archive.org/web/20130130071049/http://nacin.com/2012/03/29/page-templates-in-subdirectories-new-in-wordpress-3-4/#comment-137882"><time datetime="2012-03-29T17:48:06+00:00">March 29, 2012 at 5:48 pm</time></a> <span class="says">said:</span> </div><!-- .comment-author .vcard --> </footer> <div class="comment-content"><p>This is the one thing I&#8217;ve been waiting years for. The ability to have page templates in sub-directories has been the one hurdle I&#8217;ve needed to jump for some uber-cool theme development.</p> <p>As always, awesome work!</p> </div> <div class="reply"> <a class="comment-reply-link" href="/web/20130130071049/http://nacin.com/2012/03/29/page-templates-in-subdirectories-new-in-wordpress-3-4/?replytocom=137882#respond" onclick="return addComment.moveForm(&quot;comment-137882&quot;, &quot;137882&quot;, &quot;respond&quot;, &quot;4003&quot;)">Reply <span>&darr;</span></a> </div><!-- .reply --> </article><!-- #comment-## --> <ul class="children"> <li class="comment even depth-2" id="li-comment-137926"> <article id="comment-137926" class="comment"> <footer class="comment-meta"> <div class="comment-author vcard"> <img alt="" src="https://web.archive.org/web/20130130071049im_/http://0.gravatar.com/avatar/04e318141ccaf383e0fd32df3fca2c04?s=39&amp;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D39&amp;r=G" class="avatar avatar-39 photo" height="39" width="39"/><span class="fn"><a href="https://web.archive.org/web/20130130071049/http://wpsartbox.com/" rel="external nofollow" class="url">Brian Richards</a></span> on <a href="https://web.archive.org/web/20130130071049/http://nacin.com/2012/03/29/page-templates-in-subdirectories-new-in-wordpress-3-4/#comment-137926"><time datetime="2012-03-29T20:53:46+00:00">March 29, 2012 at 8:53 pm</time></a> <span class="says">said:</span> </div><!-- .comment-author .vcard --> </footer> <div class="comment-content"><p>Ditto! I had written a patch for this back at WC Philly, but never got around to cleaning it up enough to be merged into core. Happy to see it&#8217;s being handled more efficiently!</p> <p>Nacin, how opposed are you to looping through a second directory? Any concerns? I ask because I was specifically considering /includes/templates/&#8230; as everything else in the theme is meticulously sorted within a single /includes/ folder (e.g. /styles/, /scripts/, /functions/, /widgets/, etc.) and my goal with my patch was to eventually lump /templates/ in there with them. </p> <p>This is definitely a step in the right direction, if it only ever goes one level deep I know I&#8217;ll be happier than strictly top-level.</p> </div> <div class="reply"> <a class="comment-reply-link" href="/web/20130130071049/http://nacin.com/2012/03/29/page-templates-in-subdirectories-new-in-wordpress-3-4/?replytocom=137926#respond" onclick="return addComment.moveForm(&quot;comment-137926&quot;, &quot;137926&quot;, &quot;respond&quot;, &quot;4003&quot;)">Reply <span>&darr;</span></a> </div><!-- .reply --> </article><!-- #comment-## --> <ul class="children"> <li class="comment odd alt depth-3" id="li-comment-138005"> <article id="comment-138005" class="comment"> <footer class="comment-meta"> <div class="comment-author vcard"> <img alt="" src="https://web.archive.org/web/20130130071049im_/http://0.gravatar.com/avatar/e341eca9e1a85dcae7127044301b4363?s=39&amp;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D39&amp;r=G" class="avatar avatar-39 photo" height="39" width="39"/><span class="fn"><a href="https://web.archive.org/web/20130130071049/http://www.jaredatchison.com/" rel="external nofollow" class="url">Jared</a></span> on <a href="https://web.archive.org/web/20130130071049/http://nacin.com/2012/03/29/page-templates-in-subdirectories-new-in-wordpress-3-4/#comment-138005"><time datetime="2012-03-30T02:27:14+00:00">March 30, 2012 at 2:27 am</time></a> <span class="says">said:</span> </div><!-- .comment-author .vcard --> </footer> <div class="comment-content"><p>I do the same thing, except with a <code>lib</code> directory. Though at this point I&#8217;ll take 1 directory deep, should help keep things much cleaner moving forward with new projects.</p> <p>I for one welcome the recursive scanning overlords.</p> </div> <div class="reply"> <a class="comment-reply-link" href="/web/20130130071049/http://nacin.com/2012/03/29/page-templates-in-subdirectories-new-in-wordpress-3-4/?replytocom=138005#respond" onclick="return addComment.moveForm(&quot;comment-138005&quot;, &quot;138005&quot;, &quot;respond&quot;, &quot;4003&quot;)">Reply <span>&darr;</span></a> </div><!-- .reply --> </article><!-- #comment-## --> </li> </ul> </li> <li class="comment byuser comment-author-nacin even depth-2" id="li-comment-138301"> <article id="comment-138301" class="comment"> <footer class="comment-meta"> <div class="comment-author vcard"> <img alt="" src="https://web.archive.org/web/20130130071049im_/http://0.gravatar.com/avatar/01cfe9feaafb068590891bbd1f6a7f5a?s=39&amp;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D39&amp;r=G" class="avatar avatar-39 photo" height="39" width="39"/><span class="fn"><a href="https://web.archive.org/web/20130130071049/http://www.andrewnacin.com/" rel="external nofollow" class="url">Andrew Nacin</a></span> on <a href="https://web.archive.org/web/20130130071049/http://nacin.com/2012/03/29/page-templates-in-subdirectories-new-in-wordpress-3-4/#comment-138301"><time datetime="2012-03-30T14:43:42+00:00">March 30, 2012 at 2:43 pm</time></a> <span class="says">said:</span> </div><!-- .comment-author .vcard --> </footer> <div class="comment-content"><p>I doubt we&#8217;ll ever look into levels deeper than one, as the numbers of files we could potentially end up searching exponentially grows.</p> <p>A more interesting idea would be to allow templates to be registered by plugins. And, obviously, a theme could use that as well.</p> </div> <div class="reply"> <a class="comment-reply-link" href="/web/20130130071049/http://nacin.com/2012/03/29/page-templates-in-subdirectories-new-in-wordpress-3-4/?replytocom=138301#respond" onclick="return addComment.moveForm(&quot;comment-138301&quot;, &quot;138301&quot;, &quot;respond&quot;, &quot;4003&quot;)">Reply <span>&darr;</span></a> </div><!-- .reply --> </article><!-- #comment-## --> <ul class="children"> <li class="comment odd alt depth-3" id="li-comment-138305"> <article id="comment-138305" class="comment"> <footer class="comment-meta"> <div class="comment-author vcard"> <img alt="" src="https://web.archive.org/web/20130130071049im_/http://0.gravatar.com/avatar/8ab6d765ed3b8aec211f22d40454ece5?s=39&amp;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D39&amp;r=G" class="avatar avatar-39 photo" height="39" width="39"/><span class="fn"><a href="https://web.archive.org/web/20130130071049/http://wpsmith.net/" rel="external nofollow" class="url">Travis Smith</a></span> on <a href="https://web.archive.org/web/20130130071049/http://nacin.com/2012/03/29/page-templates-in-subdirectories-new-in-wordpress-3-4/#comment-138305"><time datetime="2012-03-30T14:47:36+00:00">March 30, 2012 at 2:47 pm</time></a> <span class="says">said:</span> </div><!-- .comment-author .vcard --> </footer> <div class="comment-content"><p>+1 to plugins being able to add page templates maybe through a filter!? I&#8217;ve been looking for that for some time now.</p> </div> <div class="reply"> <a class="comment-reply-link" href="/web/20130130071049/http://nacin.com/2012/03/29/page-templates-in-subdirectories-new-in-wordpress-3-4/?replytocom=138305#respond" onclick="return addComment.moveForm(&quot;comment-138305&quot;, &quot;138305&quot;, &quot;respond&quot;, &quot;4003&quot;)">Reply <span>&darr;</span></a> </div><!-- .reply --> </article><!-- #comment-## --> </li> <li class="comment even depth-3" id="li-comment-139464"> <article id="comment-139464" class="comment"> <footer class="comment-meta"> <div class="comment-author vcard"> <img alt="" src="https://web.archive.org/web/20130130071049im_/http://0.gravatar.com/avatar/450738fdfba6c6100585b7787b7c855e?s=39&amp;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D39&amp;r=G" class="avatar avatar-39 photo" height="39" width="39"/><span class="fn"><a href="https://web.archive.org/web/20130130071049/http://cssrockstar.com/" rel="external nofollow" class="url">matt</a></span> on <a href="https://web.archive.org/web/20130130071049/http://nacin.com/2012/03/29/page-templates-in-subdirectories-new-in-wordpress-3-4/#comment-139464"><time datetime="2012-04-02T16:22:16+00:00">April 2, 2012 at 4:22 pm</time></a> <span class="says">said:</span> </div><!-- .comment-author .vcard --> </footer> <div class="comment-content"><p>It would be so awesome if plugins could register page templates. Any chance for 3.4?</p> </div> <div class="reply"> <a class="comment-reply-link" href="/web/20130130071049/http://nacin.com/2012/03/29/page-templates-in-subdirectories-new-in-wordpress-3-4/?replytocom=139464#respond" onclick="return addComment.moveForm(&quot;comment-139464&quot;, &quot;139464&quot;, &quot;respond&quot;, &quot;4003&quot;)">Reply <span>&darr;</span></a> </div><!-- .reply --> </article><!-- #comment-## --> </li> <li class="comment odd alt depth-3" id="li-comment-222567"> <article id="comment-222567" class="comment"> <footer class="comment-meta"> <div class="comment-author vcard"> <img alt="" src="https://web.archive.org/web/20130130071049im_/http://1.gravatar.com/avatar/9a8b820b849c3f62c2bacdcf5752c4d3?s=39&amp;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D39&amp;r=G" class="avatar avatar-39 photo" height="39" width="39"/><span class="fn"><a href="https://web.archive.org/web/20130130071049/http://jlambe.be/" rel="external nofollow" class="url">Julien Lambé</a></span> on <a href="https://web.archive.org/web/20130130071049/http://nacin.com/2012/03/29/page-templates-in-subdirectories-new-in-wordpress-3-4/#comment-222567"><time datetime="2012-11-21T04:47:17+00:00">November 21, 2012 at 4:47 am</time></a> <span class="says">said:</span> </div><!-- .comment-author .vcard --> </footer> <div class="comment-content"><p>I&#8217;m building a WordPress framework for theme developers.<br/> A nice feature would be to open the WP_Theme class for extension and give a way to developers to define directories where WordPress could find/load template files so we can assigne them using the Page Attributes template feature and improve theme files organization.</p> </div> <div class="reply"> <a class="comment-reply-link" href="/web/20130130071049/http://nacin.com/2012/03/29/page-templates-in-subdirectories-new-in-wordpress-3-4/?replytocom=222567#respond" onclick="return addComment.moveForm(&quot;comment-222567&quot;, &quot;222567&quot;, &quot;respond&quot;, &quot;4003&quot;)">Reply <span>&darr;</span></a> </div><!-- .reply --> </article><!-- #comment-## --> </li> </ul> </li> </ul> </li> <li class="comment even thread-odd thread-alt depth-1" id="li-comment-137893"> <article id="comment-137893" class="comment"> <footer class="comment-meta"> <div class="comment-author vcard"> <img alt="" src="https://web.archive.org/web/20130130071049im_/http://0.gravatar.com/avatar/239a34b0d1ceb0acdd42b1657267a081?s=68&amp;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D68&amp;r=G" class="avatar avatar-68 photo" height="68" width="68"/><span class="fn"><a href="https://web.archive.org/web/20130130071049/http://themeid.com/" rel="external nofollow" class="url">Emil</a></span> on <a href="https://web.archive.org/web/20130130071049/http://nacin.com/2012/03/29/page-templates-in-subdirectories-new-in-wordpress-3-4/#comment-137893"><time datetime="2012-03-29T18:22:40+00:00">March 29, 2012 at 6:22 pm</time></a> <span class="says">said:</span> </div><!-- .comment-author .vcard --> </footer> <div class="comment-content"><p>Absolutely fantastic stuff!</p> <p>Cheers,<br/> Emil</p> </div> <div class="reply"> <a class="comment-reply-link" href="/web/20130130071049/http://nacin.com/2012/03/29/page-templates-in-subdirectories-new-in-wordpress-3-4/?replytocom=137893#respond" onclick="return addComment.moveForm(&quot;comment-137893&quot;, &quot;137893&quot;, &quot;respond&quot;, &quot;4003&quot;)">Reply <span>&darr;</span></a> </div><!-- .reply --> </article><!-- #comment-## --> </li> <li class="post pingback"> <p>Pingback: <a href="https://web.archive.org/web/20130130071049/http://jamesc.id.au/2012/03/page-templates-in-subdirectories-new-in-wordpress-3-4/" rel="external nofollow" class="url">Page templates in subdirectories, new in WordPress 3.4 | James Collins</a></p> </li> <li class="post pingback"> <p>Pingback: <a href="https://web.archive.org/web/20130130071049/http://garinungkadol.com/2012/theme-development-ahoy/" rel="external nofollow" class="url">Theme Development Ahoy! | garinungkadol</a></p> </li> <li class="comment odd alt thread-even depth-1" id="li-comment-138585"> <article id="comment-138585" class="comment"> <footer class="comment-meta"> <div class="comment-author vcard"> <img alt="" src="https://web.archive.org/web/20130130071049im_/http://0.gravatar.com/avatar/071438b18df87e84d964f6923085a331?s=68&amp;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D68&amp;r=G" class="avatar avatar-68 photo" height="68" width="68"/><span class="fn"><a href="https://web.archive.org/web/20130130071049/http://mcgarity.me/" rel="external nofollow" class="url">Matthew McGarity</a></span> on <a href="https://web.archive.org/web/20130130071049/http://nacin.com/2012/03/29/page-templates-in-subdirectories-new-in-wordpress-3-4/#comment-138585"><time datetime="2012-03-31T07:47:33+00:00">March 31, 2012 at 7:47 am</time></a> <span class="says">said:</span> </div><!-- .comment-author .vcard --> </footer> <div class="comment-content"><p>Interesting. So help me understand &#8212; is the only advantage of using a sub-directory for page templates is theme file *organization*? Or is there something else I&#8217;m missing, along the lines of laying groundwork for pluggable themes?</p> </div> <div class="reply"> <a class="comment-reply-link" href="/web/20130130071049/http://nacin.com/2012/03/29/page-templates-in-subdirectories-new-in-wordpress-3-4/?replytocom=138585#respond" onclick="return addComment.moveForm(&quot;comment-138585&quot;, &quot;138585&quot;, &quot;respond&quot;, &quot;4003&quot;)">Reply <span>&darr;</span></a> </div><!-- .reply --> </article><!-- #comment-## --> </li> <li class="post pingback"> <p>Pingback: <a href="https://web.archive.org/web/20130130071049/http://senlinonline.com/2012/03/31/basejump/" rel="external nofollow" class="url">Basejump - Senlin Online</a></p> </li> <li class="post pingback"> <p>Pingback: <a href="https://web.archive.org/web/20130130071049/http://www.ashrobbins.com/2012/04/1779/" rel="external nofollow" class="url">Ash Robbins</a></p> </li> <li class="post pingback"> <p>Pingback: <a href="https://web.archive.org/web/20130130071049/http://maxfoundry.com/blog/2012/04/02/this-week-in-wordpress-apr-2-2012/" rel="external nofollow" class="url">This Week In WordPress: Apr 2, 2012 | Max Foundry</a></p> </li> <li class="comment even thread-odd thread-alt depth-1" id="li-comment-140508"> <article id="comment-140508" class="comment"> <footer class="comment-meta"> <div class="comment-author vcard"> <img alt="" src="https://web.archive.org/web/20130130071049im_/http://0.gravatar.com/avatar/80755161dbbf631482ab83ca6b042ba8?s=68&amp;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D68&amp;r=G" class="avatar avatar-68 photo" height="68" width="68"/><span class="fn"><a href="https://web.archive.org/web/20130130071049/http://mynethome.net/blog" rel="external nofollow" class="url">Sayontan</a></span> on <a href="https://web.archive.org/web/20130130071049/http://nacin.com/2012/03/29/page-templates-in-subdirectories-new-in-wordpress-3-4/#comment-140508"><time datetime="2012-04-05T11:07:30+00:00">April 5, 2012 at 11:07 am</time></a> <span class="says">said:</span> </div><!-- .comment-author .vcard --> </footer> <div class="comment-content"><p>I am really glad this feature is now going to be in the core. One question: what happens to pages assigned to existing templates? E.g. If I have a page assigned to login-template.php, then I move login-template.php to a folder called templates, will the existing page switch over seamlessly?</p> </div> <div class="reply"> <a class="comment-reply-link" href="/web/20130130071049/http://nacin.com/2012/03/29/page-templates-in-subdirectories-new-in-wordpress-3-4/?replytocom=140508#respond" onclick="return addComment.moveForm(&quot;comment-140508&quot;, &quot;140508&quot;, &quot;respond&quot;, &quot;4003&quot;)">Reply <span>&darr;</span></a> </div><!-- .reply --> </article><!-- #comment-## --> <ul class="children"> <li class="comment odd alt depth-2" id="li-comment-158322"> <article id="comment-158322" class="comment"> <footer class="comment-meta"> <div class="comment-author vcard"> <img alt="" src="https://web.archive.org/web/20130130071049im_/http://0.gravatar.com/avatar/8e742ead17f84777d5e11ad8056df615?s=39&amp;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D39&amp;r=G" class="avatar avatar-39 photo" height="39" width="39"/><span class="fn"><a href="https://web.archive.org/web/20130130071049/http://www.facebook.com/profile.php?id=100003406043314" rel="external nofollow" class="url">Pathma</a></span> on <a href="https://web.archive.org/web/20130130071049/http://nacin.com/2012/03/29/page-templates-in-subdirectories-new-in-wordpress-3-4/#comment-158322"><time datetime="2012-05-27T23:02:43+00:00">May 27, 2012 at 11:02 pm</time></a> <span class="says">said:</span> </div><!-- .comment-author .vcard --> </footer> <div class="comment-content"><p>Outstanding! When something works, just recirofne it,right? Point out how well everything went when they chose a certain action and how if they choose that again they can have a similar result. but i dont understand why the viewpoint changed drastically.</p> </div> <div class="reply"> <a class="comment-reply-link" href="/web/20130130071049/http://nacin.com/2012/03/29/page-templates-in-subdirectories-new-in-wordpress-3-4/?replytocom=158322#respond" onclick="return addComment.moveForm(&quot;comment-158322&quot;, &quot;158322&quot;, &quot;respond&quot;, &quot;4003&quot;)">Reply <span>&darr;</span></a> </div><!-- .reply --> </article><!-- #comment-## --> </li> </ul> </li> <li class="post pingback"> <p>Pingback: <a href="https://web.archive.org/web/20130130071049/http://www.selfassemblysites.com/wordpress-3-4-preview/" rel="external nofollow" class="url">WordPress 3.4 Beta 1 Video Review - SelfAssemblySites</a></p> </li> <li class="post pingback"> <p>Pingback: <a href="https://web.archive.org/web/20130130071049/http://thisismyurl.com/7644/change-wordpress-theme-php/" rel="external nofollow" class="url">How to change a WordPress theme with PHP | thisismyurl.com</a></p> </li> <li class="post pingback"> <p>Pingback: <a href="https://web.archive.org/web/20130130071049/http://thisismyurl.com/7656/wordpress-34-theme-file-structures/" rel="external nofollow" class="url">WordPress 3.4 allows for better theme file structures | thisismyurl.com</a></p> </li> <li class="comment even thread-even depth-1" id="li-comment-149424"> <article id="comment-149424" class="comment"> <footer class="comment-meta"> <div class="comment-author vcard"> <img alt="" src="https://web.archive.org/web/20130130071049im_/http://1.gravatar.com/avatar/71cce4b88010a61658c3ad21f29eee08?s=68&amp;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D68&amp;r=G" class="avatar avatar-68 photo" height="68" width="68"/><span class="fn"><a href="https://web.archive.org/web/20130130071049/http://webcultured.com/" rel="external nofollow" class="url">Bart Dabek</a></span> on <a href="https://web.archive.org/web/20130130071049/http://nacin.com/2012/03/29/page-templates-in-subdirectories-new-in-wordpress-3-4/#comment-149424"><time datetime="2012-05-01T10:42:16+00:00">May 1, 2012 at 10:42 am</time></a> <span class="says">said:</span> </div><!-- .comment-author .vcard --> </footer> <div class="comment-content"><p>Does this only apply to pages?</p> <p>I just download 3.4b3, normal index.php in theme root.. I put single.php and page.php within a sub dir but those aren&#8217;t picked up&#8230; still seeing index.php showing.</p> </div> <div class="reply"> <a class="comment-reply-link" href="/web/20130130071049/http://nacin.com/2012/03/29/page-templates-in-subdirectories-new-in-wordpress-3-4/?replytocom=149424#respond" onclick="return addComment.moveForm(&quot;comment-149424&quot;, &quot;149424&quot;, &quot;respond&quot;, &quot;4003&quot;)">Reply <span>&darr;</span></a> </div><!-- .reply --> </article><!-- #comment-## --> <ul class="children"> <li class="comment odd alt depth-2" id="li-comment-149438"> <article id="comment-149438" class="comment"> <footer class="comment-meta"> <div class="comment-author vcard"> <img alt="" src="https://web.archive.org/web/20130130071049im_/http://0.gravatar.com/avatar/450738fdfba6c6100585b7787b7c855e?s=39&amp;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D39&amp;r=G" class="avatar avatar-39 photo" height="39" width="39"/><span class="fn"><a href="https://web.archive.org/web/20130130071049/http://cssrockstar.com/" rel="external nofollow" class="url">matt</a></span> on <a href="https://web.archive.org/web/20130130071049/http://nacin.com/2012/03/29/page-templates-in-subdirectories-new-in-wordpress-3-4/#comment-149438"><time datetime="2012-05-01T11:20:15+00:00">May 1, 2012 at 11:20 am</time></a> <span class="says">said:</span> </div><!-- .comment-author .vcard --> </footer> <div class="comment-content"><p>If I understand it correctly, it only works for page templates. See &#8220;Creating Your Own Page Templates&#8221; at <a href="https://web.archive.org/web/20130130071049/http://codex.wordpress.org/Pages" rel="nofollow">http://codex.wordpress.org/Pages</a>.</p> </div> <div class="reply"> <a class="comment-reply-link" href="/web/20130130071049/http://nacin.com/2012/03/29/page-templates-in-subdirectories-new-in-wordpress-3-4/?replytocom=149438#respond" onclick="return addComment.moveForm(&quot;comment-149438&quot;, &quot;149438&quot;, &quot;respond&quot;, &quot;4003&quot;)">Reply <span>&darr;</span></a> </div><!-- .reply --> </article><!-- #comment-## --> </li> <li class="comment even depth-2" id="li-comment-167210"> <article id="comment-167210" class="comment"> <footer class="comment-meta"> <div class="comment-author vcard"> <img alt="" src="https://web.archive.org/web/20130130071049im_/http://1.gravatar.com/avatar/de2509ccf71f24c3e5a338efe25af357?s=39&amp;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D39&amp;r=G" class="avatar avatar-39 photo" height="39" width="39"/><span class="fn"><a href="https://web.archive.org/web/20130130071049/http://seanbutze.com/" rel="external nofollow" class="url">Sean</a></span> on <a href="https://web.archive.org/web/20130130071049/http://nacin.com/2012/03/29/page-templates-in-subdirectories-new-in-wordpress-3-4/#comment-167210"><time datetime="2012-06-27T15:36:55+00:00">June 27, 2012 at 3:36 pm</time></a> <span class="says">said:</span> </div><!-- .comment-author .vcard --> </footer> <div class="comment-content"><p>I was also really hoping this would work. It would be great to be able to organize ALL page templates into a separate directory, including page.php, front-page.php, etc.</p> <p>Is there a chance for supporting this in future releases?</p> </div> <div class="reply"> <a class="comment-reply-link" href="/web/20130130071049/http://nacin.com/2012/03/29/page-templates-in-subdirectories-new-in-wordpress-3-4/?replytocom=167210#respond" onclick="return addComment.moveForm(&quot;comment-167210&quot;, &quot;167210&quot;, &quot;respond&quot;, &quot;4003&quot;)">Reply <span>&darr;</span></a> </div><!-- .reply --> </article><!-- #comment-## --> </li> </ul> </li> <li class="comment odd alt thread-odd thread-alt depth-1" id="li-comment-150717"> <article id="comment-150717" class="comment"> <footer class="comment-meta"> <div class="comment-author vcard"> <img alt="" src="https://web.archive.org/web/20130130071049im_/http://0.gravatar.com/avatar/eeb07fb3535696080914fb9cecab1d01?s=68&amp;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D68&amp;r=G" class="avatar avatar-68 photo" height="68" width="68"/><span class="fn">Michael</span> on <a href="https://web.archive.org/web/20130130071049/http://nacin.com/2012/03/29/page-templates-in-subdirectories-new-in-wordpress-3-4/#comment-150717"><time datetime="2012-05-05T15:27:01+00:00">May 5, 2012 at 3:27 pm</time></a> <span class="says">said:</span> </div><!-- .comment-author .vcard --> </footer> <div class="comment-content"><p>Hi Nancin,</p> <p>I&#8217;ve seen that you recommend the All In One SEO Pack Pro Plugin. Do you think it is necessary to run on a new blog?</p> <p>Thank you,<br/> Michael</p> </div> <div class="reply"> <a class="comment-reply-link" href="/web/20130130071049/http://nacin.com/2012/03/29/page-templates-in-subdirectories-new-in-wordpress-3-4/?replytocom=150717#respond" onclick="return addComment.moveForm(&quot;comment-150717&quot;, &quot;150717&quot;, &quot;respond&quot;, &quot;4003&quot;)">Reply <span>&darr;</span></a> </div><!-- .reply --> </article><!-- #comment-## --> <ul class="children"> <li class="comment even depth-2" id="li-comment-150776"> <article id="comment-150776" class="comment"> <footer class="comment-meta"> <div class="comment-author vcard"> <img alt="" src="https://web.archive.org/web/20130130071049im_/http://0.gravatar.com/avatar/620f088a0077f7d3f8fdd633a5bb60ee?s=39&amp;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D39&amp;r=G" class="avatar avatar-39 photo" height="39" width="39"/><span class="fn"><a href="https://web.archive.org/web/20130130071049/http://www.w3-edge.com/" rel="external nofollow" class="url">Frederick Townes</a></span> on <a href="https://web.archive.org/web/20130130071049/http://nacin.com/2012/03/29/page-templates-in-subdirectories-new-in-wordpress-3-4/#comment-150776"><time datetime="2012-05-05T19:10:48+00:00">May 5, 2012 at 7:10 pm</time></a> <span class="says">said:</span> </div><!-- .comment-author .vcard --> </footer> <div class="comment-content"><p>The best WP SEO plugin is WordPress SEO by Yoast. Every blog needs it just about as much as WordPress itself needs PHP.</p> <p><a href="https://web.archive.org/web/20130130071049/http://wordpress.org/extend/plugins/wordpress-seo/" rel="nofollow">http://wordpress.org/extend/plugins/wordpress-seo/</a></p> </div> <div class="reply"> <a class="comment-reply-link" href="/web/20130130071049/http://nacin.com/2012/03/29/page-templates-in-subdirectories-new-in-wordpress-3-4/?replytocom=150776#respond" onclick="return addComment.moveForm(&quot;comment-150776&quot;, &quot;150776&quot;, &quot;respond&quot;, &quot;4003&quot;)">Reply <span>&darr;</span></a> </div><!-- .reply --> </article><!-- #comment-## --> </li> </ul> </li> <li class="post pingback"> <p>Pingback: <a href="https://web.archive.org/web/20130130071049/http://personalfitnessbycharles.com/forum/main-forum/2461-chanel-ski-boots-preteen-fashion-models-lil-mel.html#post62632" rel="external nofollow" class="url">chanel ski boots - preteen fashion models lil mel - Forums</a></p> </li> <li class="comment odd alt thread-even depth-1" id="li-comment-157203"> <article id="comment-157203" class="comment"> <footer class="comment-meta"> <div class="comment-author vcard"> <img alt="" src="https://web.archive.org/web/20130130071049im_/http://1.gravatar.com/avatar/7c699f1225964f7bf7b3d138e81c934e?s=68&amp;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D68&amp;r=G" class="avatar avatar-68 photo" height="68" width="68"/><span class="fn"><a href="https://web.archive.org/web/20130130071049/http://turboqdowne-load.spacelloadebit.ru/?wkey=372688" rel="external nofollow" class="url">vaysasyav</a></span> on <a href="https://web.archive.org/web/20130130071049/http://nacin.com/2012/03/29/page-templates-in-subdirectories-new-in-wordpress-3-4/#comment-157203"><time datetime="2012-05-24T17:36:49+00:00">May 24, 2012 at 5:36 pm</time></a> <span class="says">said:</span> </div><!-- .comment-author .vcard --> </footer> <div class="comment-content"><p><a href="https://web.archive.org/web/20130130071049/http://downi-sharap-get.spacelloadebit.ru/?wkey=372688" rel="nofollow">jps карты скачать</a> &#8211; 100500 скачать на мобильный</p> </div> <div class="reply"> <a class="comment-reply-link" href="/web/20130130071049/http://nacin.com/2012/03/29/page-templates-in-subdirectories-new-in-wordpress-3-4/?replytocom=157203#respond" onclick="return addComment.moveForm(&quot;comment-157203&quot;, &quot;157203&quot;, &quot;respond&quot;, &quot;4003&quot;)">Reply <span>&darr;</span></a> </div><!-- .reply --> </article><!-- #comment-## --> </li> <li class="comment even thread-odd thread-alt depth-1" id="li-comment-159489"> <article id="comment-159489" class="comment"> <footer class="comment-meta"> <div class="comment-author vcard"> <img alt="" src="https://web.archive.org/web/20130130071049im_/http://1.gravatar.com/avatar/1da5b38f190ad3d790bc616cc702a8a3?s=68&amp;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D68&amp;r=G" class="avatar avatar-68 photo" height="68" width="68"/><span class="fn"><a href="https://web.archive.org/web/20130130071049/http://parkeastinc.com/" rel="external nofollow" class="url">Noel</a></span> on <a href="https://web.archive.org/web/20130130071049/http://nacin.com/2012/03/29/page-templates-in-subdirectories-new-in-wordpress-3-4/#comment-159489"><time datetime="2012-05-30T22:46:27+00:00">May 30, 2012 at 10:46 pm</time></a> <span class="says">said:</span> </div><!-- .comment-author .vcard --> </footer> <div class="comment-content"><p>Wow&#8230; so, how awesome is this because I&#8217;ve spent the last two days trying to get it to work. When is 3.4 releasing? <img src="https://web.archive.org/web/20130130071049im_/http://nacin.com/wp-includes/images/smilies/icon_smile.gif" alt=":)" class="wp-smiley"/> </p> <p>I agree with most of the other comments&#8230; I think this is definitely &#8220;new feature announcement&#8221; worthy! It&#8217;s going to revolutionize how organized we can be as developers out of the gate!</p> </div> <div class="reply"> <a class="comment-reply-link" href="/web/20130130071049/http://nacin.com/2012/03/29/page-templates-in-subdirectories-new-in-wordpress-3-4/?replytocom=159489#respond" onclick="return addComment.moveForm(&quot;comment-159489&quot;, &quot;159489&quot;, &quot;respond&quot;, &quot;4003&quot;)">Reply <span>&darr;</span></a> </div><!-- .reply --> </article><!-- #comment-## --> </li> <li class="comment odd alt thread-even depth-1" id="li-comment-163844"> <article id="comment-163844" class="comment"> <footer class="comment-meta"> <div class="comment-author vcard"> <img alt="" src="https://web.archive.org/web/20130130071049im_/http://1.gravatar.com/avatar/562c3c4e1210a1fbdb85532eed73ede6?s=68&amp;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D68&amp;r=G" class="avatar avatar-68 photo" height="68" width="68"/><span class="fn">Ivan</span> on <a href="https://web.archive.org/web/20130130071049/http://nacin.com/2012/03/29/page-templates-in-subdirectories-new-in-wordpress-3-4/#comment-163844"><time datetime="2012-06-13T21:46:25+00:00">June 13, 2012 at 9:46 pm</time></a> <span class="says">said:</span> </div><!-- .comment-author .vcard --> </footer> <div class="comment-content"><p>Hi, thank you for sharing knowledge <img src="https://web.archive.org/web/20130130071049im_/http://nacin.com/wp-includes/images/smilies/icon_smile.gif" alt=":)" class="wp-smiley"/> </p> <p>What about sidebars? I think it should be good idea to have also sidebars in separate folder, for example theme-root/sidebars/sidebar-right.php,theme-root/sidebars/sidebar-left.php,&#8230;</p> <p>Is it possible?</p> </div> <div class="reply"> <a class="comment-reply-link" href="/web/20130130071049/http://nacin.com/2012/03/29/page-templates-in-subdirectories-new-in-wordpress-3-4/?replytocom=163844#respond" onclick="return addComment.moveForm(&quot;comment-163844&quot;, &quot;163844&quot;, &quot;respond&quot;, &quot;4003&quot;)">Reply <span>&darr;</span></a> </div><!-- .reply --> </article><!-- #comment-## --> </li> <li class="comment even thread-odd thread-alt depth-1" id="li-comment-163878"> <article id="comment-163878" class="comment"> <footer class="comment-meta"> <div class="comment-author vcard"> <img alt="" src="https://web.archive.org/web/20130130071049im_/http://0.gravatar.com/avatar/acbfa0de1d87536d8b5483c028e1c68c?s=68&amp;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D68&amp;r=G" class="avatar avatar-68 photo" height="68" width="68"/><span class="fn"><a href="https://web.archive.org/web/20130130071049/http://andreaslagerkvist.com/" rel="external nofollow" class="url">Andreas L</a></span> on <a href="https://web.archive.org/web/20130130071049/http://nacin.com/2012/03/29/page-templates-in-subdirectories-new-in-wordpress-3-4/#comment-163878"><time datetime="2012-06-14T01:37:51+00:00">June 14, 2012 at 1:37 am</time></a> <span class="says">said:</span> </div><!-- .comment-author .vcard --> </footer> <div class="comment-content"><p>We upgraded to WP3.4 yesterday and now suddenly I am unable to select a custom page template from the &#8220;Page Attributes&#8221;-box on the right. The drop-down that used to be there is gone (I assume this is the behavior when WP can&#8217;t find any custom page templates?).</p> <p>If I click &#8220;Quick Edit&#8221; in the list, however, the &#8220;Template&#8221; drop-down is visible &#8211; but the only thing in it is &#8220;Default template&#8221; &#8211; none of the several custom page templates I had set up.</p> <p>What&#8217;s really weird is that pages already assigned to custom page templates still render with those templates &#8211; even though in &#8220;Quick Edit&#8221; it says &#8220;Default Template&#8221;.</p> <p>Is anyone else experiencing this problem? Do you know how to solve it? Is it a WP bug?</p> </div> <div class="reply"> <a class="comment-reply-link" href="/web/20130130071049/http://nacin.com/2012/03/29/page-templates-in-subdirectories-new-in-wordpress-3-4/?replytocom=163878#respond" onclick="return addComment.moveForm(&quot;comment-163878&quot;, &quot;163878&quot;, &quot;respond&quot;, &quot;4003&quot;)">Reply <span>&darr;</span></a> </div><!-- .reply --> </article><!-- #comment-## --> <ul class="children"> <li class="comment odd alt depth-2" id="li-comment-164043"> <article id="comment-164043" class="comment"> <footer class="comment-meta"> <div class="comment-author vcard"> <img alt="" src="https://web.archive.org/web/20130130071049im_/http://0.gravatar.com/avatar/acbfa0de1d87536d8b5483c028e1c68c?s=39&amp;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D39&amp;r=G" class="avatar avatar-39 photo" height="39" width="39"/><span class="fn"><a href="https://web.archive.org/web/20130130071049/http://andreaslagerkvist.com/" rel="external nofollow" class="url">Andreas L</a></span> on <a href="https://web.archive.org/web/20130130071049/http://nacin.com/2012/03/29/page-templates-in-subdirectories-new-in-wordpress-3-4/#comment-164043"><time datetime="2012-06-14T12:40:53+00:00">June 14, 2012 at 12:40 pm</time></a> <span class="says">said:</span> </div><!-- .comment-author .vcard --> </footer> <div class="comment-content"><p>Well we solved it. Apparently from version 3.4 you _have to_ put the Template Name-comment on its own line, like this:</p> <p>/*<br/> Template Name: MyTemplate<br/> */</p> <p>Whereas before you could do:</p> <p>/* Template Name: MyTemplate */</p> <p>Strange&#8230;</p> </div> <div class="reply"> <a class="comment-reply-link" href="/web/20130130071049/http://nacin.com/2012/03/29/page-templates-in-subdirectories-new-in-wordpress-3-4/?replytocom=164043#respond" onclick="return addComment.moveForm(&quot;comment-164043&quot;, &quot;164043&quot;, &quot;respond&quot;, &quot;4003&quot;)">Reply <span>&darr;</span></a> </div><!-- .reply --> </article><!-- #comment-## --> </li> </ul> </li> <li class="post pingback"> <p>Pingback: <a href="https://web.archive.org/web/20130130071049/http://www.feed99.com/2012/06/page-templates-disappeared-with-wordpress-3-4/" rel="external nofollow" class="url">Page templates disappeared with Wordpress 3.4</a></p> </li> <li class="post pingback"> <p>Pingback: <a href="https://web.archive.org/web/20130130071049/http://sina360.info/2012/06/what%e2%80%99s-new-in-wordpress-3-4smashing/" rel="external nofollow" class="url">What’s New in WordPress 3.4@smashing | seo博客大全</a></p> </li> <li class="post pingback"> <p>Pingback: <a href="https://web.archive.org/web/20130130071049/http://louisgianguyen.wordpress.com/2012/06/14/whats-new-in-wordpress-3-4/" rel="external nofollow" class="url">What’s New in WordPress 3.4 &laquo; Louis Gia Nguyen</a></p> </li> <li class="post pingback"> <p>Pingback: <a href="https://web.archive.org/web/20130130071049/http://myofflinetheme.com/whats-new-in-wordpress-3-4/" rel="external nofollow" class="url">What&#8217;s New in WordPress 3.4 | MyOfflineTheme.com Skyrocket Your Offline Business Just Now</a></p> </li> <li class="post pingback"> <p>Pingback: <a href="https://web.archive.org/web/20130130071049/http://digitalmofo.com/whats-new-in-wordpress-3-4/" rel="external nofollow" class="url">What&#8217;s New in WordPress 3.4 | DigitalMofo</a></p> </li> <li class="post pingback"> <p>Pingback: <a href="https://web.archive.org/web/20130130071049/http://eblade.tk/whats-new-in-wordpress-3-4/" rel="external nofollow" class="url">What&#8217;s New in WordPress 3.4 &raquo; E BLADE</a></p> </li> <li class="comment even thread-even depth-1" id="li-comment-164193"> <article id="comment-164193" class="comment"> <footer class="comment-meta"> <div class="comment-author vcard"> <img alt="" src="https://web.archive.org/web/20130130071049im_/http://1.gravatar.com/avatar/b707e07b7118c6e3a4186a02b30829bd?s=68&amp;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D68&amp;r=G" class="avatar avatar-68 photo" height="68" width="68"/><span class="fn"><a href="https://web.archive.org/web/20130130071049/http://banhawi.me/" rel="external nofollow" class="url">Banhawi</a></span> on <a href="https://web.archive.org/web/20130130071049/http://nacin.com/2012/03/29/page-templates-in-subdirectories-new-in-wordpress-3-4/#comment-164193"><time datetime="2012-06-14T21:13:29+00:00">June 14, 2012 at 9:13 pm</time></a> <span class="says">said:</span> </div><!-- .comment-author .vcard --> </footer> <div class="comment-content"><p>Great news, this a long waited functionality.</p> </div> <div class="reply"> <a class="comment-reply-link" href="/web/20130130071049/http://nacin.com/2012/03/29/page-templates-in-subdirectories-new-in-wordpress-3-4/?replytocom=164193#respond" onclick="return addComment.moveForm(&quot;comment-164193&quot;, &quot;164193&quot;, &quot;respond&quot;, &quot;4003&quot;)">Reply <span>&darr;</span></a> </div><!-- .reply --> </article><!-- #comment-## --> </li> <li class="post pingback"> <p>Pingback: <a href="https://web.archive.org/web/20130130071049/http://webdesignkingston.co.uk/2012/06/12/whats-new-in-wordpress-3-4/" rel="external nofollow" class="url">What&#8217;s New in WordPress 3.4 | Web Design Kingston</a></p> </li> <li class="post pingback"> <p>Pingback: <a href="https://web.archive.org/web/20130130071049/http://smturk.com/wordpress-3-4un-yenilikleri/" rel="external nofollow" class="url">WordPress 3.4 Yenilikleri | Smashing Magazine Türkiye</a></p> </li> <li class="post pingback"> <p>Pingback: <a href="https://web.archive.org/web/20130130071049/http://rutweb.com/whats-new-in-wordpress-3-4/" rel="external nofollow" class="url">Rutweb Technology : What&#8217;s New in WordPress 3.4</a></p> </li> <li class="post pingback"> <p>Pingback: <a href="https://web.archive.org/web/20130130071049/http://www.cs5design.com/blog/2012/06/17/whats-new-in-wordpress-3-4/" rel="external nofollow" class="url">What&#8217;s New in WordPress 3.4 | CS5 Design</a></p> </li> <li class="post pingback"> <p>Pingback: <a href="https://web.archive.org/web/20130130071049/http://stevedeguzman.com/whats-new-in-wordpress-3-4" rel="external nofollow" class="url">What&#8217;s New in WordPress 3.4 | Steve deGuzman</a></p> </li> <li class="comment odd alt thread-odd thread-alt depth-1" id="li-comment-165485"> <article id="comment-165485" class="comment"> <footer class="comment-meta"> <div class="comment-author vcard"> <img alt="" src="https://web.archive.org/web/20130130071049im_/http://0.gravatar.com/avatar/2742247057bbe635366f6820790ca5a8?s=68&amp;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D68&amp;r=G" class="avatar avatar-68 photo" height="68" width="68"/><span class="fn">Greenbrook</span> on <a href="https://web.archive.org/web/20130130071049/http://nacin.com/2012/03/29/page-templates-in-subdirectories-new-in-wordpress-3-4/#comment-165485"><time datetime="2012-06-20T05:09:47+00:00">June 20, 2012 at 5:09 am</time></a> <span class="says">said:</span> </div><!-- .comment-author .vcard --> </footer> <div class="comment-content"><p>Great work!</p> <p>Do you have an example on how to include the custom page template from a subfolder? When I try it breaks my options page, so I must be doing something wrong&#8230;</p> <p>Cheers</p> </div> <div class="reply"> <a class="comment-reply-link" href="/web/20130130071049/http://nacin.com/2012/03/29/page-templates-in-subdirectories-new-in-wordpress-3-4/?replytocom=165485#respond" onclick="return addComment.moveForm(&quot;comment-165485&quot;, &quot;165485&quot;, &quot;respond&quot;, &quot;4003&quot;)">Reply <span>&darr;</span></a> </div><!-- .reply --> </article><!-- #comment-## --> </li> <li class="post pingback"> <p>Pingback: <a href="https://web.archive.org/web/20130130071049/http://buypappa.com/blog/2012/06/21/whats-new-in-wordpress-3-4/" rel="external nofollow" class="url">What&#8217;s New in WordPress 3.4 | Buypappa blog</a></p> </li> <li class="post pingback"> <p>Pingback: <a href="https://web.archive.org/web/20130130071049/http://rehavapress.com/whats-new-in-wordpress-3-4" rel="external nofollow" class="url">What&#8217;s New in WordPress 3.4 - rehavaPress</a></p> </li> <li class="post pingback"> <p>Pingback: <a href="https://web.archive.org/web/20130130071049/http://www.mojowill.com/developer/wordpress-page-templates-in-sub-directories-new-in-wp3-4/" rel="external nofollow" class="url">Wordpress page templates in sub-directories, new in WP3.4</a></p> </li> <li class="comment even thread-even depth-1" id="li-comment-170942"> <article id="comment-170942" class="comment"> <footer class="comment-meta"> <div class="comment-author vcard"> <img alt="" src="https://web.archive.org/web/20130130071049im_/http://1.gravatar.com/avatar/7da7e692a095d1c0d8ac147d972a22c2?s=68&amp;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D68&amp;r=G" class="avatar avatar-68 photo" height="68" width="68"/><span class="fn"><a href="https://web.archive.org/web/20130130071049/http://worksbyjohn.co.uk/" rel="external nofollow" class="url">John Przeslakowski</a></span> on <a href="https://web.archive.org/web/20130130071049/http://nacin.com/2012/03/29/page-templates-in-subdirectories-new-in-wordpress-3-4/#comment-170942"><time datetime="2012-07-12T04:52:10+00:00">July 12, 2012 at 4:52 am</time></a> <span class="says">said:</span> </div><!-- .comment-author .vcard --> </footer> <div class="comment-content"><p>Hi Andrew,</p> <p>One of the features I love about WP is that I don&#8217;t have to write any conditional statements to assign the correct template to the content. So I often end up having things like page-contact.php and front-page.php in my themes, it&#8217;s a great time saver.</p> <p>I heard it&#8217;s possible to move those page templates in 3.4 to sub-directories, but no matter what I tried (dir name: /pages/ or /page-templates/, template file page-contact.php, contact.php) WordPress won&#8217;t include those templates automatically&#8230; Am I missing something here, or is this not implemented yet?</p> <p>For reference: <a href="https://web.archive.org/web/20130130071049/http://codex.wordpress.org/File:Template_Hierarchy.png?utm_source=wordpress-modguide" rel="nofollow">http://codex.wordpress.org/File:Template_Hierarchy.png?utm_source=wordpress-modguide</a></p> </div> <div class="reply"> <a class="comment-reply-link" href="/web/20130130071049/http://nacin.com/2012/03/29/page-templates-in-subdirectories-new-in-wordpress-3-4/?replytocom=170942#respond" onclick="return addComment.moveForm(&quot;comment-170942&quot;, &quot;170942&quot;, &quot;respond&quot;, &quot;4003&quot;)">Reply <span>&darr;</span></a> </div><!-- .reply --> </article><!-- #comment-## --> </li> <li class="comment odd alt thread-odd thread-alt depth-1" id="li-comment-170946"> <article id="comment-170946" class="comment"> <footer class="comment-meta"> <div class="comment-author vcard"> <img alt="" src="https://web.archive.org/web/20130130071049im_/http://0.gravatar.com/avatar/0bf6642090cae7d61a23001be08c9c9b?s=68&amp;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D68&amp;r=G" class="avatar avatar-68 photo" height="68" width="68"/><span class="fn"><a href="https://web.archive.org/web/20130130071049/http://nicolaelvin.com/" rel="external nofollow" class="url">Nicola Elvin</a></span> on <a href="https://web.archive.org/web/20130130071049/http://nacin.com/2012/03/29/page-templates-in-subdirectories-new-in-wordpress-3-4/#comment-170946"><time datetime="2012-07-12T05:14:45+00:00">July 12, 2012 at 5:14 am</time></a> <span class="says">said:</span> </div><!-- .comment-author .vcard --> </footer> <div class="comment-content"><p>This is brilliant but I have noticed a bug in that the body_class() misses a space between the classes and the page template name so instead of having I get they are missing a space.</p> </div> <div class="reply"> <a class="comment-reply-link" href="/web/20130130071049/http://nacin.com/2012/03/29/page-templates-in-subdirectories-new-in-wordpress-3-4/?replytocom=170946#respond" onclick="return addComment.moveForm(&quot;comment-170946&quot;, &quot;170946&quot;, &quot;respond&quot;, &quot;4003&quot;)">Reply <span>&darr;</span></a> </div><!-- .reply --> </article><!-- #comment-## --> </li> <li class="comment even thread-even depth-1" id="li-comment-170947"> <article id="comment-170947" class="comment"> <footer class="comment-meta"> <div class="comment-author vcard"> <img alt="" src="https://web.archive.org/web/20130130071049im_/http://0.gravatar.com/avatar/0bf6642090cae7d61a23001be08c9c9b?s=68&amp;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D68&amp;r=G" class="avatar avatar-68 photo" height="68" width="68"/><span class="fn"><a href="https://web.archive.org/web/20130130071049/http://nicolaelvin.com/" rel="external nofollow" class="url">Nicola Elvin</a></span> on <a href="https://web.archive.org/web/20130130071049/http://nacin.com/2012/03/29/page-templates-in-subdirectories-new-in-wordpress-3-4/#comment-170947"><time datetime="2012-07-12T05:15:38+00:00">July 12, 2012 at 5:15 am</time></a> <span class="says">said:</span> </div><!-- .comment-author .vcard --> </footer> <div class="comment-content"><p>It has stripped out the html so I&#8217;ll do it simply the class on the body outputs as &#8220;page-template-custom page-templates default-with-2-products-php&#8221; instead of &#8220;page-template-custompagetemplatesdefault-with-2-products-php&#8221; they are missing a space.</p> </div> <div class="reply"> <a class="comment-reply-link" href="/web/20130130071049/http://nacin.com/2012/03/29/page-templates-in-subdirectories-new-in-wordpress-3-4/?replytocom=170947#respond" onclick="return addComment.moveForm(&quot;comment-170947&quot;, &quot;170947&quot;, &quot;respond&quot;, &quot;4003&quot;)">Reply <span>&darr;</span></a> </div><!-- .reply --> </article><!-- #comment-## --> </li> <li class="post pingback"> <p>Pingback: <a href="https://web.archive.org/web/20130130071049/http://layout2html.com/coding/techniques/whats-new-in-wordpress-3-4/" rel="external nofollow" class="url">What’s New in WordPress 3.4 | Layout to HTML</a></p> </li> <li class="comment odd alt thread-odd thread-alt depth-1" id="li-comment-179538"> <article id="comment-179538" class="comment"> <footer class="comment-meta"> <div class="comment-author vcard"> <img alt="" src="https://web.archive.org/web/20130130071049im_/http://1.gravatar.com/avatar/7168dc164eea2b1cdc7f8fa1b8bf69f9?s=68&amp;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D68&amp;r=G" class="avatar avatar-68 photo" height="68" width="68"/><span class="fn">Evert</span> on <a href="https://web.archive.org/web/20130130071049/http://nacin.com/2012/03/29/page-templates-in-subdirectories-new-in-wordpress-3-4/#comment-179538"><time datetime="2012-08-03T08:07:19+00:00">August 3, 2012 at 8:07 am</time></a> <span class="says">said:</span> </div><!-- .comment-author .vcard --> </footer> <div class="comment-content"><p>Next step: being able to put template overrides in a subdirectory? I would kill for that! (e.g. archive-mytype.php and single-mytype.php) To keep different types organized.</p> </div> <div class="reply"> <a class="comment-reply-link" href="/web/20130130071049/http://nacin.com/2012/03/29/page-templates-in-subdirectories-new-in-wordpress-3-4/?replytocom=179538#respond" onclick="return addComment.moveForm(&quot;comment-179538&quot;, &quot;179538&quot;, &quot;respond&quot;, &quot;4003&quot;)">Reply <span>&darr;</span></a> </div><!-- .reply --> </article><!-- #comment-## --> <ul class="children"> <li class="comment even depth-2" id="li-comment-179542"> <article id="comment-179542" class="comment"> <footer class="comment-meta"> <div class="comment-author vcard"> <img alt="" src="https://web.archive.org/web/20130130071049im_/http://1.gravatar.com/avatar/de2509ccf71f24c3e5a338efe25af357?s=39&amp;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D39&amp;r=G" class="avatar avatar-39 photo" height="39" width="39"/><span class="fn"><a href="https://web.archive.org/web/20130130071049/http://seanbutze.com/" rel="external nofollow" class="url">Sean</a></span> on <a href="https://web.archive.org/web/20130130071049/http://nacin.com/2012/03/29/page-templates-in-subdirectories-new-in-wordpress-3-4/#comment-179542"><time datetime="2012-08-03T08:13:09+00:00">August 3, 2012 at 8:13 am</time></a> <span class="says">said:</span> </div><!-- .comment-author .vcard --> </footer> <div class="comment-content"><p>+1 Yes Yes Yes. When I first heard about this feature I mistakenly assumed that it applied to these default templates as well. I&#8217;m obsessed with keeping theme files organized and this would be a great next step. I don&#8217;t see why it shouldn&#8217;t be possible.</p> </div> <div class="reply"> <a class="comment-reply-link" href="/web/20130130071049/http://nacin.com/2012/03/29/page-templates-in-subdirectories-new-in-wordpress-3-4/?replytocom=179542#respond" onclick="return addComment.moveForm(&quot;comment-179542&quot;, &quot;179542&quot;, &quot;respond&quot;, &quot;4003&quot;)">Reply <span>&darr;</span></a> </div><!-- .reply --> </article><!-- #comment-## --> <ul class="children"> <li class="comment odd alt depth-3" id="li-comment-199864"> <article id="comment-199864" class="comment"> <footer class="comment-meta"> <div class="comment-author vcard"> <img alt="" src="https://web.archive.org/web/20130130071049im_/http://0.gravatar.com/avatar/80da9f79e2d79978130925702d4c6092?s=39&amp;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D39&amp;r=G" class="avatar avatar-39 photo" height="39" width="39"/><span class="fn"><a href="https://web.archive.org/web/20130130071049/http://www.cheekyboots.com/" rel="external nofollow" class="url">Emma McCreary</a></span> on <a href="https://web.archive.org/web/20130130071049/http://nacin.com/2012/03/29/page-templates-in-subdirectories-new-in-wordpress-3-4/#comment-199864"><time datetime="2012-09-24T18:51:43+00:00">September 24, 2012 at 6:51 pm</time></a> <span class="says">said:</span> </div><!-- .comment-author .vcard --> </footer> <div class="comment-content"><p>+1 for this &#8211; hate having a bunch of template files in my top level folder.</p> </div> <div class="reply"> <a class="comment-reply-link" href="/web/20130130071049/http://nacin.com/2012/03/29/page-templates-in-subdirectories-new-in-wordpress-3-4/?replytocom=199864#respond" onclick="return addComment.moveForm(&quot;comment-199864&quot;, &quot;199864&quot;, &quot;respond&quot;, &quot;4003&quot;)">Reply <span>&darr;</span></a> </div><!-- .reply --> </article><!-- #comment-## --> </li> </ul> </li> </ul> </li> <li class="comment even thread-even depth-1" id="li-comment-190592"> <article id="comment-190592" class="comment"> <footer class="comment-meta"> <div class="comment-author vcard"> <img alt="" src="https://web.archive.org/web/20130130071049im_/http://1.gravatar.com/avatar/31957ae015d415a157ee76413150dac6?s=68&amp;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D68&amp;r=G" class="avatar avatar-68 photo" height="68" width="68"/><span class="fn"><a href="https://web.archive.org/web/20130130071049/http://www.dijiplat.com/" rel="external nofollow" class="url">dijital pazarlama</a></span> on <a href="https://web.archive.org/web/20130130071049/http://nacin.com/2012/03/29/page-templates-in-subdirectories-new-in-wordpress-3-4/#comment-190592"><time datetime="2012-08-25T17:41:21+00:00">August 25, 2012 at 5:41 pm</time></a> <span class="says">said:</span> </div><!-- .comment-author .vcard --> </footer> <div class="comment-content"><p>long waited functionality.</p> </div> <div class="reply"> <a class="comment-reply-link" href="/web/20130130071049/http://nacin.com/2012/03/29/page-templates-in-subdirectories-new-in-wordpress-3-4/?replytocom=190592#respond" onclick="return addComment.moveForm(&quot;comment-190592&quot;, &quot;190592&quot;, &quot;respond&quot;, &quot;4003&quot;)">Reply <span>&darr;</span></a> </div><!-- .reply --> </article><!-- #comment-## --> </li> <li class="post pingback"> <p>Pingback: <a href="https://web.archive.org/web/20130130071049/http://wp-planet.net/news/lets-see-what-new-things-added-in-wordpress-3-4.xhtml" rel="external nofollow" class="url">What New Things Added In WordPress 3.4 | WordPress Planet</a></p> </li> <li class="comment odd alt thread-odd thread-alt depth-1" id="li-comment-202263"> <article id="comment-202263" class="comment"> <footer class="comment-meta"> <div class="comment-author vcard"> <img alt="" src="https://web.archive.org/web/20130130071049im_/http://0.gravatar.com/avatar/8f3eb94a0f8edaa2596ffabe68bdfaff?s=68&amp;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D68&amp;r=G" class="avatar avatar-68 photo" height="68" width="68"/><span class="fn"><a href="https://web.archive.org/web/20130130071049/http://https//www.facebook.com/publicidadecampinas" rel="external nofollow" class="url">design</a></span> on <a href="https://web.archive.org/web/20130130071049/http://nacin.com/2012/03/29/page-templates-in-subdirectories-new-in-wordpress-3-4/#comment-202263"><time datetime="2012-10-03T17:45:08+00:00">October 3, 2012 at 5:45 pm</time></a> <span class="says">said:</span> </div><!-- .comment-author .vcard --> </footer> <div class="comment-content"><p>Fantastic publish, very informative. I&#8217;m wondering why the opposite experts of this sector don&#8217;t realize this. You must continue your writing. I am confident, you&#8217;ve a huge readers&#8217; base already!|What&#8217;s Taking place i am new to this, I stumbled upon this I have found It positively helpful and it has aided me out loads. I am hoping to give a contribution &amp; aid other customers like its aided me. Great job.</p> </div> <div class="reply"> <a class="comment-reply-link" href="/web/20130130071049/http://nacin.com/2012/03/29/page-templates-in-subdirectories-new-in-wordpress-3-4/?replytocom=202263#respond" onclick="return addComment.moveForm(&quot;comment-202263&quot;, &quot;202263&quot;, &quot;respond&quot;, &quot;4003&quot;)">Reply <span>&darr;</span></a> </div><!-- .reply --> </article><!-- #comment-## --> </li> <li class="comment even thread-even depth-1" id="li-comment-206353"> <article id="comment-206353" class="comment"> <footer class="comment-meta"> <div class="comment-author vcard"> <img alt="" src="https://web.archive.org/web/20130130071049im_/http://1.gravatar.com/avatar/16be78ef8e097556770515d6cfad5289?s=68&amp;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D68&amp;r=G" class="avatar avatar-68 photo" height="68" width="68"/><span class="fn"><a href="https://web.archive.org/web/20130130071049/http://www.pixelhuset.dk/" rel="external nofollow" class="url">Peter Lauge</a></span> on <a href="https://web.archive.org/web/20130130071049/http://nacin.com/2012/03/29/page-templates-in-subdirectories-new-in-wordpress-3-4/#comment-206353"><time datetime="2012-10-16T09:42:02+00:00">October 16, 2012 at 9:42 am</time></a> <span class="says">said:</span> </div><!-- .comment-author .vcard --> </footer> <div class="comment-content"><p>Thank you guys!<br/> Normal include did not work for me, but this does:<br/> include( locate_template( &#8220;include_type_list.php&#8221; ) );</p> </div> <div class="reply"> <a class="comment-reply-link" href="/web/20130130071049/http://nacin.com/2012/03/29/page-templates-in-subdirectories-new-in-wordpress-3-4/?replytocom=206353#respond" onclick="return addComment.moveForm(&quot;comment-206353&quot;, &quot;206353&quot;, &quot;respond&quot;, &quot;4003&quot;)">Reply <span>&darr;</span></a> </div><!-- .reply --> </article><!-- #comment-## --> </li> <li class="comment odd alt thread-odd thread-alt depth-1" id="li-comment-213258"> <article id="comment-213258" class="comment"> <footer class="comment-meta"> <div class="comment-author vcard"> <img alt="" src="https://web.archive.org/web/20130130071049im_/http://0.gravatar.com/avatar/6af8482c7db54924a35d1148515b964f?s=68&amp;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D68&amp;r=G" class="avatar avatar-68 photo" height="68" width="68"/><span class="fn"><a href="https://web.archive.org/web/20130130071049/http://www.bluesdebut.com/" rel="external nofollow" class="url">chophouse</a></span> on <a href="https://web.archive.org/web/20130130071049/http://nacin.com/2012/03/29/page-templates-in-subdirectories-new-in-wordpress-3-4/#comment-213258"><time datetime="2012-11-01T00:44:56+00:00">November 1, 2012 at 12:44 am</time></a> <span class="says">said:</span> </div><!-- .comment-author .vcard --> </footer> <div class="comment-content"><p>I&#8217;m seeing the same behavior as noted by Andreas L on June 14, 2012 at 1:37 am &#8212; There is no place to select ANY template in the“Page Attributes”-box on the right. </p> <p>If I click “Quick Edit” in the list, however, the “Template” drop-down is visible – but the only thing in it is “Default template” – not my custom template. </p> <p>These are the first 5 lines of my page template file:</p> <p>How do I make the page template choices drop down appear on my New page screen?</p> <p>thanks,</p> </div> <div class="reply"> <a class="comment-reply-link" href="/web/20130130071049/http://nacin.com/2012/03/29/page-templates-in-subdirectories-new-in-wordpress-3-4/?replytocom=213258#respond" onclick="return addComment.moveForm(&quot;comment-213258&quot;, &quot;213258&quot;, &quot;respond&quot;, &quot;4003&quot;)">Reply <span>&darr;</span></a> </div><!-- .reply --> </article><!-- #comment-## --> </li> <li class="comment even thread-even depth-1" id="li-comment-213260"> <article id="comment-213260" class="comment"> <footer class="comment-meta"> <div class="comment-author vcard"> <img alt="" src="https://web.archive.org/web/20130130071049im_/http://0.gravatar.com/avatar/6af8482c7db54924a35d1148515b964f?s=68&amp;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D68&amp;r=G" class="avatar avatar-68 photo" height="68" width="68"/><span class="fn"><a href="https://web.archive.org/web/20130130071049/http://www.bluesdebut.com/" rel="external nofollow" class="url">chophouse</a></span> on <a href="https://web.archive.org/web/20130130071049/http://nacin.com/2012/03/29/page-templates-in-subdirectories-new-in-wordpress-3-4/#comment-213260"><time datetime="2012-11-01T00:49:52+00:00">November 1, 2012 at 12:49 am</time></a> <span class="says">said:</span> </div><!-- .comment-author .vcard --> </footer> <div class="comment-content"><p>First 5 didn&#8217;t post so I&#8217;ll try to explain:</p> <p>Line 1: is the opening php tag less than &#8211; question mark -php (no dashes)<br/> Line 2: /*<br/> Line 3: Template Name: BluesD_01<br/> Line 4: */<br/> Line 5: closing php tag question mark &#8211; greater than (no dashes)</p> </div> <div class="reply"> <a class="comment-reply-link" href="/web/20130130071049/http://nacin.com/2012/03/29/page-templates-in-subdirectories-new-in-wordpress-3-4/?replytocom=213260#respond" onclick="return addComment.moveForm(&quot;comment-213260&quot;, &quot;213260&quot;, &quot;respond&quot;, &quot;4003&quot;)">Reply <span>&darr;</span></a> </div><!-- .reply --> </article><!-- #comment-## --> </li> <li class="comment odd alt thread-odd thread-alt depth-1" id="li-comment-213604"> <article id="comment-213604" class="comment"> <footer class="comment-meta"> <div class="comment-author vcard"> <img alt="" src="https://web.archive.org/web/20130130071049im_/http://0.gravatar.com/avatar/6af8482c7db54924a35d1148515b964f?s=68&amp;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D68&amp;r=G" class="avatar avatar-68 photo" height="68" width="68"/><span class="fn"><a href="https://web.archive.org/web/20130130071049/http://www.bluesdebut.com/" rel="external nofollow" class="url">chophouse</a></span> on <a href="https://web.archive.org/web/20130130071049/http://nacin.com/2012/03/29/page-templates-in-subdirectories-new-in-wordpress-3-4/#comment-213604"><time datetime="2012-11-01T16:56:57+00:00">November 1, 2012 at 4:56 pm</time></a> <span class="says">said:</span> </div><!-- .comment-author .vcard --> </footer> <div class="comment-content"><p>Oh yeah WP version is 3.4.2</p> </div> <div class="reply"> <a class="comment-reply-link" href="/web/20130130071049/http://nacin.com/2012/03/29/page-templates-in-subdirectories-new-in-wordpress-3-4/?replytocom=213604#respond" onclick="return addComment.moveForm(&quot;comment-213604&quot;, &quot;213604&quot;, &quot;respond&quot;, &quot;4003&quot;)">Reply <span>&darr;</span></a> </div><!-- .reply --> </article><!-- #comment-## --> </li> <li class="comment even thread-even depth-1" id="li-comment-216837"> <article id="comment-216837" class="comment"> <footer class="comment-meta"> <div class="comment-author vcard"> <img alt="" src="https://web.archive.org/web/20130130071049im_/http://1.gravatar.com/avatar/f07c1458322e2174c0a7e506f2b1af32?s=68&amp;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D68&amp;r=G" class="avatar avatar-68 photo" height="68" width="68"/><span class="fn"><a href="https://web.archive.org/web/20130130071049/http://www.xtlhn.com/" rel="external nofollow" class="url">gengniu</a></span> on <a href="https://web.archive.org/web/20130130071049/http://nacin.com/2012/03/29/page-templates-in-subdirectories-new-in-wordpress-3-4/#comment-216837"><time datetime="2012-11-09T00:38:06+00:00">November 9, 2012 at 12:38 am</time></a> <span class="says">said:</span> </div><!-- .comment-author .vcard --> </footer> <div class="comment-content"><p>男士皮带是男士腰间的品位象征。</p> <p> 现代都市生活,似乎让男人承受的压力越来越大。从男人腰间的皮带上,就能体会到其忙碌的状态。他们总是挂着或别着手机、钥匙包,甚至打火机,这很容易使人联想到古人腰带上携挂着的弓、剑、砾石、算盘等。挂弓、剑等在古代是高地位的象征,也必然会受到别人的羡慕。可是在今天,如果一个男人再在腰上挂一大串东西的话,那么就显得没有品味没有内涵了。现实生活中,大多数男人也都会不以为然地在腰间挂一些东西,甚至还美其名曰是体现自己的身份,殊不知这样做,在别人眼里,尤其是在一些有品位有见识的女性眼里,这些举止看起来是多么俗气和没有档次。</p> <p> 一个成熟的男人是不会让自己的腰间挂满着细小东西的。他们会在腰间系上一条高雅的腰带,简单而干练,还能在一定程度上代表男人的身份、品味和个性。</p> <p> 男人该如何选择适合自己又彰显品位的皮带呢?<br/> 1.在皮带的选择上请千万保持低调。黑色、咖色或棕色的皮带配以钢质、金质或银质的皮带扣,既适合各种衣物和场合,又可以很好地表现职业男士的气质。不要轻易使用式样新奇的和配以巨大皮带扣的皮带。</p> <p> 2.要考虑皮带的装饰性,不要挂过多的物品。因为简洁、干练是男人的特征。</p> <p> 3.皮带的长度应介于第一和第二的裤扣之间,宽度应保持在3厘米。如果皮带太窄,会失去男性的阳刚之气;如果皮带太宽,则只适合于休闲、牛仔风格的装束。</p> <p> 总之,在时尚潮流中,一个注意风度形象的男人,总会在腰间这一细节上多花心思,而不是随意对待,让一些小饰物挡住皮带的光芒。</p> </div> <div class="reply"> <a class="comment-reply-link" href="/web/20130130071049/http://nacin.com/2012/03/29/page-templates-in-subdirectories-new-in-wordpress-3-4/?replytocom=216837#respond" onclick="return addComment.moveForm(&quot;comment-216837&quot;, &quot;216837&quot;, &quot;respond&quot;, &quot;4003&quot;)">Reply <span>&darr;</span></a> </div><!-- .reply --> </article><!-- #comment-## --> </li> <li class="comment odd alt thread-odd thread-alt depth-1" id="li-comment-218254"> <article id="comment-218254" class="comment"> <footer class="comment-meta"> <div class="comment-author vcard"> <img alt="" src="https://web.archive.org/web/20130130071049im_/http://0.gravatar.com/avatar/c71c818c9d1a5cafd93d2fedbc9dac05?s=68&amp;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D68&amp;r=G" class="avatar avatar-68 photo" height="68" width="68"/><span class="fn">rebellajones</span> on <a href="https://web.archive.org/web/20130130071049/http://nacin.com/2012/03/29/page-templates-in-subdirectories-new-in-wordpress-3-4/#comment-218254"><time datetime="2012-11-12T06:56:31+00:00">November 12, 2012 at 6:56 am</time></a> <span class="says">said:</span> </div><!-- .comment-author .vcard --> </footer> <div class="comment-content"><p>This information is quite nice and informative.<br/> <a href="https://web.archive.org/web/20130130071049/http://blustandard.com/" rel="nofollow">http://blustandard.com</a></p> </div> <div class="reply"> <a class="comment-reply-link" href="/web/20130130071049/http://nacin.com/2012/03/29/page-templates-in-subdirectories-new-in-wordpress-3-4/?replytocom=218254#respond" onclick="return addComment.moveForm(&quot;comment-218254&quot;, &quot;218254&quot;, &quot;respond&quot;, &quot;4003&quot;)">Reply <span>&darr;</span></a> </div><!-- .reply --> </article><!-- #comment-## --> </li> <li class="comment even thread-even depth-1" id="li-comment-247999"> <article id="comment-247999" class="comment"> <footer class="comment-meta"> <div class="comment-author vcard"> <img alt="" src="https://web.archive.org/web/20130130071049im_/http://1.gravatar.com/avatar/790733b8f5df1226b802673a625f3289?s=68&amp;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D68&amp;r=G" class="avatar avatar-68 photo" height="68" width="68"/><span class="fn"><a href="https://web.archive.org/web/20130130071049/http://sirblue.com/" rel="external nofollow" class="url">Romulo De Lazzari</a></span> on <a href="https://web.archive.org/web/20130130071049/http://nacin.com/2012/03/29/page-templates-in-subdirectories-new-in-wordpress-3-4/#comment-247999"><time datetime="2012-12-19T10:12:54+00:00">December 19, 2012 at 10:12 am</time></a> <span class="says">said:</span> </div><!-- .comment-author .vcard --> </footer> <div class="comment-content"><p>Hi Nacin,</p> <p>Before the WP_Theme class (as is implemented outside the wp-admin), I could add filters to get_template_directory() and similar functions to make WP search for a custom folder for pages and page templates, whereas using this new implementation, I saw that is impossible to add custom folders (filters or override methods), it only searches at one level down into the stylesheet folder.</p> <p>Is there any way to make it search into a custom folder for pages/page_templates other that the theme stylesheet + 1 level deep using the WP_Theme class?</p> <p>Thanks<br/> Romulo</p> </div> <div class="reply"> <a class="comment-reply-link" href="/web/20130130071049/http://nacin.com/2012/03/29/page-templates-in-subdirectories-new-in-wordpress-3-4/?replytocom=247999#respond" onclick="return addComment.moveForm(&quot;comment-247999&quot;, &quot;247999&quot;, &quot;respond&quot;, &quot;4003&quot;)">Reply <span>&darr;</span></a> </div><!-- .reply --> </article><!-- #comment-## --> <ul class="children"> <li class="comment odd alt depth-2" id="li-comment-248003"> <article id="comment-248003" class="comment"> <footer class="comment-meta"> <div class="comment-author vcard"> <img alt="" src="https://web.archive.org/web/20130130071049im_/http://1.gravatar.com/avatar/9a8b820b849c3f62c2bacdcf5752c4d3?s=39&amp;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D39&amp;r=G" class="avatar avatar-39 photo" height="39" width="39"/><span class="fn"><a href="https://web.archive.org/web/20130130071049/http://jlambe.be/" rel="external nofollow" class="url">Julien Lambé</a></span> on <a href="https://web.archive.org/web/20130130071049/http://nacin.com/2012/03/29/page-templates-in-subdirectories-new-in-wordpress-3-4/#comment-248003"><time datetime="2012-12-19T10:22:17+00:00">December 19, 2012 at 10:22 am</time></a> <span class="says">said:</span> </div><!-- .comment-author .vcard --> </footer> <div class="comment-content"><p>Hi,</p> <p>I was also looking for a solution about defining directories where to load Template pages&#8230; but out of luck until now. Btw, which filter did you use with &#8220;get_template_directory&#8221; in order to define a custom folder inside your theme ?</p> <p>Thanks</p> </div> <div class="reply"> <a class="comment-reply-link" href="/web/20130130071049/http://nacin.com/2012/03/29/page-templates-in-subdirectories-new-in-wordpress-3-4/?replytocom=248003#respond" onclick="return addComment.moveForm(&quot;comment-248003&quot;, &quot;248003&quot;, &quot;respond&quot;, &quot;4003&quot;)">Reply <span>&darr;</span></a> </div><!-- .reply --> </article><!-- #comment-## --> </li> </ul> </li> <li class="comment even thread-odd thread-alt depth-1" id="li-comment-286792"> <article id="comment-286792" class="comment"> <footer class="comment-meta"> <div class="comment-author vcard"> <img alt="" src="https://web.archive.org/web/20130130071049im_/http://0.gravatar.com/avatar/eaadef596798523f374f548ac8fefa5c?s=68&amp;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D68&amp;r=G" class="avatar avatar-68 photo" height="68" width="68"/><span class="fn"><a href="https://web.archive.org/web/20130130071049/http://www.aligultekin.com.tr/" rel="external nofollow" class="url">Ali Gültekin</a></span> on <a href="https://web.archive.org/web/20130130071049/http://nacin.com/2012/03/29/page-templates-in-subdirectories-new-in-wordpress-3-4/#comment-286792"><time datetime="2013-01-25T11:20:01+00:00">January 25, 2013 at 11:20 am</time></a> <span class="says">said:</span> </div><!-- .comment-author .vcard --> </footer> <div class="comment-content"><p>Thanks <img src="https://web.archive.org/web/20130130071049im_/http://nacin.com/wp-includes/images/smilies/icon_smile.gif" alt=":)" class="wp-smiley"/> </p> </div> <div class="reply"> <a class="comment-reply-link" href="/web/20130130071049/http://nacin.com/2012/03/29/page-templates-in-subdirectories-new-in-wordpress-3-4/?replytocom=286792#respond" onclick="return addComment.moveForm(&quot;comment-286792&quot;, &quot;286792&quot;, &quot;respond&quot;, &quot;4003&quot;)">Reply <span>&darr;</span></a> </div><!-- .reply --> </article><!-- #comment-## --> </li> </ol> <div id="respond"> <h3 id="reply-title">Leave a Reply <small><a rel="nofollow" id="cancel-comment-reply-link" href="/web/20130130071049/http://nacin.com/2012/03/29/page-templates-in-subdirectories-new-in-wordpress-3-4/#respond" style="display:none;">Cancel reply</a></small></h3> <form action="https://web.archive.org/web/20130130071049/http://nacin.com/wp-comments-post.php" method="post" id="commentform"> <p class="comment-notes">Your email address will not be published. Required fields are marked <span class="required">*</span></p> <p class="comment-form-author"><label for="author">Name <span class="required">*</span></label> <input id="author" name="author" type="text" value="" size="30" aria-required="true"/></p> <p class="comment-form-email"><label for="email">Email <span class="required">*</span></label> <input id="email" name="email" type="text" value="" size="30" aria-required="true"/></p> <p class="comment-form-url"><label for="url">Website</label><input id="url" name="url" type="text" value="" size="30"/></p> <p class="comment-form-comment"><label for="comment">Comment</label><textarea id="comment" name="comment" cols="45" rows="8" aria-required="true"></textarea></p> <p class="form-allowed-tags">You may use these <abbr title="HyperText Markup Language">HTML</abbr> tags and attributes: <code>&lt;a href=&quot;&quot; title=&quot;&quot;&gt; &lt;abbr title=&quot;&quot;&gt; &lt;acronym title=&quot;&quot;&gt; &lt;b&gt; &lt;blockquote cite=&quot;&quot;&gt; &lt;cite&gt; &lt;code&gt; &lt;del datetime=&quot;&quot;&gt; &lt;em&gt; &lt;i&gt; &lt;q cite=&quot;&quot;&gt; &lt;strike&gt; &lt;strong&gt; </code></p> <p class="form-submit"> <input name="submit" type="submit" id="submit" value="Post Comment"/> <input type="hidden" name="comment_post_ID" value="4003" id="comment_post_ID"/> <input type="hidden" name="comment_parent" id="comment_parent" value="0"/> </p> <p style="display: none;"><input type="hidden" id="akismet_comment_nonce" name="akismet_comment_nonce" value="e4d551743c"/></p><p class="comment-subscription-form"><input type="checkbox" name="subscribe_comments" id="subscribe_comments" value="subscribe" style="width: auto; -moz-appearance: checkbox; -webkit-appearance: checkbox;"/> <label class="subscribe-label" id="subscribe-label" for="subscribe_comments">Notify me of follow-up comments by email.</label></p><p class="comment-subscription-form"><input type="checkbox" name="subscribe_blog" id="subscribe_blog" value="subscribe" style="width: auto; -moz-appearance: checkbox; -webkit-appearance: checkbox;"/> <label class="subscribe-label" id="subscribe-blog-label" for="subscribe_blog">Notify me of new posts by email.</label></p> </form> </div><!-- #respond --> </div><!-- #comments --> </div><!-- #content --> </div><!-- #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/20130130071049im_/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/20130130071049/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/20130130071049/http://twitter.com/nacin">@nacin on Twitter</a></li> <li><a href="https://web.archive.org/web/20130130071049/http://ohloh.net/accounts/nacin">on Ohloh</a></li> <li><a href="https://web.archive.org/web/20130130071049/http://gravatar.com/nacin">on Gravatar</a></li> <li><a href="https://web.archive.org/web/20130130071049/http://about.me/nacin">on about.me</a></li> <li><a href="/web/20130130071049/http://nacin.com/contact/">Contact me directly</a></li> <li><a href="/web/20130130071049/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/20130130071049/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/20130130071049/http://core.trac.wordpress.org/">WordPress Trac</a></li> <li><a href="https://web.archive.org/web/20130130071049/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/20130130071049/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/20130130071049/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/20130130071049js_/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/20130130071049/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/20130130071049js_/http://platform.twitter.com/widgets.js"></script><script type="text/javascript" src="https://web.archive.org/web/20130130071049js_/http://nacin.com/wp-includes/js/jquery/jquery.js?ver=1.9.0"></script> <script type="text/javascript" src="https://web.archive.org/web/20130130071049js_/http://nacin.com/wp-includes/js/jquery/jquery-migrate.js?ver=1.0.0"></script> <script type="text/javascript" src="https://web.archive.org/web/20130130071049js_/http://s.gravatar.com/js/gprofiles.js?aa&amp;ver=3.6-alpha-23334"></script> <script type="text/javascript"> /* <![CDATA[ */ var WPGroHo = {"my_hash":""}; /* ]]> */ </script> <script type="text/javascript" src="https://web.archive.org/web/20130130071049js_/http://nacin.com/wp-content/plugins/jetpack/modules/wpgroho.js?ver=3.6-alpha-23334"></script> <div style="display:none"> <div class="grofile-hash-map-8ab6d765ed3b8aec211f22d40454ece5"> </div> <div class="grofile-hash-map-84e6e5080ee6af9e93464012cf084b8f"> </div> <div class="grofile-hash-map-01cfe9feaafb068590891bbd1f6a7f5a"> </div> <div class="grofile-hash-map-1448d087d72cfb8b32fdd72f881c03ad"> </div> <div class="grofile-hash-map-620f088a0077f7d3f8fdd633a5bb60ee"> </div> <div class="grofile-hash-map-6cf147a5459184fdd93a2328d03ebcb4"> </div> <div class="grofile-hash-map-3cae6d344a9ff7973753c4be966ae9d5"> </div> <div class="grofile-hash-map-b766a1cdaffe639508df2a34bea15d7f"> </div> <div class="grofile-hash-map-770fdbc790b31ed8556826b45cf2e766"> </div> <div class="grofile-hash-map-cbf8d51cc480ffef3f3102c79750f3e4"> </div> <div class="grofile-hash-map-dfd9ca8e4db813f8e5e5eebc944385d6"> </div> <div class="grofile-hash-map-5c59d04ceb10b7ce586524221d010b76"> </div> <div class="grofile-hash-map-04e318141ccaf383e0fd32df3fca2c04"> </div> <div class="grofile-hash-map-e341eca9e1a85dcae7127044301b4363"> </div> <div class="grofile-hash-map-450738fdfba6c6100585b7787b7c855e"> </div> <div class="grofile-hash-map-9a8b820b849c3f62c2bacdcf5752c4d3"> </div> <div class="grofile-hash-map-239a34b0d1ceb0acdd42b1657267a081"> </div> <div class="grofile-hash-map-841bae9c62d4865279c11db5747c0657"> </div> <div class="grofile-hash-map-80755161dbbf631482ab83ca6b042ba8"> </div> <div class="grofile-hash-map-8e742ead17f84777d5e11ad8056df615"> </div> <div class="grofile-hash-map-71cce4b88010a61658c3ad21f29eee08"> </div> <div class="grofile-hash-map-de2509ccf71f24c3e5a338efe25af357"> </div> <div class="grofile-hash-map-eeb07fb3535696080914fb9cecab1d01"> </div> <div class="grofile-hash-map-7c699f1225964f7bf7b3d138e81c934e"> </div> <div class="grofile-hash-map-1da5b38f190ad3d790bc616cc702a8a3"> </div> <div class="grofile-hash-map-562c3c4e1210a1fbdb85532eed73ede6"> </div> <div class="grofile-hash-map-acbfa0de1d87536d8b5483c028e1c68c"> </div> <div class="grofile-hash-map-b707e07b7118c6e3a4186a02b30829bd"> </div> <div class="grofile-hash-map-2742247057bbe635366f6820790ca5a8"> </div> <div class="grofile-hash-map-7da7e692a095d1c0d8ac147d972a22c2"> </div> <div class="grofile-hash-map-0bf6642090cae7d61a23001be08c9c9b"> </div> <div class="grofile-hash-map-7168dc164eea2b1cdc7f8fa1b8bf69f9"> </div> <div class="grofile-hash-map-80da9f79e2d79978130925702d4c6092"> </div> <div class="grofile-hash-map-31957ae015d415a157ee76413150dac6"> </div> <div class="grofile-hash-map-436c9539d33a9d1a413c40cc2311b7e8"> </div> <div class="grofile-hash-map-16be78ef8e097556770515d6cfad5289"> </div> <div class="grofile-hash-map-6af8482c7db54924a35d1148515b964f"> </div> <div class="grofile-hash-map-f07c1458322e2174c0a7e506f2b1af32"> </div> <div class="grofile-hash-map-c71c818c9d1a5cafd93d2fedbc9dac05"> </div> <div class="grofile-hash-map-790733b8f5df1226b802673a625f3289"> </div> <div class="grofile-hash-map-eaadef596798523f374f548ac8fefa5c"> </div> </div> <link rel="stylesheet" id="embedly_font_end-css" href="https://web.archive.org/web/20130130071049cs_/http://nacin.com/wp-content/plugins/embedly/css/embedly-frontend.css?ver=3.6-alpha-23334" type="text/css" media="all"/> <script type="text/javascript" src="https://web.archive.org/web/20130130071049js_/http://s0.wp.com/wp-content/js/devicepx-jetpack.js?ver=201305"></script> <div id="fb-root"></div> <script type="text/javascript"> window.fbAsyncInit = function() { FB.init({"appId":"163662570313065","channelUrl":"https:\/\/web.archive.org\/web\/20130130071049\/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/20130130071049/http://connect.facebook.net/en_US/all.js"; d.getElementsByTagName('head')[0].appendChild(js); }(document)); </script> <script src="https://web.archive.org/web/20130130071049js_/http://stats.wordpress.com/e-201305.js" type="text/javascript"></script> <script type="text/javascript"> st_go({v:'ext',j:'1:1.6.1',blog:'12547648',post:'4003'}); var load_cmc = function(){linktracker_init(12547648,4003,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 2893/2991 objects using apc Served from: nacin.com @ 2013-01-30 02:10:49 --><!-- FILE ARCHIVED ON 07:10:49 Jan 30, 2013 AND RETRIEVED FROM THE INTERNET ARCHIVE ON 05:51:19 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.501 exclusion.robots: 0.023 exclusion.robots.policy: 0.015 esindex: 0.009 cdx.remote: 9.636 LoadShardBlock: 167.831 (3) PetaboxLoader3.datanode: 166.715 (4) PetaboxLoader3.resolve: 153.147 (3) load_resource: 165.866 -->

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