Fix: Newz’s Posts Visit Count

Fix: Newz’s Posts Visit Count

Read Time:54 Second

Issue

The view count icon, number and label generated from the Newz theme plugin are inadequately spaced.

  1. No spacing between number and word ‘view’.
  2. No spacing between icon and the text before the icon.

 

File

  1. twp-be-views-count.php
  2. style.css

 

Code

  1. twp-be-views-count.php:
    if( isset( $data['label'] ) && $data['label'] ){
        $label = '<span class="views-count-label">&nbsp;'.esc_html( $data['label'] ).'';
    }
    else{
        $label = '';
    }
  2. style.css:
    .entry-meta-item .entry-meta-icon {
        margin-right: 0.8rem;
        margin-left: 0.8rem;
    }
    .entry-meta-item .entry-meta-icon .svg-icon {
        height: 1.5rem;
        width: 1.5rem;
        vertical-align: middle;
        display: inline-block;
        margin-bottom: 0.2rem;
    }

Conclusion

  1. Adding additional space resolved the issue. Changing PHP code rather modifying CSS is logical because it is a typographical error rather than a text formatting issue.
  2. Gap between the icon and the text before was added using CSS. It is a text formatting issue.

Leave a Reply

Your email address will not be published. Required fields are marked *

Evaluation of WordPress Themes Previous post Evaluation of WordPress Themes
Tweaking Newz WordPress Theme Next post Tweaking Newz WordPress Theme