My function.php
file seems to be causing a white screen to appear whenever I try to login to the dashboard locally. I have confirmed this by renaming the 'function.php' file and also the plugins file to identify the problem area.
I'm pretty new to Wordpress and would like to know how to exactly pinpoint the line of code in the function.php file thats causing problems. Below is my code.
Prior to this I also noticed that my media library would not work. The spinner would simply spin and show none of my images
function.php
<?php
// Call Stylesheets
function wpSam_theme_styles(){
wp_enqueue_style( 'normalize_css', get_template_directory_uri() . '/css/normalize.min.css' );
wp_enqueue_style( 'main_css', get_template_directory_uri() . '/style.css' );
}
add_action('wp_enqueue_scripts','wpSam_theme_styles');
// Call Scripts
function wpSam_theme_js(){
// 1.name 2. 3. Directory 4. dependencies 5. 6. appear in footer (t/f)
wp_enqueue_script( 'modernizer_js', get_template_directory_uri() . '/js/modernizr.js' , '', '', false );
wp_enqueue_script( 'main_js', get_template_directory_uri() . '/js/app.js' , '', '', true );
}
add_action('wp_enqueue_scripts', 'wpSam_theme_js');
function time_ago( $type = 'post' ) {
$d = 'comment' == $type ? 'get_comment_time' : 'get_post_time';
return human_time_diff($d('U'), current_time('timestamp')) . " " . __('ago');
}
add_theme_support( 'post-thumbnails' );
add_action( 'after_setup_theme', 'wpse239844_image_sizes' );
function wpse239844_image_sizes() {
set_post_thumbnail_size( 470, 295, true ); // $width, $height, $crop
}
add_action( 'post_stuck', 'wpse239911_only_one_sticky' );
function wpse239911_only_one_sticky( $post_id ) {
remove_action( 'post_stuck', 'wpse239911_only_one_sticky' );
// prevent loop
delete_option( 'sticky_posts' );
stick_post( $post_id );
}
?>