Masterpieces​
Were are 5(!) templates with that 10-lines 'empty'-code.
(Note: __() & Swedish)
<?php
if ($is_receptbelgda_protected = get_field('is_receptbelagda_page')) {
} else {
$is_receptbelgda_protected = false;
}
if ($is_receptbelgda_protected) {
echo '<div class="receptbelgda-protected">yes</div>';
} else {
echo '<div class="receptbelgda-protected">no</div>';
}
?>
<!-- 'receptbelagda' is a recipe on Swedish -->
<!-- #1 - Normal -->
<?php $is_protected = get_field('is_receptbelagda_page'); ?>
<div class="receptbelgda-protected">
<?php $is_protected ? _e('yes', 'theme') : _e('no', 'theme'); ?>
</div>
<!-- #2 - Short -->
<div class="receptbelgda-protected">
<?php ( $is_protected = get_field('is_receptbelagda_page') ) ? _e('yes', 'theme') : _e('no', 'theme'); ?>
</div>
Something...
Lorem ipsum dolor...
.title {
// no
font-family: Source Sans Pro;
// no
font-family: 'Source Sans Pro';
// better, but no
font-family: "Source Sans Pro";
// no
background-image: url(../images/search-black.svg);
}
.title {
// yes
font-family: "Source Sans Pro", sans-serif;
// yes
background-image: url("../images/search-black.svg");
}
$font-family-main: "Source Sans Pro", Arial, Helvetica, sans-serif;
.title {
// yes
font-family: $font-family-main;
}
Something...
Lorem ipsum dolor...
// bad
// that https://www.screencast.com/t/YPwvzyMW
// define('WP_DEBUG', true);
$('.single-special_services .home_services__slider, .page-template-template-special-services .home_services__slider').slick({...});
// need
Something...
Lorem ipsum dolor...
// bad
.search-results .heading-dropdown .icon,
.search-no-results .heading-dropdown .icon {
position: absolute;
top: 12px;
right: 20px;
width: 18px;
height: 18px;
background-image: url(../images/menu-plus-red.svg);
background-size: cover;
background-position: center;
background-repeat: no-repeat;
}
// need
.icon {
display: inline-block;
width: 1em; height: 1em;
background-image: url(../images/icon-default.svg);
background-repeat: no-repeat;
background-position: center;
background-size: cover;
}
.icon--plus {
background-image: url(../images/icon-plus.svg);
}
.heading-dropdown .icon { /* set position etc */ }
Something...
Lorem ipsum dolor...
// bad
<div class="row columns"></div>
<div class="row"></div>
<section class="about-us"></div>
<p class="foo-bar"></p>
<section class="cpa"></div>
// need
Something...
Lorem ipsum dolor...
// bad
<?php if (is_front_page()): ?>
<section class="hero hero-home" <?php echo $thumb?bg($thumb):''; ?>>
<span class="arrow-bounce"></span>
</section>
<?php else: ?>
<section class="hero" <?php echo $thumb?bg($thumb):''; ?>>
<span class="arrow-bounce"></span>
<?php if ($title): ?>
<div class="hero_title"><?php echo $title; ?></div>
<?php endif ?>
</section>
<?php endif ?>
// need
Something...
Lorem ipsum dolor...
// bad
.second-section-column .second-right-buttons {
padding: 30px 0;
}
.event-content h5 {
color: #0295b8;
font-size: 25px;
margin-bottom: 20px;
}
.event-content h5 a {
color: #dd2a63;
}
// need
Something...
Lorem ipsum dolor...
// bad
var sku = $(this).closest('.support_desktop-middle-item').data('sku');
if (sku) {
$('#ninja_forms_field_44_div_wrap').css({
opacity: 0,
height: 0,
margin: 0,
float: 'none',
});
$('#ninja_forms_field_35_div_wrap').css('display', 'block').find('#ninja_forms_field_35').val(sku);
$('#ninja_forms_field_35').addClass('ninja-forms-req');
} else {
$('#ninja_forms_field_35').val('---').removeClass('ninja-forms-req');
$('#ninja_forms_field_35_div_wrap').css('display', 'none');
$('#ninja_forms_field_44_div_wrap').css({
opacity: 0,
height: 0,
margin: 0,
float: 'none',
});
}
// need
Something...
Lorem ipsum dolor...
// bad
// need
masterpieces
By kostiantynpetlia
masterpieces
- 154