Skip to content

Instantly share code, notes, and snippets.

Amos Lee iwillhappy1314

View GitHub Profile
@iwillhappy1314
iwillhappy1314 / qrcode.php
Created Nov 24, 2018
Endroid 生成二维码
View qrcode.php
use Endroid\QrCode\QrCode;
$qrCode = new QrCode($signature_url);
$qrCode->setMargin(0);
$html = '<img id="js-signature" src="data:image/jpeg;base64,' . base64_encode($qrCode->writeString()) . '" alt="" />';
@iwillhappy1314
iwillhappy1314 / main.scss
Last active Nov 19, 2018
WooCommerce 可变产品改为点击选择
View main.scss
.woocommerce{
.variations{
.reset_variations{
display: none;
}
.reset_variations,
select{
display: none;
}
@iwillhappy1314
iwillhappy1314 / js_filter.php
Created Jun 26, 2018
JS Filters for Wizhi Multi Filter
View js_filter.php
<div class="theme-filters">
<div class="filter-head"><i class="fa fa-map-marker-alt"></i>一键找房</div>
<?php wprs_show_filters(['area', 'mianji', 'louceng']); ?>
<div id="filter-go" class="filter-head"><i class="fa fa-search"></i> 立即搜索</div>
</div>
<script>
jQuery(document).ready(function($){
@iwillhappy1314
iwillhappy1314 / upload_from_server.php
Created Jun 6, 2016 — forked from hissy/gist:7352933
上传服务器的文件到媒体库
View upload_from_server.php
<?php
$file = '/path/to/file.png';
$filename = basename($file);
$upload_file = wp_upload_bits($filename, null, file_get_contents($file));
if (!$upload_file['error']) {
$wp_filetype = wp_check_filetype($filename, null );
$attachment = array(
'post_mime_type' => $wp_filetype['type'],
'post_parent' => $parent_post_id,
View Wizhi CMS Demo code.php
<?php
/**
* The main template file.
*
* This is the most generic template file in a WordPress theme
* and one of the two required files for a theme (the other being style.css).
* It is used to display a page when nothing more specific matches a query.
* E.g., it puts together the home page when no home.php file exists.
* Learn more: http://codex.wordpress.org/Template_Hierarchy
*
View Pure_Pure_Category_Walker.php
class Pure_Category_Walker extends Walker_Category {
function start_lvl( &$output, $depth = 0, $args = array() ) {
if ( 'list' != $args['style'] )
return;
$indent = str_repeat("\t", $depth);
$output .= "$indent<ul class='pure-menu-children'>\n";
}
You can’t perform that action at this time.