MOSMMO Code 2020

Wordpress

ON / OFF CHẾ ĐỘ ĐỌC BAN ĐÊM DARK MODE:

Nói là làm website / viết blog bằng WordPress không cần biết code chứ nếu bạn muốn như ý không phải là dễ. Nhất là mấy bạn cầu toàn. Vì vậy nếu bạn mới mày mò viết blog kiếm tiền thì nên tranh thủ học về WordPress càng nhanh càng tốt. Và một trong những khóa học như vậy là của Duy trên KTcity. Thay vì mày mò kỹ thuật thì bạn nên dành thời gian đó để sáng tạo content thì mới nhanh kiếm tiền được. Chúc bạn thành công!

Preload Google font (header.php trước </head>)

<link rel=”preload” href=”/wp-content/plugins/old-monarch/css/fonts/monarch.ttf” as=”font” type=”font/ttf” crossorigin=”anonymous”>

Redirect HTTP to HTTPS in Apache (.htaccess)

RewriteEngine On RewriteCond %{HTTPS} off RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

Minify HTML WordPress (functions.php/child theme)

Source: zuziko.com

class FLHM_HTML_Compression{protected $flhm_compress_css = true;protected $flhm_compress_js = true;protected $flhm_info_comment = true;protected $flhm_remove_comments = true;protected $html;public function __construct($html){if (!empty($html)){$this->flhm_parseHTML($html);}}public function __toString(){return $this->html;}protected function flhm_bottomComment($raw, $compressed){$raw = strlen($raw);$compressed = strlen($compressed);$savings = ($raw-$compressed) / $raw * 100;$savings = round($savings, 2);return ‘<!–HTML compressed, size saved ‘.$savings.’%. From ‘.$raw.’ bytes, now ‘.$compressed.’ bytes–>’;}protected function flhm_minifyHTML($html){$pattern = ‘/<(?<script>script).*?</scripts*>|<(?<style>style).*?</styles*>|<!(?<comment>–).*?–>|<(?<tag>[/w.:-]*)(?:”.*?”|’.*?’|[^’”>]+)*>|(?<text>((<[^!/w.:-])?[^<]*)+)|/si’;preg_match_all($pattern, $html, $matches, PREG_SET_ORDER);$overriding = false;$raw_tag = false;$html = ”;foreach ($matches as $token){$tag = (isset($token[‘tag’])) ? strtolower($token[‘tag’]) : null;$content = $token[0];if (is_null($tag)){if ( !empty($token[‘script’]) ){$strip = $this->flhm_compress_js;}else if ( !empty($token[‘style’]) ){$strip = $this->flhm_compress_css;}else if ($content == ‘<!–wp-html-compression no compression–>’){$overriding = !$overriding; continue;}else if ($this->flhm_remove_comments){if (!$overriding && $raw_tag != ‘textarea’){$content = preg_replace(‘/<!–(?!s*(?:[if [^]]+]|<!|>))(?:(?!–>).)*–>/s’, ”, $content);}}}else{if ($tag == ‘pre’ || $tag == ‘textarea’){$raw_tag = $tag;}else if ($tag == ‘/pre’ || $tag == ‘/textarea’){$raw_tag = false;}else{if ($raw_tag || $overriding){$strip = false;}else{$strip = true; $content = preg_replace(‘/(s+)(w++(?<!baction|balt|bcontent|bsrc)=””)/’, ‘$1’, $content); $content = str_replace(‘ />’, ‘/>’, $content);}}} if ($strip){$content = $this->flhm_removeWhiteSpace($content);}$html .= $content;} return $html;} public function flhm_parseHTML($html){$this->html = $this->flhm_minifyHTML($html);if ($this->flhm_info_comment){$this->html .= “n” . $this->flhm_bottomComment($html, $this->html);}}protected function flhm_removeWhiteSpace($str){$str = str_replace(“t”, ‘ ‘, $str);$str = str_replace(“n”, ”, $str);$str = str_replace(“r”, ”, $str);while (stristr($str, ‘ ‘)){$str = str_replace(‘ ‘, ‘ ‘, $str);} return $str;}}function flhm_wp_html_compression_finish($html){return new FLHM_HTML_Compression($html);}function flhm_wp_html_compression_start(){ob_start(‘flhm_wp_html_compression_finish’);}add_action(‘get_header’, ‘flhm_wp_html_compression_start’);

Logo flash light throught

#logo:before {content: “”;position: absolute;left: 5px;top: 30px;width: 100px;height: 25px;background-color: rgba(255,255,255,.5);-webkit-transform: rotate(-45deg);-moz-transform: rotate(-45deg);-ms-transform: rotate(-45deg);-o-transform: rotate(-45deg);transform: rotate(-45deg);-webkit-animation: searchLights 1.5s ease-out 1s infinite;-o-animation: searchLights 1.5s ease-out 1s infinite;animation: searchLights 1.5s ease-out 1s infinite;}@keyframes searchLights {from {left: -15px;}to {left: 200px;}}

Related posts:

/* Related Posts *//* the full list */.crp_related ul li {list-style-type: none;float: left;margin: 20px 10px;width: 300px;height: 300px;padding-left: 0px;}/* each related post box */.crp_related ul li a {display: block;word-wrap: break-word;padding: 10px 10px;float: left;box-shadow: 0 0 40px 0px #f5f5f5;width: 280px;text-decoration: none;height: 260px;}/* moving the mouse over a related posts area. */.crp_related ul li a:hover {background: #e6fff5;}/* The related posts image */.crp_related ul li img {margin: 0 0;}.post-image {max-width:360px;max-height:240px;}

CSS

/* nen va mau meta*/.met-d {background: none;color: #3ac9c9;}.cnt .met-c {background: #3ac9c9;padding: 12px 5px;}.ind .bSe .awr .awr-i {position: initial;}@media (min-width: 300px)[] .tve_pg_container {border: 0px solid rgb(236,228,228)!important;border-radius: 4px;overflow: hidden;background-image: none!important;}/*box-shadow center post image*/.aligncenter {box-shadow: 0 10px 40px 10px #ccc;}/*thanh menu*/#floating_menu header {padding: 0 0;}/*breadcrumb*/.brd ul li:last-of-type a {color: #3ac9c9;text-decoration: none;}.brd {background: none;padding: 12px 20px;margin-bottom: 20px;position: unset;}.brd ul li:last-of-type {color: inherit;}header nav>ul.menu>li.current-menu-item>a, header nav>ul.menu>li.current_page_item>a, header nav>ul.menu>li.current-page-item>a, header nav>ul#menu>li.current-menu-item>a, header nav>ul#menu>li.current_page_item>a, header nav>ul#menu>li.current-page-item>a {color: #3ac9c9;}.thrv_post_grid .tve_post .tve_pg_container {height: 100%;-webkit-box-sizing: border-box;box-sizing: border-box;border: none;-webkit-box-shadow: 0 0 0px 0px rgba(0,0,0,.9);box-shadow: none;}.tve_pg_container {border: 0px solid rgb(236, 228, 228) !important;background-image: none !important;}/*edit category page*/.wrp.cnt.gin .gr-i .fwit {background-size: cover;background-position: center;background-repeat: no-repeat;height: 222px;margin: 10px 10px;width: 95%;}.wrp.cnt.gin .gr-i .entry-title {font-size: 15px;padding-right: 20px;font-weight: 400;}.pl-c {display: none;}.wrp.cnt.gin .mrb, .wrp.cnt.gin .mre {display: none;margin: 0 auto;position: absolute;bottom: 20px;text-align: center;left: 0;right: 0;}article.gr-i {height: 340px;box-shadow: 0 0 20px 1px #ccc;}.wrp.cnt.gin .gr-i {border: 0px solid #ebe9e9;}section[id*=’recent-posts’] ul li a, .tabs_widget .scTC a, .rw a {font-size: 16px;line-height: 26px;}.tabs_widget .scTC .txt i {color: #3ac9c9; }.tabs_widget .tabs {border: none;}.sAsCont .sAs section ul li {border-bottom: 1px solid #f3f3f3;text-align: center;}.sAsCont .sAs section ul li a {color: #3ac9c9;}.sAsCont .sAs {border: none;width: 28.5%;}.pgn>span.current, .pgn>a.current {background: #00a63f;border: 1px solid #00a63f;color: #fff;}.thrv_post_grid .tve_post_grid_vertical .tve_post_width_1 .tve_post_grid_image_wrapper {height: 240px;width: 360px;float: left;}footer {font-size: 15px;color: inherit;padding: 0;line-height: 26px;}.t-c header .h-i, .c-c header .h-i {border-bottom: none;}/*font-size breadcrumb*/.brd ul li {font-size: 15px;}/* trich dan*/.bSe blockquote {border-left: 3px solid #00a63f;background: #ffffff;}.pulQ:before {color: #00a63f;}.bSeCont .bSe {border-left: none;width: 70%;}.awr.h-me .awr-i {padding-left: 0;}.sAsCont .sAs section {margin: 20px 0px 20px 20px;}.tabs_widget .tabs li.tS:after {width: 100%;background: #3ac9c9;}.tabs_widget .scTC {margin-top: 20px;padding: 0 10px;}.tabs_widget.theme-pressive-tabs .scTC .tim .wti {height: 100px;width: 100px;margin: 0;}.scT {border: solid 1px #ccc;}section#widget_thrive_leads-2 {margin-top: 0px;}section#widget_thrive_tabs-2 {margin-top: 0px;}.s-b .s-bb:before {border-left: 0px solid rgba(0,0,0,.06);}@media only screen and (max-width: 600px) {crp_related {padding-left: 0px;}}.ind .fwit:before, .gin .fwit:before, .mry .fwit:before {color: rgba(255, 255, 255, 0);}p {color: #383838;font-size: 16px;margin: 17px auto;letter-spacing: 0.3px;}.bSe h1, .b-tt .entry-title, .ind .bSe .awr .awr-i .entry-title {font-size: 40px;color: #333!important;}.bSe ul, .bSe ol {color: #383838;font-size: 18px;}.ind .fwit:after, .gin .fwit:after, .mry .fwit:after {width: 0%;}.awr .awr-i .tve-c {position: relative;margin: 0 0 0 90px;}.bSe h2, .b-tt h2 {color: #333;font-size: 25px;font-weight: 400;}@media only screen and (max-width: 540px) {.awr .awr-i .tve-c {margin: 0 5px 0 0;}.wrp {width: 95%;}}img.aligncenter.size-full.wp-image-28054 {box-shadow: none;}img.aligncenter.size-full.wp-image-28024 {box-shadow: none;}img.aligncenter.wp-image-28074.size-full {box-shadow: none;}.bSe h3, .b-tt h3 {color: #333;font-weight: 400;font-size: 19px;}.bSe ul {padding-left: 15px;}.posts-and-tabs-styling .txt, .widget_thrive_related.rw .txt, .tabs_widget.theme-pressive-tabs .scTC .txt {width: 94%;}}/*hi*/.crp_related ul li {margin-bottom: 0px;margin-top: 0px;}.crp_related {margin-top: 20px;}.b-tt.b-tl {color: #fff;background: #f5f5f5;box-shadow:none;}.lhgh {color: #fff !important;padding: 5px 5px;}.thrivecb.green {background: #e0f2f1;color: #00796b;}img { image-rendering: optimizeSpeed; /* */image-rendering: -moz-crisp-edges; /* Firefox */image-rendering: -o-crisp-edges; /* Opera */image-rendering: -webkit-optimize-contrast; /* Chrome (and Safari) */image-rendering: optimize-contrast; /* CSS3 Proposed */-ms-interpolation-mode: nearest-neighbor; /* IE8+ */ }/*quan trong*/@media only screen and (max-width: 540px) and (min-width: 481px) {.cnt .bSe.right, .cnt .bSe.left {width: 430px;}.cnt .sAs.left, .cnt .sAs.right {width: 410px;}}@media only screen and (max-width: 480px) and (min-width: 441px) {.cnt .bSe.right, .cnt .bSe.left {width: 410px;}.cnt .sAs.left, .cnt .sAs.right {width: 390px;}}@media only screen and (max-width: 440px) and (min-width: 411px) {.cnt .bSe.right, .cnt .bSe.left {width: 380px;}.cnt .sAs.left, .cnt .sAs.right {width: 350px;}.t-c .b-tt, .c-c .b-tt, .c-t .b-tt {padding: 0 0 50px 0;}}@media only screen and (max-width: 410px) and (min-width: 381px) {.cnt .bSe.right, .cnt .bSe.left {width: 350px;}.cnt .sAs.left, .cnt .sAs.right {width: 320px;}}@media only screen and (max-width: 380px) {.cnt .bSe.right, .cnt .bSe.left {width: 320px;}.cnt .sAs.left, .cnt .sAs.right {width: 95%;}}@media only screen and (max-width: 380px) {.cnt .sAs.left, .cnt .sAs.right {width: 95%;}.crp_related ul li a {width: 250px;}}.thrivecb.blue {background: #e1f5fe;color: #01579b;}.awr .meta {top: 20px;border:solid 3px #3ac9c9;}.gin .awr.h-me .meta, .mry .awr.h-me .meta {top: 0;}.wrp.cnt.gin .bSe {top: 20px;}.thrv_wrapper.tve_image_caption {box-shadow: 0 0 20px 20px #f3f3f3;margin-top: 17px;margin-bottom: 17px;}.menu-menu-phu-container {color: #4CAF50;}.fmw {background: #f5f5f5;}/*mau copyright*/.fmm p {color: #9E9E9E;max-width: 100%;font-size:15px;margin: 0 auto;}/*mau menu phu*/.fmm a {color: #9E9E9E;}.fmm {background: #000;}.body {margin: 0;}/*mau chu caption*/media (min-width: 300px)#tve_editor [] {color: #9e9e9e;}/*styled list*/.thrv_wrapper {margin-top: 10px;margin-bottom: 10px;}/*gach duoi footer*/footer section ul li {border-bottom: 1px dotted #f3f3f3;}/* phan trang footer */.scn {background: none;border: none;}h2 {margin: 15px auto;}.thrv-button.thrv_wrapper, .thrv-button-group-item.thrv_wrapper {margin: 15px auto;}h3 {margin: 17px auto;}.code-block.code-block-1 {background: lightyellow;padding: 10px 20px;}img.alignnone.size-full.wp-image-30130 {margin: auto;}#tve_editor > div:nth-child(3) > div > p:nth-child(4) > a {background: red;color: white;padding: 5px 5px;text-decoration: none;}#tve_editor > div:nth-child(1) > div > p:nth-child(4) > a {background: red;color: white;padding: 5px 5px;text-decoration: none;}#tve_editor > div:nth-child(2) > div > p:nth-child(4) > a {background: red;color: white;padding: 5px 5px;text-decoration: none;}#tve_editor > div:nth-child(1) > div.tve_shortcode_rendered > div.code-block.code-block-1 > p:nth-child(4) > a {background: red;color: white;padding: 5px 5px;text-decoration: none;}#tve_editor > div:nth-child(1) > div > p:nth-child(8) > a {background: red;color: white;padding: 5px 5px;text-decoration: none;}#tve_editor > div:nth-child(3) > div > p:nth-child(8) > a {background: red;color: white;padding: 5px 5px;text-decoration: none;}.bSe ul li, .bSe ol li {margin-bottom: 0;font-size:16px;line-height: 34px;}.thrv_responsive_video.thrv_wrapper.rv_style_lifted_style4 {margin-bottom: 0;}.awr .awr-i .tve-c {padding-top: 0;}.thrv_wrapper.thrv-styled_list {margin: 0 auto;padding: 0 0;}.tcb-styled-list-icon-text {line-height: 30px;}#toc_container {margin: 20px 0 20px 0;}.bSe a, .cnt article a {text-decoration: underline;color: #3ac9c9;}.cnt article h2.entry-title a {text-decoration: none;}span.crp_title {color: #000;font-size:16px;}.wrp.cnt.gin .bSeCont .gr-i {padding: 0 0;}footer section {margin: 25px auto;}.colm {margin-bottom: 0px;}@media only screen and (min-width: 768px) {#logo:before {content: “”;position: absolute;left: 5px;top: 30px;width: 80px;height: 20px;background-color: rgba(255,255,255,.5);-webkit-transform: rotate(-45deg);-moz-transform: rotate(-45deg);-ms-transform: rotate(-45deg);-o-transform: rotate(-45deg);transform: rotate(-45deg);-webkit-animation: searchLights 1.5s ease-out 1s infinite;-o-animation: searchLights 1.5s ease-out 1s infinite;animation: searchLights 1.5s ease-out 1s infinite;}@keyframes searchLights {from {left: -15px;}to {left: 200px;}}.rltpi {margin-left:90px;}}span.at-icon-wrapper {border-radius: 90%!important;}.brd ul li a {color: #3ac9c9;}.brd ul li:first-of-type {color: inherit;}.brd ul li:before {color: #3ac9c9;}#wpcomm .wc_comm_form.wc_main_comm_form .wc-field-textarea .wpdiscuz-textarea-wrap textarea {font-size: 16px;}@media only screen and (max-width: 774px) {header .hsm span {font-family: inherit;}}.sAsCont .ttl:after {background: #00a63f;bottom: -8px;width: 50%;}.sAsCont .ttl {font-size:16px;}header ul.menu > li.h-cta > a {color: #3ac9c9!important;}header ul.menu > li.h-cta > a:hover {background: #3ac9c9;}header ul.menu > li.h-cta > a {border-color: #3ac9c9;}@media only screen and (max-width: 774px) {header .hsm span:after {background: #3ac9c9;}}body {-webkit-font-smoothing: antialiased;-moz-osx-font-smoothing: grayscale;}@media only screen and (max-width: 768px) {.bSe h1, .b-tt .entry-title, .ind .bSe .awr .awr-i .entry-title {font-size: 32px;box-shadow:none:}.rltpi {width: 90%;margin: auto;}body .a-tabs {width: 90%;margin: auto;}}.fmm .fm-m ul li:before {color: #3ac9c9;}.cnt p, .tve-c {line-height: 34px;}.rltpi p {font-size: 16px;}.rltpi h5 {border-bottom:none;}.rltpi .rlt-i:before {display:none;}.bSeCont .rltpi .rlt:nth-of-type(2n+1), .bpd .rltpi .rlt:nth-of-type(2n+1) {box-shadow: 0 0 10px 0px #ddd;}.bSeCont .rltpi a:nth-child(2n+1), .bpd .rltpi a:nth-child(2n+1) {box-shadow: 0 0 10px 0px #ddd;}.rltpi p {margin-left: 10px;}.rltpi a {margin: 0 24px 24px 0;}.rltpi .rlt-i {margin: 5px 5px;}.rltpi {padding-top: 0;}.bSeCont .rltpi .rlti {height: 200px;}.cnt {box-shadow:none;}p.ifp {font-size: 16px;}

Bài viết liên quan

Trả lời

Email của bạn sẽ không được hiển thị công khai. Các trường bắt buộc được đánh dấu *