The solution was wrapping my custom javascript code in in:
(function($){
// your code here.
})(jQuery);
For more information see: Click here
And for more information about proper way loading the Javascript see the this article what helped me with a clear explanation: Click here
I fixed the problem I will explain it later, I set the topic status on resolved so people don’t take the time for a problem that is already solved.
I will edit this message with the explanation.
Thanks for you reply it worked, and the Regenereate Thumbnails is a handy one. And I am using a child-theme now.
I used this code for setting more image size settings, for people who maybe don’t know how to do it.
$sizes = array(
'post-thumbnail' => array(
'width' => 850,
'height' => 450,
'crop' => true
),
'slider-thumbnail' => array(
'width' => 1204,
'height' => 900,
'crop' => true
),
'related-thumbnail' => array(
'width' => 210,
'height' => 180,
'crop' => false
)
);
return $sizes;
}