This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//* 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' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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() ) { ?> | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//* 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' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function my_add_action_links( $links ) { | |
$links[] = '<a href="'. get_admin_url(null, 'options-general.php?page=plugin_name') .'">Settings</a>'; | |
return $links; | |
} | |
add_filter( 'plugin_action_links_' . plugin_basename(__FILE__), 'my_add_action_links' ); |