Skip to content

Instantly share code, notes, and snippets.

View duroe5698's full-sized avatar

Marc Duroe duroe5698

View GitHub Profile
@duroe5698
duroe5698 / Keep Parent Nav Color Same as SubMenu When Active Genesis WordPress.css
Created January 1, 2016 19:11
Keep Parent Nav Color Same as Submenu When Active Genesis WordPress
.genesis-nav-menu li:hover > a {
background-color: #2673A0;
}
@duroe5698
duroe5698 / add-html-to-wordpress-widget-titles.php
Created April 5, 2016 18:17
Add HTML to WordPress Widget Titles
<?php
//allow html in widget title
function md_change_widget_title($title)
{
//convert square brackets to angle brackets
$title = str_replace('[', '<', $title);
$title = str_replace(']', '>', $title);
//strip tags other than the allowed set
$title = strip_tags($title, '<a><blink><br><span>');
@duroe5698
duroe5698 / htaccess redirect when moving to new domain
Created June 29, 2016 14:50
htaccess redirect when moving to new domain
<IFModule mod_rewrite.c>
RewriteEngine on
Options +FollowSymlinks
RewriteBase /
RewriteCond %{HTTP_HOST} ORIGINALDOMAIN\.com
RewriteRule ^(.*) http://NEWDOMAIN.com/$1 [L,R=301]
</IfModule>
@duroe5698
duroe5698 / add-custom-menu-item-and-endpoint-to-woocommerce-my-account-page.php
Last active July 8, 2023 18:05
Add custom menu item and endpoint to WooCommerce my-account page
/* Add custom menu item and endpoint to WooCommerce My-Account page */
function my_custom_endpoints() {
add_rewrite_endpoint( 'refunds-returns', EP_ROOT | EP_PAGES );
}
add_action( 'init', 'my_custom_endpoints' );
function my_custom_query_vars( $vars ) {
$vars[] = 'refunds-returns';
@duroe5698
duroe5698 / google-re-captcha-php-validation-check.php
Created February 3, 2017 15:22
Google re-Captcha PHP validation check
<?php
$secret = 'YOURSECRETKEY';
$response=$_POST["g-recaptcha-response"];
$verify=file_get_contents("https://www.google.com/recaptcha/api/siteverify?secret={$secret}&response={$response}");
$captcha_success=json_decode($verify);
?>
@duroe5698
duroe5698 / basic-wordpress-wrapper-shortcode.php
Created March 22, 2018 20:11
Basic WordPress "Wrapper" Shortcode
<?php
//Basic Wrapper Shortcode
function basic_wrapper_sc( $atts, $content = null) {
return '<div class="basic-wrapper-sc">' . $content . '</div>';
}
add_shortcode('basic-wrapper-sc', 'basic_wrapper_sc');
?>