Title: custom admin login &amp; comment php in function file
Last modified: August 20, 2016

---

# custom admin login & comment php in function file

 *  Resolved [con322](https://wordpress.org/support/users/con322/)
 * (@con322)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/custom-admin-login-comment-php-in-function-file/)
 * So the problem is that when i inserted the code to customise the comment section
   of my blog everything work, it says in the header above the coment ‘one comment
   for…’ but it doesnt display the actual comment. However when I changed placement
   of the code it worked however i couldnt login to the admin daskboard.
 *     ```
       <?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 } ?>
   
       <?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');?>
       ```
   

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

 *  Thread Starter [con322](https://wordpress.org/support/users/con322/)
 * (@con322)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/custom-admin-login-comment-php-in-function-file/#post-3404634)
 * this is the function.php code below the above had a duplicate but deleteing it
   didnt make a difference
 * _[Way too much code for here — please see: [http://codex.wordpress.org/Forum\_Welcome#Posting\_Code](http://codex.wordpress.org/Forum_Welcome#Posting_Code);
   it also was posted without the backticks and was likely corrupted ]_
 *  Thread Starter [con322](https://wordpress.org/support/users/con322/)
 * (@con322)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/custom-admin-login-comment-php-in-function-file/#post-3404651)
 *     ```
       <?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 } ?>
   
       <?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');?>
       ```
   

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

The topic ‘custom admin login & comment php in function file’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 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/custom-admin-login-comment-php-in-function-file/#post-3404651)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
