Skip to content

Instantly share code, notes, and snippets.

@About2git
About2git / http_headers_security.htaccess
Last active April 25, 2022 10:56 — forked from dkvadratu/http_headers_security.htaccess
{HTACCESS} HTTP headers for security in .htaccess file
# Check your website headers here: https://www.serpworx.com/check-security-headers/ or https://gf.dev/
# This configuration works for WP, WC on LiteSpeed server. Be careful. Test site after installing. All lines are explained are in serpworx.com tester.
# Check for WP https://kulturbanause.de/blog/http-security-header/
# and https://wp-helpers.com/2021/03/01/a-short-library-to-manage-security-http-headers-in-wp/
# https://servebolt.com/help/article/how-to-add-security-headers-to-your-site/
# Test with these: https://securityheaders.com/
# https://webbkoll.dataskydd.net/de
# https://observatory.mozilla.org/
# https://csp-evaluator.withgoogle.com/
# Monitor: https://report-uri.com/
@About2git
About2git / .htaccess
Last active January 7, 2022 00:49 — forked from ScottPhillips/.htaccess
Common 301 .htaccess Redirects
#301 Redirects for .htaccess
#Redirect a single page:
Redirect 301 /pagename.php http://www.domain.com/pagename.html
#Redirect an entire site:
Redirect 301 / http://www.domain.com/
#Redirect an entire site to a sub folder
Redirect 301 / http://www.domain.com/subfolder/
@About2git
About2git / Links
Created June 5, 2021 20:05 — forked from lukecav/Links
Speed Up Your WordPress Site with These 3 Advanced Techniques Workshop - WordSesh 2021
@About2git
About2git / .htaccess
Last active August 19, 2018 16:05 — forked from seoagentur-hamburg/.htaccess
Die optimale .htaccess-Datei für mehr Speed und Sicherheit
# ----------------------------------------------------------------------
# | Komprimierung und Caching |
# ----------------------------------------------------------------------
# Serve resources with far-future expires headers.
#
# (!) If you don't control versioning with filename-based
# cache busting, you should consider lowering the cache times
# to something like one week.
#
@About2git
About2git / wpms-genesis-network-menu.php
Created January 26, 2018 15:02 — forked from sirchrispy/wpms-genesis-network-menu.php
WordPress MultiSite and Genesis: Display a Network-Wide Menu Raw
<?php
/*
* This code adds a network-wide menu in Genesis Header Right.
* It can be altered to be in any location your heart desires.
*
* For this code to work, your main site and all sub-sites need to meet the following conditions:
* 1) Register a menu with the same name on all themes used in network
* 2) Create a menu via the Appearance menu on main site and sub-sites and assign it to the same location
* 3) Leave the menu created in condition 2 blank on all sub-sites
@About2git
About2git / new_gist_file
Last active August 29, 2015 14:15 — forked from srikat/new_gist_file
To display YouTube video with player when the video URL has been entered in a custom field attached to a CPT in WordPress
[pb_vidembed title="" caption="" url='[types field="youtube-link" class="youtube-video" raw="true"][/types]' type="yt" w="270" h="217"]
@About2git
About2git / functions.php
Last active August 29, 2015 14:15 — forked from srikat/functions.php
Change URL of logo in Canvas from the default (site homepage) to a custom one. Code is to be added in child theme's functions.php.
<?php
// Remove logo code from Canvas
add_action('wp_head', 'remove_woo_logo');
function remove_woo_logo() {
remove_action('woo_header_inside','woo_logo');
}
/*-----------------------------------------------------------------------------------*/
@About2git
About2git / functions.php
Last active August 29, 2015 14:15 — forked from srikat/functions.php
Adding a search box in nav bar in WooThemes Canvas
<?php
add_action( 'woo_nav_inside', 'woo_add_nav_search', 30 );
if ( ! function_exists( 'woo_add_nav_search' ) ) {
function woo_add_nav_search () { ?>
<div class="fr">
<?php get_search_form(); ?>
</div>
@About2git
About2git / subnav-left-sidebar.php
Last active November 21, 2015 14:08 — forked from NicktheGeek/subnav-left-sidebar.php
Ever wanted to add a widget area before the .menu <ul> of the Genesis menus? With this simple gist you can do just that. Included are some comments to allow you to change it to use the primary menu or move the widget area to after the </ul> of the .menu. This gist assumes you have made a sidebar with the ID "subnav-left"
<?php
//You could use genesis_do_nav to target the primary menu
add_filter( 'genesis_do_subnav', 'child_do_subnav_widget', 10, 2 );
/** Adds widget area before the .menu on #subnav */
function child_do_subnav_widget( $subnav_output, $subnav ){
ob_start();
genesis_widget_area( 'subnav-left', array(
'before' => '<div class="subnav-left widget-area">',
'after' => '</div>', //required for HTML5 enabled themes
) );