Skip to content

Instantly share code, notes, and snippets.

View filipecsweb's full-sized avatar
🏠
Working from home

Filipe Seabra filipecsweb

🏠
Working from home
View GitHub Profile
@filipecsweb
filipecsweb / functions.php
Last active April 8, 2019 01:27
Reorder WordPress administration menu items
<?php
/**
* Reorder WordPress administration menu.
*
* en_US pt_BR - Page Name
*
* Appearence (Aparência) = themes.php
* Settings (Configurações) = options-general.php
* Comments (Comentários) = edit-comments.php
* Tools (Ferramentas) = tools.php
@filipecsweb
filipecsweb / same-height.js
Last active October 12, 2016 08:49
Forcing the same height to specific elements
/**
* Define parameters to set 'where' and what 'element' will have same height.
*
* @author Filipe Seabra
* @param where element's father
* @param element selector of the elements that must have same height
*/
jQuery(window).load(function(){
function sameHeight(where, element){
var height = [];
@filipecsweb
filipecsweb / functions.php
Last active November 2, 2017 07:17
Display Simple Product SKU, in WooCommerce loop pages, before item name
<?php
/**
* Display Simple Product SKU, in WooCommerce loop pages, before item name
*
* @return void
*/
function simple_product_sku_before_loop_item_title(){
global $product;
$type = $product->product_type;
@filipecsweb
filipecsweb / functions.php
Last active December 9, 2024 21:59
WooCommerce shortcode to output product categories randomly
<?php
/**
* Create the new WooCommerce shortcode [random_product_categories] to output product categories randomly.
* Based on [product_categories] (/plugins/woocommerce/includes/class-wc-shortcodes.php).
*
* This new shortcode accepts all attributes used by [product_categories], except 'orderby' and 'order', of course.
* See more at @link https://woocommerce.com/document/woocommerce-shortcodes/.
*
* @param array $atts User defined attributes in shortcode tag.
*/