Questions tagged [directory]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
57
votes
6answers
33k views

Custom Post Type Templates from Plugin Folder?

I'd like to offer my custom post type as a Plugin, so that people can use it without touching their theme folder. But custom post type templates -- such as single-movies.php -- reside in the theme ...
40
votes
10answers
16k views

How to structure a plugin

This isn't a question about how to build a WordPress plugin. Rather, what, if any, guides could be applied to how to put together the file architecture of any plugin. Some other programming languages ...
39
votes
3answers
5k views

Add multiple plugin directories

The task You can register add additional Themes directories using register_theme_directory() for your WP installation. Sadly core doesn't deliver with the same functionality for plugins. We already ...
34
votes
8answers
92k views

Cannot access non-wordpress subdirectories as wordpress overrides them with a 404 error

I refer to this question previously asked and not suitably answered: Wordpress overriding actual subdirectories and also Non "Wordpress" pages/code getting 404 error I have the same problem ...
26
votes
2answers
64k views

How to get the path to the current theme?

This code is used to get the directory of the current plugin: plugin_dir_url( __FILE__ ). What should I use to get the directory of the current theme?
20
votes
5answers
21k views

Moving a WP Multisite to a subdirectory

Firstly, I've read a number of posts on this process. However, for various reasons, the process remains difficult to implement or troubleshoot for lack of even abstracted examples, or maybe too ...
16
votes
1answer
27k views

get_template_directory() vs bloginfo( 'template_directory' ) vs TEMPLATEPATH

I was reading this article: Common WordPress Development Mistakes and How to Fix Them, and in it, they author says: Getting the theme location: If you are using TEMPLATEPATH or bloginfo( '...
14
votes
2answers
8k views

Change upload directory for PDF files

I would like to change the upload directory for PDF files only, not for other files. For example, the PDF files would be uploaded to wp-content/uploads/pdf but other files would remain in wp-content/...
11
votes
5answers
17k views

Can wordpress theme folder name be changed freely and nothing technically happens

Can the wordpress theme folder be renamed any time freely and everything works fine after that , themes/oldthemename themes/whatevernewname or is it so that if you change the folder name that ...
10
votes
3answers
6k views

Get a path to a different plugin

To get a the path to a plugin you can use plugin_dir_path(__FILE__) - but this obviously has to be called from within the plug-in. How can you reliably get the path to plugin B (pluginb/pluginb.php) ...
9
votes
3answers
736 views

Best Practice for Referencing the Plugin Directory

My plugin uses the following code to reference a file, but I've read WP_PLUGIN_DIR won't work if a user renames the default plugin folder. I would also like to replace /location-specific-menu-items/...
9
votes
1answer
183 views

How MUST the directory for a plugin be structured?

I get the basic plugin concept. I've read the Codex article on Writing a Plugin That article talks about the "main plugin file". How does Wordpress determine "the main plugin file" ? Q1: Is it ...
9
votes
1answer
5k views

Use a separate upload folder for custom post attachment upload

So, i'm trying to find out a way to use two separate upload folders, being the default one wp-content/uploads for general media uploads, and another one say wp-content/custom for one specific type of ...
8
votes
2answers
32k views

What's the purpose of index.php in wp-content directory? [duplicate]

<?php // Silence is golden. The folder is ../wp-content/index.php Why have this file. What's the purpose? I suppose it's in order to avoid invalid visit. But why?
8
votes
1answer
546 views

How to move page template files like page-{slug}.php to a sub-directory?

I want to move page template files like page-{slug}.php to a sub-directory within my theme, in a way that WordPress will recognize them automatically. If the page templates of the said form doesn't ...
7
votes
2answers
711 views

Rename UPLOADS folder with custom WP_CONTENT_DIR

For version control purpose, our client has a WordPress app with directory structure like this: . |_____app | |_____themes | |_____plugins | |_____uploads |_____index.php |_____WordPress |_____wp-...
6
votes
4answers
11k views

Dash or underscore in theme folder name?

I'm confused and I didn't find any answer by Googling. My theme files such as single.php or header.php reside in a folder. Should I use dashes or underscores in the folder name? My web server run on ...
6
votes
4answers
324 views

What WP folder can I use to write files to?

I am working on a theme that uses dynamic in head CSS and gives admin an option to also place the same in a file. Problem is that I am not sure what WP folder is always writable. I originally added ...
6
votes
2answers
311 views

Categorising themes by folders in backend

I want to organize themes like: wp-content/themes/themeshop/theme1 wp-content/themes/themeshop/theme2 wp-content/themes/themeshop/theme3 Now from my understanding, this organization works perfectly ...
6
votes
3answers
12k views

What is the best way to get directory path for wp-config.php?

I am developer of the plugin mapsmarker.com which also offers several APIs which can be accessed directly (eg www.mapsmarker.com/wp-content/plugins/leaflet-maps-marker/leaflet-geojson.php?marker=1) ...
5
votes
1answer
2k views

get_stylesheet_directory() returns wrong URI… localhost/using vhosts

I'm trying to develop a WP theme for a client via localhost. I'm using XAMPP on Windows 8 and has set up vhosts to something like myclient.dev. This works for stylesheet <?= get_stylesheet_uri(); ?...
5
votes
2answers
3k views

File and directory permissions

I installed latest WordPress 3.5 in my CentOS server. When I tried accessing http://example.com/wp-includes/, I received a listing of the directory: (Index of wp-includes). I added the following code ...
5
votes
4answers
34k views

Getting Images from theme's directory in pages

Yes, I know that we have get_template_directory_uri(); in referencing to the theme's directory. It's working when I put the following code inside index.php or in header.php: <img src="<?php ...
4
votes
2answers
667 views

Non-WordPress page in subdirectory under WordPress page

I want a non-WordPress page that can be accessed from a parent directory that is a WordPress page. For example, I want http://example.com/city/ to be a WordPress page. However, I want to upload a non-...
4
votes
4answers
9k views

Multisite in subfolder - How to make new sites to be in same level subfolders as the main site

I have following situation. I have a WP Multisite installed in subdirectory: my-domain.com/subfolder/wp-multisite-root Now normally next sites added would be created like that my-domain.com/...
4
votes
3answers
1k views

Could a large quantity of files in the uploads folder affect performance?

There is a site, where images are not organized into month- and year-based folders. There are more than 20 000 of images in one folder (uploads) now. When I try accessing the folder via a file browser,...
4
votes
3answers
7k views

How do I serve static content on same domain as WordPress

I have a portfolio site that I would also like to make a demo site for some of my client work. Basically, I would like to serve a subfolder statically along side the WordPress install. For instance, ...
4
votes
3answers
16k views

Permissions to wp-content folder in Windows Server 2012

I've made some tests to solve this problem: trying to update some plugins via Wordpress backend I always receive a "Unable to create folder" error. So I've initially added IIS_IUSRS with Read/Write/...
4
votes
2answers
1k views

How to individually set WP_DEBUG on a sub-directory multisite?

According to this question, it's possible to turn on/off WP_DEBUG for specific sites on a multisite. Is it possible to do this with a sub-directory multisite?
4
votes
4answers
6k views

Benefits or Problems for using Sub-Directory vs Sub-Domain install of WP Network

Reading through the documentation you have the ability to setup a WP Network in two ways, Sub-Domains and Sub-Directories. The only explanation they give you is Sub-directory sites It works with ...
4
votes
2answers
164 views

How do i structure my theme folder to avoid one huge list of files

When working with a worpress site with lots of custom post types and lots of page templates, my theme folder is looking messy. What are the accepted best practices to organise code files in WordPress? ...
4
votes
1answer
7k views

Wordpress .htaccess subdirectory problem

I've been having some issues with my Wordpress install allowing me to access subdirectories, specifically a CodeIgniter install at mydomain.com/codeigniter. I know that technically it should work just ...
4
votes
4answers
4k views

Can I change get_template_directory_uri()?

This is sort of a follow up to Can I put my Wordpress theme files in another folder? I found that following ...\wp-content\themes\MyTheme - \dist - \lib - \src - \wp - All my Wordpress files ...
4
votes
1answer
153 views

Namespacing WordPress project according to FIG standards

I am trying to wrap my head around the namespaces, autoloaders and FIG standards and most importantly how to achieve their integration to WordPress as close as possible. Here is my file structure, ...
4
votes
1answer
3k views

Place static HTML files in path below WordPress page

I have a WordPress instance running on my domain's root. One WordPress page is located at www.example.com/product/. I placed some static HTML files in a path below that so that visitors can go to www....
4
votes
1answer
2k views

NGinx + Wordpress Subdomain Multi with core in Subdirectory

I have a WordPress install that works perfectly on a Apache server. I am currently in the process of both changing my hosting company (the new one offer NGinx) and my development stack (moving to vvv)....
4
votes
0answers
1k views

How to get WordPress to save upload file beyond web root [closed]

I am using nginx on a multisite install. I am trying to get WordPress to save uploads to a folder beyond the webroot : /home/mydomain/file_secure as opposed to /home/mydomain/public_html/wp-...
3
votes
2answers
7k views

Group Posts by First Letter of Title

I am working on a website that is using posts as a way to manage glossary articles similar to the example website below. I would like to find a way to display articles alphabetically and grouped by a ...
3
votes
5answers
5k views

WP Page and Subdirectory with same name

I have a subdirectory within my WP installation called labs. I created a WP page called labs as well. When a user hits mydomain.com/labs/ I want them to load up the WP page. But instead it's loading ...
3
votes
3answers
2k views

How to create a mini directory in WordPress?

I'm looking to create a simple directory, something similar but not so powerful as SOBI2 for Joomla. Is there something like this for Wordpress? I want to store informations like: Name URL Address (...
3
votes
2answers
739 views

Creating a Link Directory using WordPress?

I would like to create a dmoz like website, using WP. Any suggestions on plugins or site's architecture would be welcomed.
3
votes
1answer
706 views

Multisite: differences between subdomain and subdirectory mode? Can it be switch after installation?

The WordPress multisite feature offers two different installation modes: subdomain and subdirectory install. By default both modes allow to manage separate WordPress instances (sites) within one ...
3
votes
1answer
3k views

Multisite installation combining subdomains and subdirectories

I need to create a complex WordPress-powered set up, which I would like to run from a single code base. My setup is complicated by a number of factors. First of all I already have software running ...
3
votes
3answers
709 views

Changing directory and/or URL structure

I'm curious if its possible (and advisable) to change certain directory names and URL structure via customization by themes or plugins. For example, say I wanted the list of all a user's posts to ...
3
votes
2answers
3k views

Why should I use “Organize my uploads into month- and year-based folders” option? (Cons/Pros)

What is the benefit of using (advantage/disadvantage) Organize my uploads into month- and year-based folders option? Why would I want to organize my folder structure like this ? Is there SEO ...
3
votes
1answer
9k views

Wordpress in sub directory wp-admin problem

I have WordPress 3.3.1 installed in a sub directory on my site just to use as a staging test site. It seems the root sites .htaccess is creating problems for Wordpress wp-admin page. I've set the ...
3
votes
2answers
2k views

Custom Post Type Archive in Sub Folder

I have a sub-directory in my Wordpress theme (there are a lot of pages and I want a more logical structure). I have a custom post type called "entry" but if I place the archive-entry.php template in ...
3
votes
4answers
16k views

Permalink Issues by Installing WordPress in Subdirectory / Subfolder

I installed WP in subfolder /cms and it runs live without subfolder. When I use /%postname%/ as permalink I get 404 error on my site. My Server supported mod_rewrite. My Code wp-config.php define('...
3
votes
2answers
1k views

How long does it take for a new plugin to be approved?

I've just submited my first wp plugin and i would like to know after how much time will my plugin be published to the wordpress plugin directory? Hou much did you actually waited?
3
votes
1answer
813 views

Unwanted redirect in admin area

I have a strange behaviour on my backend. This is possible due to the way my WordPress is located. I installed it in a VirtualBox, using Ubuntu from the standard repository (i.e., apt-get install ...