• Resolved con322

    (@con322)


    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

    (@con322)

    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.ww.wp.xz.cn/Forum_Welcome#Posting_Code ; it also was posted without the backticks and was likely corrupted ]

    Thread Starter con322

    (@con322)

    <?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.