wordpress theming - Adding code in functions.php my live site is messed up -


i adding code in functions.php whole site messed up. after instead of using functions.php used separate plugin not working on live site. working in localhost. using evolve wordpress theme please help... here code...

function f1_content($content){     $categories=get_the_category();     $category_id = $categories[0]->cat_id;     if(in_category($category_id)&&is_single())     {         echo $content;         global $post;         $args = array( 'category' => $category_id , 'post_type' =>  'post','posts_per_page' => 8,'orderby' => 'rand','post__not_in' => array($post->id));         $myposts = get_posts( $args );         //var_dump($myposts);         echo "<h3>related links</h3>";         foreach ( $myposts $post ) : setup_postdata( $post ); ?>         <li style="list-style-type:none;">         <i class="fa fa-hand-o-right" aria-hidden="true"></i>  &nbsp; <a href="<?php the_permalink(); ?>"><?php the_title(); ?></a>         </li>         <?php endforeach;              wp_reset_postdata();?>         </ul>      <?php        }    //return $content; }  add_filter('the_content','f1_content',11,1); 


Comments

Popular posts from this blog

Command prompt result in label. Python 2.7 -

javascript - How do I use URL parameters to change link href on page? -

amazon web services - AWS Route53 Trying To Get Site To Resolve To www -