Skip to content

Instantly share code, notes, and snippets.

View fernandiez's full-sized avatar

Fernan fernandiez

View GitHub Profile
@fernandiez
fernandiez / functions.php
Created February 27, 2015 01:21
Taxonomy title and description (category, tag, taxonomy) in Genesis Child Theme
//* Adding WordPress Taxonomy title and description (category, tag, taxonomy)
/**
* Add Category Heading to Each Page in Pagination in Genesis
* @link https://gist.github.com/neilgee/6c0414cfef06e41a6606
* Prints a category's title and description in Genesis
* @link https://gist.github.com/EngageWP/df43e156e76fa5cdd6c0
*/
add_action( 'genesis_before_loop', 'rv_output_category_info' );
<?php
global $post;
$get_posts = tribe_get_events(array('posts_per_page'=>-3,) );
foreach($get_posts as $post) { setup_postdata($post);
?>
<?php if ( has_post_thumbnail() ) { ?>
@renventura
renventura / print-category-title-description.php
Last active August 29, 2015 14:13
Prints a category's title and description in Genesis
<?php //* Mind this opening PHP tag
/**
* Prints a category's title and description (no markup added)
*
* @author Ren Ventura
* @link http://www.engagewp.com/how-to-display-category-name-description-genesis/
*/
add_action( 'genesis_before_content', 'rv_output_category_info' );
@srikat
srikat / functions.php
Created December 5, 2014 11:46
Horizontal Opt-in Form in Genesis using eNews Extended plugin. http://sridharkatakam.com/horizontal-opt-form-genesis-using-enews-extended-plugin/
//* Register Horizontal Opt-In widget area
genesis_register_sidebar(
array(
'id' => 'horizontal-opt-in',
'name' => __( 'Horizontal Opt-In' ),
'description' => __( 'This is the widget area for horizontal opt-in form.' ),
) );
//* Display Horizontal Opt-In below Header
add_action( 'genesis_after_header', 'sk_horizontal_opt_in' );
@bentasm1
bentasm1 / functions.php
Last active June 24, 2016 09:42
Redirect Vendors to Vendor Dashboard @ login
/* Redirect Vendors to Vendor Dashboard on Login */
add_filter('woocommerce_login_redirect', 'login_redirect', 10, 2);
function login_redirect( $redirect_to, $user ) {
// WCV dashboard -- Uncomment the 3 lines below if using WC Vendors Free instead of WC Vendors Pro
// if (class_exists('WCV_Vendors') && WCV_Vendors::is_vendor( $user->id ) ) {
// $redirect_to = get_permalink(WC_Vendors::$pv_options->get_option( 'vendor_dashboard_page' ));
// }
// WCV Pro Dashboard
@tonymtz
tonymtz / gist:d75101d9bdf764c890ef
Last active July 26, 2024 20:17
Uninstall nodejs from OSX Yosemite
# first:
lsbom -f -l -s -pf /var/db/receipts/org.nodejs.pkg.bom | while read f; do sudo rm /usr/local/${f}; done
sudo rm -rf /usr/local/lib/node /usr/local/lib/node_modules /var/db/receipts/org.nodejs.*
# To recap, the best way (I've found) to completely uninstall node + npm is to do the following:
# go to /usr/local/lib and delete any node and node_modules
cd /usr/local/lib
sudo rm -rf node*
@nicomollet
nicomollet / wp_auto_install.sh
Last active October 23, 2024 23:23
WP-CLI auto install script
#!/bin/bash
# Default options
LOCALE="fr_FR"
DB_HOST='localhost'
VIRUSTOTAL_KEY='YOUR_KEY'
printf "Name of the project? cf My Project: "
read PROJECT_NAME
@alfonsosiloniz
alfonsosiloniz / clean_hacked_WP.txt
Last active August 29, 2015 14:04
Clean hacked WordPress installation
When your WordPress installation is hacked, you can ussually see that the first line on every php file is modified, permitting the execution of malicious code. You will see something like this:
<?php $vixtqowrfp = 'c%x78e%x5c%x78b%x5c%x7825gc%x7825ggg)(0)%x5c%x782f+*0f(-!#]y76]277]y72]265....[]...?>[Legitimate code]
in every php file (wp-config.php for instance)
It is difficult to clean this unless you have a complete backup of your installation. If you have shell access to your hosting or server, you can clean it following these commands
Be sure every php file is infected. If not, some legitimate code could be affected, because first line is deleted in every file with this procedure.
@lucymtc
lucymtc / my_add_action_links.php
Last active June 29, 2017 21:14
Add a settings link to plugins overview page - WordPress
@davidsneal
davidsneal / html-share-buttons.html
Last active December 12, 2023 13:18
HTML Share Buttons
<!-- I got these buttons from simplesharebuttons.com -->
<div id="share-buttons">
<!-- Buffer -->
<a href="https://bufferapp.com/add?url=https://simplesharebuttons.com&amp;text=Simple Share Buttons" target="_blank">
<img src="https://simplesharebuttons.com/images/somacro/buffer.png" alt="Buffer" />
</a>
<!-- Digg -->
<a href="http://www.digg.com/submit?url=https://simplesharebuttons.com" target="_blank">