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

Retrieving ETA (estimated time of arrival) with Google Distance Matrix API and public transit as transport mode -

android - ConstraintLayout: Realign baseline constraint in case if dependent view visibility was set to GONE -

c# - Populating Gridview inside Listview ItemTemplate On Web User Control from Code Behind -