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.
- No spacing between number and word ‘view’.
- No spacing between icon and the text before the icon.
File
- twp-be-views-count.php
- style.css
Code
- twp-be-views-count.php:
if( isset( $data['label'] ) && $data['label'] ){
$label = '<span class="views-count-label"> '.esc_html( $data['label'] ).'';
}
else{
$label = '';
} - 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
- 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.
- Gap between the icon and the text before was added using CSS. It is a text formatting issue.