惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

腾讯CDC
博客园 - Franky
MyScale Blog
MyScale Blog
L
LangChain Blog
Martin Fowler
Martin Fowler
Recent Announcements
Recent Announcements
Stack Overflow Blog
Stack Overflow Blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
博客园 - 司徒正美
量子位
A
About on SuperTechFans
C
Check Point Blog
大猫的无限游戏
大猫的无限游戏
Last Week in AI
Last Week in AI
小众软件
小众软件
Apple Machine Learning Research
Apple Machine Learning Research
I
InfoQ
V
Visual Studio Blog
Vercel News
Vercel News
B
Blog
爱范儿
爱范儿
aimingoo的专栏
aimingoo的专栏
U
Unit 42

Jeremy Carlson

Convert Post Metadata into Tags (Terms) – Jeremy Carlson Excluding a directory from WordPress – Jeremy Carlson Pay attention. – Jeremy Carlson A SASS Mixin to accommodate @font-face fallbacks – Jeremy Carlson Can I use type in an image? – Jeremy Carlson Creating a site structure for the future – Jeremy Carlson Running a Successful Business with the Add-On Model – Jeremy Carlson What I Learned About WordPress Development by Interviewing 15 of the Best WordPress Developers – Jeremy Carlson Quirky Client Communication and How to Fix It – Jeremy Carlson
Reorganize your WordPress files to make your life easier ...
Jeremy · 2016-11-08 · via Jeremy Carlson

I really enjoyed my second Denver WordCamp this weekend—it was great to run into faces familiar and new, and learn all kinds of useful information, hear great advice, and more. Might write more up, but a friend pinged me this morning following up on a question, and I thought it would be useful to post.

While chatting in a hallway, the subject of alternative folder setups came up, and a couple of folks were interested in:

  • setting up WordPress in a subfolder, and
  • moving the wp-content folder to a different location

I thought I’d post my current favorite setup for files and configuration.

It starts with the Awesome Config File by Ashfame, based on his answer to a question about keeping your wp-config file in version control. We include more complicated stuff in the main config file, but move login credentials up one level from root so it’s (a) not in a GIT repository and (b) not web-accessible (which may not do much for security really but can’t hurt).

I always go crazy when trying to access the wp-content folder in a file open dialogue, or in Mac’s Finder, because it’s in the middle of a long list of files in WordPress. I use my keyboard for quick navigation of folders, and with the default WordPress install, I have to type “wp-cont” before I can get to that folder. When you access that folder again and again, those 7 characters add up. So getting the folder OUT of the WordPress install is great.

My setup kind of looks like this:

root/
  .htaccess
  index.php — copy of WP default index.php, but needs to be tweaked slightly
  site-content/ — this is my replacement for wp-content
  wp/ — default WP install goes here
  wp-config.php
config-folder/
  local-config.php — includes credentials for local site, omitted on production site
  production-config.php — includes credentials for production site

This setup has made it super-easy for me to access site files quickly while working on them, it keeps the default WP install easy to replace, and it lets the whole thing be in a GIT repo if I want. There are other issues there, may touch on them sometime. But that’s what I know for now.

Download a sample file structure & wp-config file here.

Hey Lisa, hope this is useful!