Grow your CSS skills. Land your dream job.

Can’t Access My Dashboard

  • # October 21, 2009 at 9:36 am

    I’m trying out wordpress for the first time and everything was going really well until yesterday I couldn’t access my dashboard. When I go to http://www.mydomain.com/wp-admin nothing happens,there’s just a white screen. Everything seemed fine on the front end but after clearing my cache only the index page worked and when I clicked onto another page it just went to a white page.

    I just have one plugin activated for twitter feeds. I did edit my functions.php file but I tried to upload the original file but that didn’t work.

    The site I’m messing around on is http://www.wordpress.barrywalsh-portfolio.com

    Any ideas on how I could fix this would be much appreciated!

    Barry

    # October 21, 2009 at 11:10 am

    The problem is when I update m y functions.php file. I’m trying to add the snippet to display my recent posts. As I said I’m new to wordpress so my fuctions.php file to:

    Code:
    < ?php

    automatic_feed_links();

    if ( function_exists('register_sidebar') ) {
    register_sidebar(array(
    'before_widget' => ‘

  • ‘,
    ‘after_widget’ => ‘
  • ‘,
    ‘before_title’ => ‘

    ‘,
    ‘after_title’ => ‘

    ‘,
    ));
    }
    ?>

    < ?php

    function recent_posts($no_posts = 10, $excerpts = true) {

    global $wpdb;

    $request = "SELECT ID, post_title, post_excerpt FROM $wpdb->posts WHERE post_status = ‘publish’ AND post_type=’post’ ORDER BY post_date DESC LIMIT $no_posts”;

    $posts = $wpdb->get_results($request);

    if($posts) {

    foreach ($posts as $posts) {
    $post_title = stripslashes($posts->post_title);
    $permalink = get_permalink($posts->ID);

    $output .= ‘

  • ‘ . htmlspecialchars($post_title) . ‘

    ‘;

    if($excerpts) {
    $output.= ‘
    ‘ . stripslashes($posts->post_excerpt);
    }

    $output .= ‘

  • ‘;
    }

    } else {
    $output .= ‘

  • No posts found
  • ‘;
    }

    echo $output;
    }
    ?>

The code does display my recent posts but gives me the white screen.

# October 21, 2009 at 11:12 am

OK have it sorted now by removing the first snippet. Hopefully that won’t cause any problems.

# October 21, 2009 at 1:06 pm

Sounds like the snippet you added had an error or two in the PHP, which caused the white pages. Looks like you may have bypassed the problem by removing the code, but I did notice an unnecessary "," that may have been causing the issue:

Code:
if ( function_exists(‘register_sidebar’) ) {
register_sidebar(array(
‘before_widget’ => ‘
  • ‘,
    ‘after_widget’ => ‘
  • ‘,
    ‘before_title’ => ‘

    ‘,
    ‘after_title’ => ‘

    ‘, < -- unnecessary ","
    ));
    }

    I haven’t gone through the code line by line, but that is an obvious thing that might be the source of the error.

    # October 21, 2009 at 2:22 pm

    Cheers for that.

    So since i changed my functions php file I removed the snippet to call jquery in the head.php file. So when I put it back in the site stops working again and I’ve got the white screen when I try to go to the "profile" page and and log in to the dashboard.

    Here’s the code:

    Code:
    < ?php

    function recent_posts($no_posts = 10, $excerpts = true) {

    global $wpdb;

    $request = "SELECT ID, post_title, post_excerpt FROM $wpdb->posts WHERE post_status = ‘publish’ AND post_type=’post’ ORDER BY post_date DESC LIMIT $no_posts”;

    $posts = $wpdb->get_results($request);

    if($posts) {

    foreach ($posts as $posts) {
    $post_title = stripslashes($posts->post_title);
    $permalink = get_permalink($posts->ID);

    $output .= ‘

  • ‘ . htmlspecialchars($post_title) . ‘

    ‘;

    if($excerpts) {
    $output.= ‘
    ‘ . stripslashes($posts->post_excerpt);
    }

    $output .= ‘

  • ‘;
    }

    } else {
    $output .= ‘

  • No posts found
  • ‘;
    }

    echo $output;
    }
    ?>

    < ?php

    if( !is_admin()){
    wp_deregister_script('jquery');
    wp_register_script('jquery', ("http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"), false, '1.3.2');
    wp_enqueue_script('jquery');
    }
    ?>

    # October 21, 2009 at 3:08 pm

    Ok I think I’ve solved the problem now, thanks to an article on digging into wordpress. Hopefully it’s all sorted now!

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

    You must be logged in to reply to this topic.

    *May or may not contain any actual "CSS" or "Tricks".