Skip to content

Instantly share code, notes, and snippets.

suprsonicjetboy

Block or report user

Report or block suprsonicjetboy

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@suprsonicjetboy
suprsonicjetboy / function.php
Created Sep 5, 2018
Wordpressのページネーションを、プラグインを使わずにAjaxで実装する
View function.php
<?php
function my_wp_enqueue_scripts() {
$handle = 'get_post';
# https://developer.wordpress.org/reference/functions/is_home/
if ( is_home() ) {
wp_register_script( $handle, get_theme_file_uri( '/assets/js/get_post.js' ), array( 'jquery' ), false, true);
}
@suprsonicjetboy
suprsonicjetboy / detail_js.twig
Created Feb 21, 2018
EC-CUBE3 商品詳細ページで数量を<input>から<select>のプルダウンに変更するjQueryスクリプト
View detail_js.twig
{# Product/detail.twig #}
{% block javascript %}
<script>
(function(){
// <input>を<select>に書き換え
$('#quantity').replaceWith('<select id="quantity" name="quantity" class="form-control"><option value="0">0</option></select>');
var quantity_max = 100; // <select>の表示上限
var stock_data = {};
You can’t perform that action at this time.