Skip to content

Instantly share code, notes, and snippets.

View heyitsritesh's full-sized avatar

Ritesh Saini heyitsritesh

View GitHub Profile
@heyitsritesh
heyitsritesh / Execute Shortcode in Genesis Breadcrumbs
Created November 8, 2019 18:12
Execute Shortcode in Genesis Breadcrumbs
/* Execute shortcodes in Genesis Breadcrumbs */
add_filter( 'genesis_single_crumb', 'do_shortcode' );
/* Remove URL Field From GeneratePress Comments Section */
add_action( 'after_setup_theme', 'gp_add_comment_url_filter' );
function gp_add_comment_url_filter() {
add_filter( 'comment_form_default_fields', 'gp_disable_comment_url', 20 );
}
function gp_disable_comment_url($fields) {
unset($fields['url']);
return $fields;
}
@heyitsritesh
heyitsritesh / Redirect All 404 Pages to Homepage in WordPress
Last active October 25, 2019 12:22
Redirect All 404 Pages to Homepage in WordPress
/* Redirect All 404 Pages to Homepage in WordPress by DigitalKube.com */
<?php
header("HTTP/1.1 301 Moved Permanently");
header("Location: ".get_bloginfo('url'));
exit();
?>
//*** Auto Ads on Single Posts ***//
add_action( 'wp_head', 'digitalkube_add_tracking_code' );
function digitalkube_add_tracking_code() {
if (is_single()) {
?>
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<script>
(adsbygoogle = window.adsbygoogle || []).push({
google_ad_client: "ca-pub-xxxxxxxxxxxxxxx",
enable_page_level_ads: true
User-agent: *
Disallow: /cgi-bin/
Disallow: /wp-admin/
Disallow: /wp-content/
Disallow: /wp-includes/
Disallow: /archives/
Disallow: /comments/feed/
Disallow: /trackback/
Disallow: /index.php
Disallow: /xmlrpc.php
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" < /dev/null 2> /dev/null
@heyitsritesh
heyitsritesh / Erase_Cache.bat
Last active July 16, 2018 11:51
How To Clear Windows 10 Update Cache In Just One-Click | https://www.digitalkube.com/clear-windows-10-update-cache/
net stop wuauserv
CD %Windir%
CD SoftwareDistribution
DEL /F /S /Q Download
net start wuauserv