php – Worpdress Related Post Break WordPress Post Page

I am trying to get related post in my wordpress customised theme but the code i used worked really well on local server but does not work when i transfer it to digitalocean (vps).

<div class="desktop">
        <div class="box-list small desktop">    
            <?php $orig_post = $post;
global $post;
$categories = get_the_category($post->ID);
if ($categories) {
$category_ids = array();
foreach($categories as $individual_category) $category_ids() = $individual_category->term_id;

'category__in' => $category_ids,
'post__not_in' => array($post->ID),
'posts_per_page'=> 4, // Number of related posts that will be shown.

$my_query = new wp_query( $args );
if( $my_query->have_posts() ) {
echo '
<div class="section-header item-header desktop">
<div class="title">
    <span>Related Posts</span>
    on MonstaJams
while( $my_query->have_posts() ) {

<div class="story">
                <a href="<?php the_permalink() ?>"><img src="<?php the_post_thumbnail_url("thumbnail'); ?>">
                <p class="title"><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></p>
echo '';
$post = $orig_post;
wp_reset_query(); ?>

how can i resolve this to work really well and display the related posts without breaking my site?