• Resolved Cristian Romanello

    (@cristian95)


    Hi πŸ™‚ Is possible to improve the displaying style of the comment meta data? Because right now they are displayed as below:

    comment details
    
    Comment meta
    
    Squadra A: aaaaaaaaaaaaa, Squadra B: bbbbbbbbbbbbb, Campionato: U13 Mas, Campo di gioco: Palestra Scuole Cosmè Tura - Via Battara 47 Quart.

    I didn’t find any plugin’s css classes, anyone clould help me? Also answering which wordpress file displays comment meta

    Many thanks
    – Chris

    https://wordpress.org/plugins/wp-comment-fields/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author N-Media

    (@nmedia)

    Hi,

    ok we will update our plugin soon and also planning to have its’ pro version with more features.

    Thread Starter Cristian Romanello

    (@cristian95)

    Thanks for your fast reply πŸ™‚

    The better display of metadata will be part of the current free plugin version? Because if not, I should looking elsewhere for another plugin, and I wouldn’t like to do it :/

    Plugin Author N-Media

    (@nmedia)

    Yes, better display will be part of FREE πŸ™‚

    Thread Starter Cristian Romanello

    (@cristian95)

    Hi πŸ™‚ I’ve just done the following modifications:

    – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – –

    /wp-content/plugins/wp-comment-fields/classes/plugin.class.php

    – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – –

    – replace this code (line 539):

    if($comment_meta){
    
    			$comment_meta_heading = 'Comment meta';		//should be get by option
    
    			$comment .= '<p><strong>'.sprintf(__('%s'), $comment_meta_heading).'</strong></p>';
    
    			foreach ($comment_meta as $index => $meta){
    
    				$comment_meta_key = $meta['data_name'];
    
    				$comment_meta_val = get_comment_meta(get_comment_ID(), $comment_meta_key, true);
    
    				if($comment_meta_val != ''){
    
    					$comment .= sprintf(__('%s: '), esc_attr($meta['title']));
    
    					$comment .= '<i>'.sprintf(__('%s'), esc_attr($comment_meta_val)).'</i>';
    
    					$comment .= ', ';
    
    				}			
    
    			}
    
    			$comment = substr($comment, 0, -2);
    
    		}

    – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – –

    – with this:

    if($comment_meta){
    
    			//$comment_meta_heading = 'Comment meta';		//should be get by option
    
    			//$comment .= '<p><strong>'.sprintf(__('%s'), $comment_meta_heading).'</strong></p>';
    
    			foreach ($comment_meta as $index => $meta){
    
    				$comment_meta_key = $meta['data_name'];
    
    				$comment_meta_val = get_comment_meta(get_comment_ID(), $comment_meta_key, true);
    
    				if($comment_meta_val != ''){
    
    					$comment .= '<p class="meta-comment-content"><span class="title">'.sprintf(__('%s: '), esc_attr($meta['title'])).'</span>';
    
    					$comment .= '<span class="detail">'.sprintf(__('%s'), esc_attr($comment_meta_val)).'</span></p>';
    
    					//$comment .= ', ';
    
    				}			
    
    			}
    
    			//$comment = substr($comment, 0, -2);
    
    		}
    
    		return $comment;
    
    	}

    – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – –

    CSS Code:

    p.meta-comment-content{margin-bottom:10px;}
    	p.meta-comment-content span.title{font-weight:bold;}
    
    	@media screen and (min-width: 800px)
    	{
    	  //classes of input boxes
    	  {width:45%; float:left; padding-right:40px;}
    
    	  #respond form input[type="text"],
    	  #respond form select,
    	  textarea#comment{width:90%!important;}
    	}
    
    	@media screen and (max-width: 560px)
    	{
    	  form#commentform.comment-form select,
    	  p.form-submit input[type="submit"]{width:100%;}
    	}
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Better metadata display’ is closed to new replies.