The Support Forums will be in read-only mode for a scheduled maintenance window on 01 September 2016 14:00 UTC - 20:00 UTC. More information.

WP 2.8.4 bug - WP_CONTENT_DIR does not propagate to get_stylesheet_uri() (2 posts)

  1. AlexK_NY
    Posted 6 years ago #


    I've just installed an instance of WP 2.8.4 whereby the software is in public_html/wordpress and in anticipation of multiple blogs, $table_prefix as well as WP_CONTENT_DIR have been set at install time.

    WP_CONTENT_DIR points to a peer directory public_html/oo_blog, where I'd copied the appropriate files. Everything seemed fine until I added a custom theme. At that point it became clear that WP_CONTENT_DIR value is not propagating to the get_stylesheet_uri() function (and similar others) used in the header. The following construct in the header

    <link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen" />

    ... attempts to load the new theme's stylesheet from the default wordpress template location - not one specified in WP_CONTENT_DIR

    So far I've determined that function get_theme_root() does get the correct value - however it is not propagating to functions get_stylesheet_uri() and similar ones for pingback etc

  2. AlexK_NY
    Posted 6 years ago #

    I've failed to follow instructions fully in http://codex.wordpress.org/Editing_wp-config.php section "Moving wp-content"

    Beside define( 'WP_CONTENT_DIR', $_SERVER['DOCUMENT_ROOT'] . '/blog/wp-content' );
    ... I was supposed to also define( 'WP_CONTENT_URL', 'http://example/blog/wp-content');

    SUGGESTION: it would be cleaner if the default DIR <-> URL relationship were established centrally by defining the web root dir of the site and the home page url in two constants. The paths down from there would by default be all identical, obviating the need to track separate DIR and URI vars for many resources. Just IMHO

Topic Closed

This topic has been closed to new replies.

About this Topic