This topic has 15 replies, 2 voices, and was last updated 10 years by Abe.

  • Author
  • #21212
     st
    Participant

    Starting in WordPress 2.6 you are able to move your wp-content directory by specifying the following in wp-config.php:

    define(‘WP_CONTENT_DIR’, ‘/var/domain/wp-content’);
    define(‘WP_CONTENT_URL’, ‘http://cdn.domain.com/wp-content’);

    http://codex.wordpress.org/Editing_wp-config.php#Moving_wp-content_folder

    In sweetdate/framework/options/default.php you are calculating SQUEEN_OPTIONS_URL on line 17:

    define('SQUEEN_OPTIONS_URL', site_url(str_replace($fslashed_abs, '', $fslashed_dir)));

    This is failing because WP_CONTENT_DIR and WP_CONTENT_URL are set. I think it should be updated to something like this:

    define('SQUEEN_OPTIONS_URL', get_bloginfo('template_directory') . '/framework/options/');

    Everything works again except the FontAwesome icons work in Safari but not Firefox. Any thoughts?

    #21239
     st
    Participant

    The icons are working in Chrome and Safari but not in Firefox or Internet Explorer.

    #21295
     st
    Participant

    I was able to fix the Font Awesome issue by loading it from the CDN instead:

    COPY CODE
    wp_deregister_style('font-awesome');
    wp_enqueue_style('font-awesome-cdn', '//maxcdn.bootstrapcdn.com/font-awesome/3.2.1/css/font-awesome.min.css');

    I still think it would be wise to apply the changes from the original post to the theme so it will support WP_CONTENT_DIR and WP_CONTENT_URL.

    #21299
     Abe
    Keymaster

    Hi @st
    try replacing that declaration with this: define( ‘SQUEEN_OPTIONS_URL’, get_template_directory_uri() . ‘/framework/options’ );

    If it works in other browser the the link should be fine but give it a shot

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    ---
    @ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.

    #21305
     st
    Participant

    define('SQUEEN_OPTIONS_URL', get_template_directory_uri() . '/framework/options/');

    has the same output as

    define('SQUEEN_OPTIONS_URL', get_bloginfo('template_directory') . '/framework/options/');

    so it works but the FontAwesome icons do not appear in Internet Explorer or FireFox. I am using this as a temporary workaround:

    COPY CODE
    wp_deregister_style('font-awesome');
    wp_enqueue_style('font-awesome-cdn', '//maxcdn.bootstrapcdn.com/font-awesome/3.2.1/css/font-awesome.min.css');
    #21310
     Abe
    Keymaster

    Strange that it does not appear in IE or FF. Could be something related to site url. Yes I know the above give the same output but my version is recommended.
    What is your site name. try to leave it with the error and give me the url to the site to take a quick look

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    ---
    @ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.

    #21311
     st
    Participant

    Could I email you the site address?

    #21312
     Abe
    Keymaster

    Put it here and mark the reply as private so only I will see it

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    ---
    @ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.

    #21316
     st
    Participant
    This reply has been set as private.
    #21321
     Abe
    Keymaster

    I just found the problem. See this notice:
    Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://cdn.site.com/wp-content/themes/sweetdate/assets/font/fontawesome-webfont.woff?v=3.2.1. This can be fixed by moving the resource to the same domain or enabling CORS.

    It is related to your CDN settings and the browser does not want to load the js from http://cdn.site.com since your domain is http://community.site.com/

    I guess your fix should do

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    ---
    @ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.

    #21331
     st
    Participant

    It turns out the FontAwesome bug was related to my .htaccess settings and is working now without having to use the CDN.

    However, I’ve since enabled warnings and am seeing this:

    Warning: copy(/var/community.domain.com//wp-content/plugins/bp-custom.php): failed to open stream: No such file or directory in /var/cdn.domain.com/wp-content/themes/sweetdate/custom_buddypress/bp-functions.php on line 1025

    #21336
     Abe
    Keymaster

    You don’t have write permissions on your server at that location /wp-content/plugins/

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    ---
    @ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.

    #21337
     st
    Participant

    Shoot. Can you please edit the above post to domain.com?

    I don’t think that is the problem. The server definitely has write permissions. The file does not exist at /var/community.domain.com//wp-content/plugins/bp-custom.php. Shouldn’t it be trying to copy the file from /var/cdn.domain.com//wp-content/plugins/bp-custom.php?

    #21351
     Abe
    Keymaster

    copy it by hand then to your ftp server since your cdn plugin messes things up

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    ---
    @ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.

    #21356
     st
    Participant

    This is not a result of a plug-in. WordPress 2.6 supports moving the wp-content directory by specifying WP_CONTENT_DIR and WP_CONTENT_URL. This functionality is included in the WordPress core and mentioned in the WordPress codex. I assume that you’d like your theme to support this core functionality. I have already tested this for you and have provided the code below. I hope that you are able to include these updates in the next version of the theme.

    sweetdate/framework/options/default.php line 17:
    define('SQUEEN_OPTIONS_URL', get_template_directory_uri() . '/framework/options/');

    sweetdate/custom_buddypress/bp-functions.php line 1025:
    if (copy(FRAMEWORK_URL."/inc/bp-custom.php", WP_PLUGIN_DIR."/bp-custom.php"))

    #21401
     Abe
    Keymaster

    WE will make those changes in next updates sure
    Thanks

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    ---
    @ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.

Viewing 16 posts - 1 through 16 (of 16 total)

The forum ‘Sweetdate – WordPress’ is closed to new topics and replies.

Log in with your credentials

Forgot your details?