Title: Theme does not work
Last modified: August 22, 2016

---

# Theme does not work

 *  [tekehe](https://wordpress.org/support/users/tekehe/)
 * (@tekehe)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/theme-does-not-work/)
 * I tried to wordpress transferred to VPS (environment: Nginx + Ubuntu 14 + PHP5-
   fpm)
 * But it does not work wordpress. 3 tips to get the following error:
 * 1: Notice:… Wp_enqueue_script was called incorrectly Scripts and styles should
   not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts,
   or login_enqueue_scripts hooks Please see Debugging in WordPress for more information(.
   This message was added in version 3.3) in / var /…../wp-includes/functions.php
   on line 3370
 * 2: Parse error: syntax error, unexpected ‘endwhile’ (T_ENDWHILE) in /var/…../
   wp-content/themes/……/single.php on line 97
    Code Here: [http://pastebin.com/pCCmBp6n](http://pastebin.com/pCCmBp6n)
 * 3: Deprecated: Function ereg_replace () is deprecated in /var/……../wp-content/
   plugins/popularity-contest/popularity-contest.php on line 2572
    Code Here: [http://pastebin.com/LcnqMhDn](http://pastebin.com/LcnqMhDn)
 * How to resolve these errors? Thanks!!

Viewing 14 replies - 1 through 14 (of 14 total)

 *  [stephencottontail](https://wordpress.org/support/users/stephencottontail/)
 * (@stephencottontail)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/theme-does-not-work/#post-5363999)
 * What theme are you using?
 *  Thread Starter [tekehe](https://wordpress.org/support/users/tekehe/)
 * (@tekehe)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/theme-does-not-work/#post-5364014)
 * Free, and has been modified, has been unable to know the name of .
 *  Thread Starter [tekehe](https://wordpress.org/support/users/tekehe/)
 * (@tekehe)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/theme-does-not-work/#post-5364015)
 * @ stephencottontail
 * Free, and has been modified, has been unable to know the name of .
 *  [stephencottontail](https://wordpress.org/support/users/stephencottontail/)
 * (@stephencottontail)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/theme-does-not-work/#post-5364016)
 * Is there a file named `style.css` in your theme’s folder? If so, is there any
   kind of identifying information in that file? Is there any identifying information
   in a README file?
 *  Thread Starter [tekehe](https://wordpress.org/support/users/tekehe/)
 * (@tekehe)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/theme-does-not-work/#post-5364022)
 * No
 *  [stephencottontail](https://wordpress.org/support/users/stephencottontail/)
 * (@stephencottontail)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/theme-does-not-work/#post-5364023)
 * 1) Can you post the contents of your theme’s `functions.php` (not the one located
   in `wp-includes`) to Pastebin as well?
 * 2) I’m confused about this error. The code you posted to Pastebin doesn’t have
   a line 97.
 * 3) The Popularity Contest plugin appears to be extremely old and doesn’t appear
   to have any official support any more. I recommend reading this and possibly 
   trying some of the plugins recommended on this page: [http://alexking.org/blog/2011/12/28/popularity-contest-is-dead-and-on-github](http://alexking.org/blog/2011/12/28/popularity-contest-is-dead-and-on-github)
 *  Thread Starter [tekehe](https://wordpress.org/support/users/tekehe/)
 * (@tekehe)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/theme-does-not-work/#post-5364026)
 * <?php comments_template(); ?>
    <?php endwhile; else: ?>
 *  <h1 class=”title”>Not Found</h1>
    <p>I’m Sorry, YOU are looking for something
   that ISN’T HERE. </p>
 * <?php endif; ?>
 *  Thread Starter [tekehe](https://wordpress.org/support/users/tekehe/)
 * (@tekehe)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/theme-does-not-work/#post-5364027)
 * line 40
    <?php comments_template(); ?> <?php endwhile; else: ?>
 * <h1 class=”title”>Not Found</h1>
    <p>I’m Sorry, YOU are looking for something
   that ISN’T HERE. </p>
 * <?php endif; ?>
 *  [stephencottontail](https://wordpress.org/support/users/stephencottontail/)
 * (@stephencottontail)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/theme-does-not-work/#post-5364029)
 * The code you posted works for me. Can you post the contents of `ad2.php` to Pastebin?
 *  Thread Starter [tekehe](https://wordpress.org/support/users/tekehe/)
 * (@tekehe)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/theme-does-not-work/#post-5364032)
 * all code
    <?php $ad = get_option(‘template_ad’); ?>
 * <div class=”ad2″>
 * </div>
 *  Thread Starter [tekehe](https://wordpress.org/support/users/tekehe/)
 * (@tekehe)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/theme-does-not-work/#post-5364033)
 * @ stephencottontail ad2.php all code
 * <?php
    $ad = get_option(‘template_ad’); ?>
 * <div class=”ad2″>
 * </div>
 *  [stephencottontail](https://wordpress.org/support/users/stephencottontail/)
 * (@stephencottontail)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/theme-does-not-work/#post-5364034)
 * I’m sorry, but I’m starting to run out of ideas, especially since the code you
   posted works for me. Do you remember anything about who created this theme or
   when it was created?
 *  Thread Starter [tekehe](https://wordpress.org/support/users/tekehe/)
 * (@tekehe)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/theme-does-not-work/#post-5364095)
 * [@stephencottontail](https://wordpress.org/support/users/stephencottontail/)
   
   Because I added this： But I do not know modify it.
 * <?php $orig_post = $post;
    global $post; $tags = wp_get_post_tags($post->ID);
   if ($tags) { $tag_ids = array(); foreach($tags as $individual_tag) $tag_ids[]
   = $individual_tag->term_id; $args=array( ‘tag__in’ => $tag_ids, ‘post__not_in’
   => array($post->ID), ‘posts_per_page’=>5, // Number of related posts to display.‘
   caller_get_posts’=>1 ); $my_query = new wp_query( $args );
 *  while( $my_query->have_posts() ) {
    $my_query->the_post(); ?>
    -  <?php $hthumb = get_post_meta($post->ID,’hthumb’, true); ?>
       ” title=”<?php
      the_title(); ?>” ><img src=”<?php echo catch_that_image() ?>” /> <p><?php 
      the_title(); ?></P>
 *  <? }
    } $post = $orig_post; wp_reset_query(); ?>
 *  [stephencottontail](https://wordpress.org/support/users/stephencottontail/)
 * (@stephencottontail)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/theme-does-not-work/#post-5364116)
 * Which file did you add this code to? Also, can you repost that code, either to
   Pastebin or by using backticks (`) or the “code” button?

Viewing 14 replies - 1 through 14 (of 14 total)

The topic ‘Theme does not work’ is closed to new replies.

## Tags

 * [endwhile](https://wordpress.org/support/topic-tag/endwhile/)
 * [wp_enqueue_script](https://wordpress.org/support/topic-tag/wp_enqueue_script/)

 * 14 replies
 * 2 participants
 * Last reply from: [stephencottontail](https://wordpress.org/support/users/stephencottontail/)
 * Last activity: [11 years, 7 months ago](https://wordpress.org/support/topic/theme-does-not-work/#post-5364116)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
