There are two errors I see in your code. First is that you’ve written get_stylesheet_directory_url()
instead of get_stylesheet_directory_uri()
. Switch the L
for an I
and that will probably fix it.
Second, for the JS file you’re adding a slash before the folder, and for the CSS you’re not. Once you fix the URL/I issue, you may still need to remove the /
Update
I’ve reviewed and updated your enqueue styles. There were a number of issues, but I’ve tightened it up, and this will load your styles and scripts:
function childtheme_parent_styles() {
wp_enqueue_style('parent', get_template_directory_uri().'/css/style.css' );
wp_enqueue_style('mytheme_main_style', get_stylesheet_uri());
wp_register_script('main-js', get_stylesheet_directory_uri() . '/js/main.js');
if( is_page(507) ) {
wp_enqueue_script( 'main-js');
}
}
add_action( 'wp_enqueue_scripts', 'childtheme_parent_styles');
Good luck!