After Move To New Server Single.php Stopped Working !!

Discussion in 'WordPress' started by Rajnish357, Feb 6, 2013.

  1. #1
    I recently moved my site to a new server after that my single.php stopped working, can anyone please take a look at the below code of the file and tell me what is the problem.

    I think the loops has not been closed correctly, I don't know I how to do that.

    <?php get_header(); ?>
     
    <div class="randomtop2">
    <h1><?php the_title(); ?></h1>
    </div>
    <div class="indextop">
     
    <div class="myrandomgames">
    <?php if (have_posts()) : ?>
     
    <div class="randomgame">
     
    <?php while (have_posts()) : the_post(); ?>
    <div class="game">
     
    <iframe
    title="Video player" width="639" height="359" src="http://www.youtube.com/embed/<?php $values = get_post_custom_values("video");
     
    if($values)
    {
    echo $values[0];}
    else
    {
    echo "bTpM-8ZAjP4";
    }
    ?>?modestbranding=1&amp;title=&amp;iv_load_policy=3;autohide=1&amp;rel=0&amp;showsearch=0&amp;fs=1" frameborder="0" allowfullscreen></iframe>
    <div style="clear: both;"></div>
    <div class="audiop"><?php echo do_shortcode('[audio src="'.get_post_meta($post->ID, 'audio', true).'" volume="false" loop="true" preload="true"]'); ?></div>
    </div>
     
    <?php endwhile; ?>
     
    </div>
    <div class="technology"><h2><?php the_title(); ?> Song Lyrics</h2></div>
    <div class="thelanguage">
    <?php $values = get_post_custom_values("lyrics"); echo nl2br($values[0]); ?>
    </div>
    <div class="randd"><img src="http://setsong.com/wp-content/uploads/2011/10/movied.gif" alt="<?php
    $category = get_the_category();
    echo $category[0]->cat_name;
    ?> Detail" style="margin: 5px -1px;">
    <div style="clear: both;"></div>
    <table border="0">
      <tbody><tr>
        <td></td>
        <td></td>
      </tr>
      <tr>
        <td><div class="singlem"><?php if (function_exists('get_cat_icon')) get_cat_icon(); ?></div></td>
        <td>
    <div class="singled"><h1><?php the_category(', ') ?></h1>
    <?php
    foreach((get_the_category()) as $category) {
    echo $category->category_description . ' ';
    }
    ?></div></td>
      </tr>
      <tr>
        <td></td>
        <td></td>
      </tr>
    </tbody></table>
    </div>
    <div style="clear: both;"></div>
     
     
    <?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;
     
    $args=array(
    'category__in' => $category_ids,
    'post__not_in' => array($post->ID),
    'posts_per_page'=> 20, // Number of related posts that will be shown.
    'caller_get_posts'=>1
    );
     
    $my_query = new wp_query( $args );
    if( $my_query->have_posts() ) {
    echo '<div id="related_posts"><img src="http://setsong.com/wp-content/uploads/2011/10/mores.gif" alt="More From The Movie <?php the_category(', ') ?>" style="margin: 4px -3px;"><div style="clear: both;"></div>';
    while( $my_query->have_posts() ) {
    $my_query->the_post();?>
    <div class="samecat"><div class="relatedthumb"><a href="<?php the_permalink()?>" rel="bookmark" title="<?php the_title(); ?>"><img src="<?php $values = get_post_custom_values("thumb"); echo $values[0]; ?>" alt="<?php the_title(); ?>" height="91" width="168" /></a></div>
    <div class="relatedcontent">
    <h2><a href="<?php the_permalink()?>" rel="bookmark" title="<?php the_title(); ?>"><?php the_title(); ?></a></h2>
    <span class="linkrs2"><?php the_tags('<strong>Casts:</strong> ',', '); ?><br><strong>Singer: </strong><?php $values = get_post_custom_values("game");$order  = array("\r\n", "\n", "\r"); echo str_replace($order, ', ', $values[0]); ?>
    </span>
    </div>
    </div>
    <div style="clear: both; height: 20px;"></div>
     
     
    </div>
    <div class="moreinfo">
    <img src="http://setsong.com/wp-content/uploads/2011/10/detail.jpg" alt="More Details about <?php the_title(); ?>"/>
    <div class="fontcor">
    <br/><strong>Singer:</strong><br/>
    <?php $values = get_post_custom_values("game"); echo nl2br($values[0]); ?>
    <br><br><strong>Casts:</strong>
    <?php the_tags('<ul><li>','</li><li>','</li></ul>'); ?><br/>
    </div>
    <img src="http://setsong.com/wp-content/uploads/2011/10/download.jpg" alt="Download <?php the_title(); ?> Song"/>
    <div style="padding:10px 0px 10px 30px;">
    <ul>
    <li><a href="http://keep-tube.com/?url=http://youtube.com/watch?v=<?php $values = get_post_custom_values("video"); echo $values[0]; ?>#download_header" target="_blank">Click Here to Download Video</a></li>
    <li><a href="<?php $values = get_post_custom_values("audio"); echo $values[0]; ?>">Click Here to Download Audio</a>
    </li>
    </ul>
    </div>
    </div>
     
    </div>
     
    <div class="singlebottom">
     
    <div class="randomgame4">
    <h3 class="randomtop">Similar Songs - Video and Audio</h3>
    <?php $recent = new WP_Query("cat=&showposts=4&orderby=rand"); while($recent->have_posts()) : $recent->the_post();?>
    <div class="gamethumb4">
     
    <div class="thumbs">
    <a href="<?php the_permalink() ?>" title="Play <?php the_title_attribute(); ?>"><img src="<?php $values = get_post_custom_values("thumb"); echo $values[0]; ?>" alt="<?php the_title(); ?>" height="80" width="96" /></a>
    </div>
    <div class="thumbtitle">
    <a href="<?php the_permalink() ?>" rel="bookmark" title="Play <?php the_title_attribute(); ?>"><?php the_title('<h3 id="singleh3">', '</h3>'); ?></a>
    </div>
    </div>
    <?php endwhile; ?>
     
    </div>
     
    </div>
    <?php endif; ?>
     
    <?php get_footer(); ?>
    PHP:
    UPDATE:
    On visiting the single post page it give the following error:
    HTTP Error 500 (Internal Server Error): An unexpected condition was encountered while the server was attempting to fulfill the request.
    You can check a post here: http://setsong.com/2013/02/02/baap-ka-maal/
     
    Last edited: Feb 6, 2013
    Rajnish357, Feb 6, 2013 IP
  2. ArchAxis

    ArchAxis Well-Known Member

    Messages:
    136
    Likes Received:
    11
    Best Answers:
    1
    Trophy Points:
    175
    #2
    What's the error? Can you send link to the page or check your PHP error log and post the message?
     
    ArchAxis, Feb 6, 2013 IP
  3. Rajnish357

    Rajnish357 Well-Known Member

    Messages:
    157
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    103
    #3
    Thanks ArchAxis for your reply,
    On visiting the single post page it give the following error:
    HTTP Error 500 (Internal Server Error): An unexpected condition was encountered while the server was attempting to fulfill the request.
    You can check a post here: http://setsong.com/2013/02/02/baap-ka-maal/

    I don't know how to check php error log.
     
    Rajnish357, Feb 6, 2013 IP
  4. ArchAxis

    ArchAxis Well-Known Member

    Messages:
    136
    Likes Received:
    11
    Best Answers:
    1
    Trophy Points:
    175
    #4
    Who's your web host?
     
    ArchAxis, Feb 6, 2013 IP
  5. GORF

    GORF Well-Known Member

    Messages:
    224
    Likes Received:
    21
    Best Answers:
    3
    Trophy Points:
    165
    #5
    500 errors are usually file permission errors not code errors.

    In your FTP software, can you see the owner/group for the file? Does it belong to your hosting account?

    What are the read/write/execute permissions - 644, 700, 755, 777... ?
    Try 755 or 777.
     
    GORF, Feb 6, 2013 IP
  6. Masim man

    Masim man Active Member

    Messages:
    73
    Likes Received:
    4
    Best Answers:
    2
    Trophy Points:
    58
    #6
    Another cause can be bad .htaccess

    Try to disable line by line in your htaccess(by adding # mark) in front of them or you could just rename htaccess to something else.

    If none of the above work, I think you should contact your hosting, because they are the only one can locate and analyse the logs and fix your problem.
     
    Masim man, Feb 7, 2013 IP
  7. Rajnish357

    Rajnish357 Well-Known Member

    Messages:
    157
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    103
    #7
    @Masim my hosting said that, my code has issues.
     
    Rajnish357, Feb 8, 2013 IP
  8. ArchAxis

    ArchAxis Well-Known Member

    Messages:
    136
    Likes Received:
    11
    Best Answers:
    1
    Trophy Points:
    175
    #8
    @Rajnish357 I installed your single.php on my local server and I get the following error
    Parse error: syntax error, unexpected T_ENDIF in single.php on line 132
    Code (markup):
    so you have some broken PHP. You should do a diff on the original single.php you referenced to build the page and walk through line by line to find out the error.
     
    ArchAxis, Feb 8, 2013 IP
  9. Rajnish357

    Rajnish357 Well-Known Member

    Messages:
    157
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    103
    #9
    @ArchAxis thanks I will try to find out the error and I'll be back then.
     
    Rajnish357, Feb 9, 2013 IP