Skip to content

Instantly share code, notes, and snippets.

add_filter('pre_get_posts', 'mvn_admin_pre_get_post');
function mvn_admin_pre_get_post($query) {
global $pagenow;
$type = 'post'; // post type ap dung
if (isset($_GET['post_type'])) {
$type = $_GET['post_type'];
}
if ('POST_TYPE' == $type && is_admin() && $pagenow == 'edit.php' && isset($_GET['KEY_FILTER_VALUE']) && $_GET['KEY_FILTER_VALUE'] != '') {
if (esc_attr($_GET['KEY_FILTER_VALUE']) == 'gia_tri_1') {
$query - > set('meta_query', array(array('key' => '_meta_key', 'value' => 'value', 'compare' => '', ), ));

Keybase proof

I hereby claim:

  • I am doiguocmoc on github.
  • I am doiguocmoc (https://keybase.io/doiguocmoc) on keybase.
  • I have a public key ASAm35dHxEC7UlJuynMLzkVKYKSzGJjoDc07kEXqGaBckQo

To claim this, I am signing this object:

<div class="menu-show">
<ul>
<li><a href="#">Điện thoại</a></li>
<li><a href="#">Máy tính</a></li>
<li><a href="#">Máy ảnh</a></li>
</ul>
</div>
<div class="more-menu">
<div class="more-button-menu"><a><i class="fa fa-bars" aria-hidden="true"></i><p>MENU</p></a>
<div class="menu-hide" style="display:none">
@doiguocmoc
doiguocmoc / 4759-5
Last active November 18, 2016 21:18
.quan-tam{height:346px;margin-bottom:20px;border:1px solid #e6e6e6}
.quan-tam h3.heading{font-size:24px;margin-bottom:0}
.quan-tam table td,table th{border-width:0;padding:5px 10px}
.quan-tam .gsc-webResult .gsc-result{padding:0!important}
.quan-tam .gsc-cursor{width:100%;text-align:center;float:left;font-size:20px;margin-top:15px}
.quan-tam .gs-result .gs-title,.quan-tam .gs-result .gs-title *{text-decoration:none!important;color:#FF9800!important}
.quan-tam .gs-result .gs-title a{text-decoration:none!important;color:#FF9800!important}
.quan-tam .gs-result a.gs-visibleUrl,.quan-tam .gs-result .gs-visibleUrl{font-weight:700}
.quan-tam .gs-bidi-start-align.gs-snippet{line-height:20px;margin:5px 0 0}
.quan-tam .gsc-results.gsc-webResult{width:100%}
<div class="quan-tam">
<h3 class="heading">Bạn nên xem</h3>
<div id='cse-search-form' style='width: 100%;height:300px;overflow-y: scroll;'>Đang tải...</div>
<script src='https://www.google.com/jsapi' type='text/javascript'></script>
<script type='text/javascript'>
google.load('search', '1', {language: 'vi'});
google.setOnLoadCallback(function() {
var customSearchControl = new google.search.CustomSearchControl("004032395659677657430:ekrwef_0m7c");
customSearchControl.setResultSetSize(google.search .Search.FILTERED_CSE_RESULTSET);
customSearchControl.draw('cse-search-form');
<div class="quan-tam">
<h3 class="heading">Bạn nên xem</h3>
<div id='cse-search-form' style='width: 100%;height:300px;overflow-y: scroll;'>Đang tải...</div>
<script src='http://www.google.com/jsapi' type='text/javascript'></script>
<script type='text/javascript'>
google.load('search', '1', {language: 'vi'});
google.setOnLoadCallback(function() {
var customSearchControl = new google.search.CustomSearchControl("004032395659677657430:ekrwef_0m7c");
customSearchControl.setResultSetSize(google.search .Search.FILTERED_CSE_RESULTSET);
customSearchControl.draw('cse-search-form');
<div class="quan-tam">
<h3 class="heading">Bạn nên xem</h3>
<div id='cse-search-form' style='width: 100%;height:300px;overflow-y: scroll;'>Đang tải...</div>
<script src='http://www.google.com/jsapi' type='text/javascript'></script>
<script type='text/javascript'>
google.load('search', '1', {language: 'vi'});
google.setOnLoadCallback(function() {
var customSearchControl = new google.search.CustomSearchControl("xxxxxxxxxxx");
customSearchControl.setResultSetSize(google.search .Search.FILTERED_CSE_RESULTSET);
customSearchControl.draw('cse-search-form');
<script>
(function() {
var cx = '004032395659677657430:ekrwef_0m7c';
var gcse = document.createElement('script');
gcse.type = 'text/javascript';
gcse.async = true;
gcse.src = 'https://cse.google.com/cse.js?cx=' + cx;
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(gcse, s);
})();