Skip to content

Instantly share code, notes, and snippets.

View pixelbart's full-sized avatar
✂️
No scissors please, I love my hair!

Kevin Pliester pixelbart

✂️
No scissors please, I love my hair!
View GitHub Profile
@hlashbrooke
hlashbrooke / function.php
Last active July 4, 2022 21:35
WordPress: Display posts in a random order, but retain persistent pagination
<?php
session_start();
add_filter( 'posts_orderby', 'randomise_with_pagination' );
function randomise_with_pagination( $orderby ) {
if( is_front_page() ) {
// Reset seed on load of initial archive page
@opnchaudhary
opnchaudhary / gmaps_3.html
Created July 5, 2013 04:26
Get latitude and longitude from google maps
<!doctyp html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Get Latitude and Longitude</title>
<script src="http://maps.google.com/maps/api/js?libraries=places&region=uk&language=en&sensor=true"></script>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script>
</head>
<body>
@ScottPhillips
ScottPhillips / Widget_Setup.php
Created January 21, 2013 16:03
OOP Style Widgets for Wordpress
class Widget_Setup
{
public $widget_class = '';
public $admin_styles = array();
public $admin_scripts = array();
public $front_styles = array();
public $front_scripts = array();
public $script_defaults = array(
'handle' => '',
@Zodiac1978
Zodiac1978 / .htaccess
Last active December 8, 2024 11:42
Make your Website faster - a safe htaccess way
#
# Sources:
# http://stackoverflow.com/questions/7704624/how-can-i-use-gzip-compression-for-css-and-js-files-on-my-websites
# http://codex.wordpress.org/Output_Compression
# http://www.perun.net/2009/06/06/wordpress-websites-beschleuinigen-4-ein-zwischenergebnis/#comment-61086
# http://www.smashingmagazine.com/smashing-book-1/performance-optimization-for-websites-part-2-of-2/
# http://gtmetrix.com/configure-entity-tags-etags.html
# http://de.slideshare.net/walterebert/die-htaccessrichtignutzenwchh2014
# http://de.slideshare.net/walterebert/mehr-performance-fr-wordpress
# https://andreashecht-blog.de/4183/
anonymous
anonymous / .htaccess
Created July 3, 2012 08:32
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType text/html "access plus 2 hours "
ExpiresByType text/xml "access plus 2 hours"
ExpiresByType image/gif "access plus 3 weeks"
ExpiresByType image/jpg "access plus 2 weeks"
ExpiresByType image/png "access plus 3 weeks"
ExpiresByType video/quicktime "access plus 2 months"
ExpiresByType audio/mpeg "access plus 2 months"
ExpiresByType application/pdf "access plus 2 weeks"
@ScottPhillips
ScottPhillips / .htaccess
Created February 2, 2012 04:30
Common .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/