Skip to content

Instantly share code, notes, and snippets.

@hothanhan
hothanhan / clearfix
Created August 23, 2014 09:04
clearfix css
.clearfix:after {
content: ".";
display: block;
clear: both;
visibility: hidden;
line-height: 0;
height: 0;
}
.clearfix {
Mở file wp-config.php
Tìm: define('WPLANG', '');
Thêm bên dưới:
define('WP_POST_REVISIONS', false );
define('AUTOSAVE_INTERVAL', 240 );
define('DISALLOW_FILE_EDIT',true);
define('WP_MEMORY_LIMIT', '64M');
@hothanhan
hothanhan / facebook-img-size.txt
Last active June 28, 2016 03:46
Kich thuoc anh facebook
1.Big picture for timeline
Đây là ảnh lớn, còn được gọi là Cover photo dành cho Facebook’s timeline.
Width: 851px
Height: 315px
2.Application icons for timeline view
Đây là những icons được trình bày trên trang fanpage của FB timeline. Nếu hình ảnh của bạn vượt quá giới hạn này, icon sẽ được resized và converted lại.
Width: 111px
@hothanhan
hothanhan / google comment - wp
Last active August 29, 2015 14:07
google comment - wp
<script src="https://apis.google.com/js/plusone.js"></script>
<div class="g-comments"
data-href="<?php echo get_permalink(); ?>"
data-width="642"
data-first_party_property="BLOGGER"
data-view_type="FILTERED_POSTMOD">
</div>
// Enable WP_DEBUG mode
define('WP_DEBUG', true);
define('WP_DEBUG_LOG', true);
define('WP_DEBUG_DISPLAY', false);
@ini_set('display_errors',0);
@hothanhan
hothanhan / Kiem tra url site _ vm
Created December 22, 2014 03:06
Kiem tra url site _ vm homephp
<?php get_header(); ?>
<div id="primary" class="content-area">
<main id="main" class="site-main" role="main">
<?php $url = get_site_url();
$homepage = "http://benhtri709.com";
if($url == $homepage) {
get_template_part( 'loop', 'homeb' ); // Get post benhtri709.
}
else{
get_template_part( 'loop', 'home' ); // Get post site.
@hothanhan
hothanhan / gist:f884700f3bee7cd3224d
Created March 28, 2015 09:14
error "The path /home/user/domains/user.com/public_html/cgi-bin cannot be traversed due to non user or apache ownership (uid or gid)"
error "The path /home/user/domains/user.com/public_html/cgi-bin cannot be traversed due to non user or apache ownership (uid or gid)"
chown -R USER:USER /home/USER/domains/DOMAIN/public_html/*
@hothanhan
hothanhan / condition cat
Created April 11, 2015 08:09
get cat id- condition cat
<?php
$cat_id = get_query_var( 'cat' );;
if ($cat_id == 1) {
get_template_part('includes/home-cat1');
} else if ($cat_id == 196) {
get_template_part('includes/home-cat1');
} else {
echo '[email protected]: ' . $cat_id;
}
@hothanhan
hothanhan / Conditional display
Created April 12, 2015 02:24
Conditional display for a single post from a category
<?php $category = get_the_category();
$firstCategory = $category[0]->cat_name; ?>
<?php
$category = get_the_category();
if ($firstCategory == 'NAME CAT1') {
get_template_part('includes/home-cat1');
} else if ($firstCategory == 'NAME CAT2') {
get_template_part('includes/home-cat2');
} else {
@hothanhan
hothanhan / .htaccess
Last active August 29, 2015 14:19 — forked from quangbahoa/.htaccess
## LEVERAGE BROWSER CACHING ##
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/jpg "access 1 year"
ExpiresByType image/jpeg "access 1 year"
ExpiresByType image/gif "access 1 year"
ExpiresByType image/png "access 1 year"
ExpiresByType text/css "access 1 month"
ExpiresByType application/pdf "access 1 month"
ExpiresByType application/x-javascript "access 1 month"