Skip to content

Instantly share code, notes, and snippets.

View jjbbrr's full-sized avatar

Julian Rosser jjbbrr

View GitHub Profile
@JiveDig
JiveDig / remove-tinymce-editor-buttons.php
Last active February 24, 2023 06:00
Remove buttons/items from the WordPress TinyMCE editor
<?php
/**
* Removes buttons from the first row of the tiny mce editor
*
* @link http://thestizmedia.com/remove-buttons-items-wordpress-tinymce-editor/
*
* @param array $buttons The default array of buttons
* @return array The updated array of buttons that exludes some items
*/
add_filter( 'mce_buttons', 'jivedig_remove_tiny_mce_buttons_from_editor');
@mizner
mizner / wp-query-posts-per-page-by-category.php
Created April 18, 2016 05:19
WP Query posts per page by category
<?php
$the_query = new WP_Query(array(
'category_name' => 'featured',
'posts_per_page' => '3'
));
while ($the_query->have_posts()) : $the_query->the_post(); ?>
<div class="post-container">
<?php the_post_thumbnail( 'medium' ) ?>
<h3><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></h3>
<p><?php the_excerpt(); ?></p>
@maxrice
maxrice / wc-hide-coupons-cart-checkout.php
Created January 21, 2014 23:43
WooCommerce - hide the coupon form on the cart or checkout page, but leave coupons enabled for use with plugins like Smart Coupons and URL Coupons
<?php
// hide coupon field on cart page
function hide_coupon_field_on_cart( $enabled ) {
if ( is_cart() ) {
$enabled = false;
}
return $enabled;