1

I've just uploaded a wordpress site from MAMP to a live site. Exactly the same methods I usually use to upload them, including permalinks and all the usual PHPMyAdmin bits.

This time the style.css, js and all the images are just redirecting to a 404 page.

The website is here

Can anyone help? This makes no sense at all.

EDIT: heres a snippit of header.php:

<!DOCTYPE html>
<html lang='en'>
    <head>
        <!-- Version 1.0 of Ken Christys Rural Support Website -->
        <meta charset="utf-8">
        <meta content='width=device-width, initial-scale=1.0' name='viewport'>
        <meta content='Josh Stevens, Lyndsay Hooper, PotatoMou.se' name='author'>
        <meta content='<?php bloginfo( 'description' ); ?> ' name='description'>
        <meta content='' name='keywords'> 
        <script>
            if(!window.jQuery)
                {
                     var script = document.createElement('script');
                     script.type = "text/javascript";
                     script.src = "http://ajax.googleapis.com/ajax/libs/jquery/2.1.0/jquery.min.js";
                     document.getElementsByTagName('head')[0].appendChild(script);
                }
        </script>


        <!-- Google Analytics-->

        <script type="text/javascript" src="<?php bloginfo('template_url'); ?>/javascript/pace.js"></script>
        <link rel="stylesheet" type="text/css" media="all" href="<?php bloginfo( 'stylesheet_url' ); ?>" />

        <title>
            <?php echo get_the_title() . "  -  ". get_bloginfo ( 'description' );  ?><br />
            <!-- Current Page title - Website description -->
        </title>



    </head>

and here is the actual rendered code:

<!---->
<!DOCTYPE html>
    <html lang='en'>
    <head>
        <!-- Version 1.0 of Ken Christys Rural Support Website -->
        <meta charset="utf-8">
        <meta content='width=device-width, initial-scale=1.0' name='viewport'>
        <meta content='Josh Stevens, Lyndsay Hooper, PotatoMou.se' name='author'>
        <meta content='Ken Christy Rural Support ' name='description'>
        <meta content='' name='keywords'> 
        <script>
            if(!window.jQuery)
                {
                     var script = document.createElement('script');
                     script.type = "text/javascript";
                     script.src = "http://ajax.googleapis.com/ajax/libs/jquery/2.1.0/jquery.min.js";
                     document.getElementsByTagName('head')[0].appendChild(script);
                }
        </script>


        <!-- Google Analytics-->

        <script type="text/javascript" src="http://www.kenchristy-ruralsupport.com/wp-content/themes/KenChristy/javascript/pace.js"></script>
        <link rel="stylesheet" type="text/css" media="all" href="http://www.kenchristy-ruralsupport.com/wp-content/themes/KenChristy/style.css" />

        <title>
            Home  -  Ken Christy Rural Support<br />
            <!-- Current Page title - Website description -->
        </title>
17
  • Did you flush your permalinks? Commented Apr 21, 2014 at 16:49
  • Yes, as I mentioned originally, I've done all the usual bits.
    – Josh
    Commented Apr 21, 2014 at 16:50
  • What code is actually outputting the stylesheet that is returning the 404? Please post the relevant code from header.php or functions.php. Commented Apr 21, 2014 at 16:56
  • header.php - <script type="text/javascript" src="<?php bloginfo('template_url'); ?>/javascript/pace.js"></script> <link rel="stylesheet" type="text/css" media="all" href="<?php bloginfo( 'stylesheet_url' ); ?>" />
    – Josh
    Commented Apr 21, 2014 at 16:57
  • 1
    As @PieterGoosen said: please edit your question to include the code that produces the output, as well as the actual output rendered by that code. Commented Apr 21, 2014 at 17:16

4 Answers 4

6

Your directory permissions for your Theme directory are incorrect.

  • wp-content: 0755
  • wp-content/themes: 0755
  • wp-content/themes/kenchristy: 0700

Per the Codex, folder permissions should be set to 755:

In such an suexec configuration, the correct permissions scheme is simple to understand.

  • All files should be owned by the actual user's account, not the user account used for the httpd process.
  • Group ownership is irrelevant, unless there's specific group requirements for the web-server process permissions checking. This is not usually the case.
  • All directories should be 755 or 750.
  • All files should be 644 or 640. Exception: wp-config.php should be 600 to prevent other users on the server from reading it.
  • No directories should ever be given 777, even upload directories. Since the php process is running as the owner of the files, it gets the owners permissions and can write to even a 755 directory.

So, try changing wp-content/themes/kenchristy/ from 0700 to 0755.

0
1

replace

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

with

 <link rel="stylesheet" type="text/css" href="<?php echo get_stylesheet_uri(); ?>" />

also try placing your style above all your JS

11
  • Done, same problem, and it outputs the same: <link rel="stylesheet" type="text/css" href="kenchristy-ruralsupport.com/wp-content/themes/KenChristy/…" />
    – Josh
    Commented Apr 21, 2014 at 18:05
  • I moved the code around as suggested, same same.
    – Josh
    Commented Apr 21, 2014 at 18:06
  • did you try to call it from functions.php? @Josh
    – bigant841
    Commented Apr 21, 2014 at 18:16
  • How would I do that?
    – Josh
    Commented Apr 21, 2014 at 18:26
  • wp_enqueue_style( 'THEMENAME-style', get_stylesheet_uri() ); @Josh
    – bigant841
    Commented Apr 21, 2014 at 18:28
1

Your call to wp_head between <head></head> is missing. Just before </head> add <?php wp_head(); ?>Then, enqueue your scripts and stylesheets properly in your functions.php. Have a look at the following from the codex

wp_enqueue_scripts wp_enqueue_style() wp_enqueue_script()

1
  • Done, still no change.
    – Josh
    Commented Apr 21, 2014 at 18:31
0

I had a folder named /CSS but was referencing /css in my enqueue. This was no problem on local, but the URLs were case sensitive when I pushed it up to hosting

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.