Title: function error (what wrong)
Last modified: August 20, 2016

---

# function error (what wrong)

 *  [con322](https://wordpress.org/support/users/con322/)
 * (@con322)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/function-error-what-wrong/)
 * the following code works however for the comments function it says the post has
   three or whatever but doesnt display the comments below however if i change the
   placement of the code it works but then i carnt login could you tell me what 
   wrong and how to correct it
 *     ```
       <?php 
   
       function wpbootstrap_scripts_with_jquery() {
       // Register the script like this for a theme:
       wp_register_script( 'custom-script', get_template_directory_uri() . '/bootstrap/js/bootstrap.js', array( 'jquery' ) );
       // For either a plugin or a theme, you can then enqueue the script:
       wp_enqueue_script( 'custom-script' ); } add_action( 'wp_enqueue_scripts', 'wpbootstrap_scripts_with_jquery' );
       if ( function_exists('register_sidebar') ) register_sidebar(array( 'before_widget' => '', 'after_widget' => '', 'before_title' => '<h3>', 'after_title' => '</h3>', ));
   
       // Customize login styles
       function shailan_custom_login_styles(){
       ?> 
   
       <?php //this function will be called in the next section
       function advanced_comment($comment, $args, $depth) {
          $GLOBALS['comment'] = $comment; ?>
   
       <li <?php comment_class(); ?> id="li-comment-<?php comment_ID() ?>">
          <div class="comment-author vcard">
            <?php echo get_avatar($comment,$size='48',$default='<path_to_url>' ); ?>
              <div class="comment-meta"<a href="<?php the_author_meta( 'user_url'); ?>"><?php printf(__('%s'), get_comment_author_link()) ?></a></div>
              <small><?php printf(__('%1$s at %2$s'), get_comment_date(),  get_comment_time()) ?><?php edit_comment_link(__('(Edit)'),'  ','') ?></small>
            </div>
            <div class="clear"></div>
   
            <?php if ($comment->comment_approved == '0') : ?>
              <em><?php _e('Your comment is awaiting moderation.') ?></em>
              <br />
            <?php endif; ?>
   
            <div class="comment-text">
                <?php comment_text() ?>
            </div>
   
          <div class="reply btn btn-primary">
             <?php comment_reply_link(array_merge( $args, array('depth' => $depth, 'max_depth' => $args['max_depth']))) ?>
          </div>
          <div class="clear"></div>
       <?php } ?>
   
       <style type="text/css">
       /* Change login page background */
       /* Make sure you change image paths to yours */
       body.login{ background: url("<?php echo get_stylesheet_directory_uri(); ?>/img/bg.png") 50% -250px repeat fixed !important; }
   
       /* Make sure you change image paths to yours */
       body.login h1 a { background: url("<?php echo get_stylesheet_directory_uri(); ?>/img/logo1.png") no-repeat top center; height:75px; width:379px; border-radius: 5px; margin-left:8px;
           -moz-box-shadow: 0 0 5px 5px #222;
           -webkit-box-shadow: 0 0 5px 5px#222;
           box-shadow: 0 0 5px 5px #222;
           border: solid;
           border-width: 1px;
           border-color: #fff;
           margin-bottom: 25px;
           background-size: 100% 100%;
   
         }
   
       /* Optional : Change link color & shadow if needed */
       .login #nav a, .login #backtoblog a { color: #999!important; text-decoration:none; text-shadow:#000 1px 1px 0; }
       .login #nav a:hover, .login #backtoblog a:hover { color: #fff!important; text-decoration:none; text-shadow:#000 1px 1px 0; }
   
       .login form{
           background: url("<?php echo get_stylesheet_directory_uri(); ?>/img/login_form_bg.jpg");
           background-size: 100% 100%;
           background-repeat: no-repeat;
           -moz-box-shadow: 0 0 5px 5px #222;
           -webkit-box-shadow: 0 0 5px 5px#222;
           box-shadow: 0 0 5px 5px #222;
       }
       }
   
       </style><?php
       }
       add_action('login_head', 'shailan_custom_login_styles');?>
       ```
   

The topic ‘function error (what wrong)’ is closed to new replies.

 * 0 replies
 * 1 participant
 * Last reply from: [con322](https://wordpress.org/support/users/con322/)
 * Last activity: [13 years, 4 months ago](https://wordpress.org/support/topic/function-error-what-wrong/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
