Skip to content

Instantly share code, notes, and snippets.

View aronmoshe-m's full-sized avatar
:shipit:

Aron aronmoshe-m

:shipit:
  • Percent Pledge // Well-Made Digital
  • California
View GitHub Profile
@esteedqueen
esteedqueen / fix_rbenv.md
Last active April 14, 2024 00:15
How to fix rbenv: version `x.x.x` is not installed

So, you just cloned an existing project's repo and you run bundle install but you got the error: rbenv: version x.x.x is not installed....

What the issue means? The project uses a specific ruby version that you do not have on your system.

Here's how to fix it:

  • Install the Ruby build for the specified version using:
rbenv install x.x.x
@mdang
mdang / RAILS_CHEATSHEET.md
Last active April 13, 2024 15:36
Ruby on Rails Cheatsheet

Ruby on Rails Cheatsheet

Architecture

Create a new application

Install the Rails gem if you haven't done so before

@rickrduncan
rickrduncan / wordpress-functionality-plugin.php
Last active September 29, 2019 01:52
This WordPress functionality plugin contains code snippets that tweak WordPress core and do not contain theme specific functionality. This is code that I run on every single website I build using WordPress.
<?php
/**
* Plugin Name: WordPress Functionality Plugin
* Plugin URI: http://rickrduncan.com/wordpress/functionality-plugin
* Description: Core WordPress customizations that are theme independent.
* Author: Rick R. Duncan - B3Marketing, LLC
* Author URI: http://rickrduncan.com
*
*
* Version: 1.0.0
@DevinWalker
DevinWalker / gist:6fb2783c05b46a2ba251
Created April 17, 2015 17:31
WordPress: Loop through Categories and Display Posts Within
<?php
/*
* Loop through Categories and Display Posts within
*/
$post_type = 'features';
// Get all the taxonomies for this post type
$taxonomies = get_object_taxonomies( array( 'post_type' => $post_type ) );
foreach( $taxonomies as $taxonomy ) :
@kevinwhoffman
kevinwhoffman / loop-custom.php
Last active April 8, 2022 11:22
WordPress - Custom Post Type Loop
<?php
$loop = new WP_Query( array(
'post_type' => 'Property',
'posts_per_page' => -1
)
);
?>
<?php while ( $loop->have_posts() ) : $loop->the_post(); ?>
@DevinWalker
DevinWalker / remove-rev-slider-metabox.php
Created May 14, 2014 20:32
This code removed the Revolution Slider metabox on pages, posts and CTPs
/**
* Remove Rev Slider Metabox
*/
if ( is_admin() ) {
function remove_revolution_slider_meta_boxes() {
remove_meta_box( 'mymetabox_revslider_0', 'page', 'normal' );
remove_meta_box( 'mymetabox_revslider_0', 'post', 'normal' );
remove_meta_box( 'mymetabox_revslider_0', 'YOUR_CUSTOM_POST_TYPE', 'normal' );
}
@bhongy
bhongy / Wordpress: Do if the_content is not empty
Last active September 15, 2023 03:36
Wordpress: Check if the_content is empty / do something only when the_content is empty
<?php if ( get_the_content() ) { ?>
// do or output something
<?php } ?> // break php tag for HTML block
@gerbenvandijk
gerbenvandijk / Mark parent navigation active when on custom post type single page
Last active January 1, 2024 21:22
Mark (highlight) custom post type parent as active item in Wordpress Navigation.When you visit a custom post type's single page, the parent menu item (the post type archive) isn't marked as active. This code solves it by comparing the slug of the current post type with the navigation items, and adds a class accordingly.
<?php
function add_current_nav_class($classes, $item) {
// Getting the current post details
global $post;
// Get post ID, if nothing found set to NULL
$id = ( isset( $post->ID ) ? get_the_ID() : NULL );
@WebEndevSnippets
WebEndevSnippets / functions.php
Created November 13, 2012 16:30
WooCommerce: Change Order Notes Placeholder Text
add_filter( 'woocommerce_checkout_fields', 'webendev_woocommerce_checkout_fields' );
/**
* Change Order Notes Placeholder Text - WooCommerce
*
*/
function webendev_woocommerce_checkout_fields( $fields ) {
$fields['order']['order_comments']['placeholder'] = 'Your custom placeholder';
return $fields;
}