Skip to content

Instantly share code, notes, and snippets.

@lvoddat95
lvoddat95 / free-database-hosting.md
Created June 24, 2021 03:36 — forked from bmaupin/free-database-hosting.md
Free database hosting
@lvoddat95
lvoddat95 / editor-style.css
Created May 25, 2019 03:03 — forked from WPsites/editor-style.css
WordPress tinymce style dropdown
/*
editor styles
*/
.Bold{
font-weight:bold;
}
.Medium{
@lvoddat95
lvoddat95 / vc_custom_icon_set.php
Created July 26, 2018 04:21 — forked from zecka/vc_custom_icon_set.php
Add a custom icon set from icomoon to visual composer vc_icon shortcode
<?php
// Add new custom font to Font Family selection in icon box module
function zeckart_add_new_icon_set_to_iconbox( ) {
$param = WPBMap::getParam( 'vc_icon', 'type' );
$param['value'][__( 'IcoMoon', 'total' )] = 'icomoon';
vc_update_shortcode_param( 'vc_icon', $param );
}
add_filter( 'init', 'zeckart_add_new_icon_set_to_iconbox', 40 );
// Get The Page ID You Need
get_option( 'woocommerce_shop_page_id' );
get_option( 'woocommerce_cart_page_id' );
get_option( 'woocommerce_checkout_page_id' );
get_option( 'woocommerce_pay_page_id' );
get_option( 'woocommerce_thanks_page_id' );
get_option( 'woocommerce_myaccount_page_id' );
get_option( 'woocommerce_edit_address_page_id' );
get_option( 'woocommerce_view_order_page_id' );
get_option( 'woocommerce_terms_page_id' );
@lvoddat95
lvoddat95 / gist:ee1d278728fe951fdd937faa9e7d33a6
Created November 9, 2017 08:47 — forked from Frithir/gist:cd109c4b4dd2c0c39e05
Wordpress Add drop dwon for custom tax
// Add drop dwon for custom tax
function restrict_books_by_genre() {
global $typenow;
$post_type = 'resource'; // change HERE
$taxonomy = 'resource_cats'; // change HERE
if ($typenow == $post_type) {
$selected = isset($_GET[$taxonomy]) ? $_GET[$taxonomy] : '';
$info_taxonomy = get_taxonomy($taxonomy);
wp_dropdown_categories(array(
'show_option_all' => __("Show All {$info_taxonomy->label}"),
@lvoddat95
lvoddat95 / gist:9fe8f8633737c53394c8078f1b264f92
Created July 13, 2017 01:56 — forked from thachpham92/gist:d57b18cf02e3550acdb5
Tất cả các tham số trong WP_Query
// Source: https://gist.github.com/luetkemj/2023628
// Xem hướng dẫn WP_Query toàn tập: http://goo.gl/kRpzTz
<?php
$args = array(
//////Author Parameters - Tham số lấy bài viết theo tác giả
//http://codex.wordpress.org/Class_Reference/WP_Query#Author_Parameters
'author' => '1,2,3,', //(int) - Các ID tác giả cần lấy bài viết (thêm dấu - vào để loại trừ tác giả, ví dụ: -14, -20)
'author_name' => 'luetkemj', //(string) - Lấy bài viết dựa theo tên nick name của tác giả
'author__in' => array( 2, 6 ), //(array) - Lấy bài dựa theo ID của tác giả