Skip to content

Instantly share code, notes, and snippets.

View rabbitinblack's full-sized avatar

Sittipong Wiboonsirichai rabbitinblack

View GitHub Profile
@rabbitinblack
rabbitinblack / reset.css
Created December 8, 2023 03:20
Simply Reset CSS
*,
*::before,
*::after {
box-sizing: border-box;
}
* {
margin: 0;
padding: 0;
font: inherit;
@rabbitinblack
rabbitinblack / limit_length_breadcrumb_title.php
Last active February 12, 2021 05:32
Limit length of title in Breadcrumb NavXT plugin.
/**
* This function uses with Breadcrumb NavXT.
* This function uses for limit length of title in breadcrumb.
* Put this code in functions.php
*/
function limit_length_breadcrumb_title( $title, $type, $id ) {
$length = 50;
$title = mb_strimwidth($title, 0, $length, '...');
return $title;
<?php
$big = 999999999; // need an unlikely integer
echo paginate_links( array(
'base' => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ),
'format' => '?paged=%#%',
'current' => max( 1, get_query_var('paged') ),
'total' => $the_query->max_num_pages
) );
?>
@media print {
}
elseif ( is_singular() && $template = get_singular_template() ) :
/**
* Retrieve path of singular template in current or parent template.
*
* The template path is filterable via the 'singular_template' hook.
*
* @since 4.3.0
*
* @see get_query_template()
*
* @return string Full path to singular template file
@rabbitinblack
rabbitinblack / mo-add-to-cart.php
Last active August 29, 2015 14:06
Modified WooCommerce Add to cart Button Auto add product to cart
<?php
/**
* Loop Add to Cart
*
* @author WooThemes
* @package WooCommerce/Templates
* @version 2.1.0
*/
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
@rabbitinblack
rabbitinblack / add-to-cart.php
Last active August 29, 2015 14:06
WooCommerce Default Add to cart File
<?php
/**
* Loop Add to Cart
*
* @author WooThemes
* @package WooCommerce/Templates
* @version 2.1.0
*/
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
@rabbitinblack
rabbitinblack / WordPress:PluginHeader
Created July 8, 2014 02:12
Wordpress : Plugin Header Comment
<?php
/**
* Plugin Name:
* Plugin URI:
* Description:
* Version: 1.0
* Author: Rabbitinblack
* Author URI: http://www.rabbitinblack.com
* License: GPL2
*/
<?php
add_action('after_setup_theme', 'change_plugin_image_size');
function change_plugin_image_size() {
remove_image_size('plugin-image');
add_image_size('plugin-image', 300, 150, true);
}
?>