Skip to content

Failure to correctly find wp-content/plugins or themes #785

@whimsy-github

Description

@whimsy-github

I cannot get wp-cli to find my plugin or theme directories the way I've structured wordpress files (relative to webserver root)

index.php: (copied from WordPress install with path modified to send it to the subdirectory)

<?php 
/* Short and sweet */
define('WP_USE_THEMES', true);
require('./wordpress/wp-blog-header.php');
?>

wordpress/ -->> Wordpress install as downloaded, no edited files
wp-content/ -->> MY plugins and themes under this

wp-config.php: (relevant excerpt below)

if ($_SERVER['DOCUMENT_ROOT'] == "")
   $_SERVER['DOCUMENT_ROOT'] = dirname(__FILE__);
define( 'WP_CONTENT_DIR', $_SERVER['DOCUMENT_ROOT'] . '/wp-content' );

Note: I added the first two lines in an attempt to work around this problem. My blog behaves well on both my production web host and my local test install (MAMP) without it.

In my database, the blog location settings point to example.com and WordPress location settings point to example.com/wordpress

wp plugin path should output:

/path/to/public_html/wp-content/plugins

Instead it outputs:

/path/to/public_html/wordpress/wp-content/plugins

wp plugin list shows me Hello Dolly and Akismet from the default wordpress file structure, instead of all the plugins I've got installed on my blog

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions