Skip to content

Instantly share code, notes, and snippets.

<div class="container_12">
<div class="grid_9">
<?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?>
<?php the_content(); ?>
<?php endwhile; ?>
<!-- I'm going to add the BuddyPress Index Page code here -->
</div>
@jennimckinnon
jennimckinnon / wp-config.php
Last active August 29, 2015 14:09
wp-config.php sub-directory multisite installation
/* Multisite */
define( 'WP_ALLOW_MULTISITE', true );
define('MULTISITE', true);
define('SUBDOMAIN_INSTALL', false);
define('DOMAIN_CURRENT_SITE', 'yourdomain.com');
define('PATH_CURRENT_SITE', '/');
define('SITE_ID_CURRENT_SITE', 1);
define('BLOG_ID_CURRENT_SITE', 1);
@jennimckinnon
jennimckinnon / wp-config.php stop editing
Last active February 15, 2018 05:17
The stop editing line in wp-config.php
/* That's all, stop editing! Happy blogging. */
@jennimckinnon
jennimckinnon / .htaccess
Last active August 29, 2015 14:09
The code for multisite installations for WordPress 3.5 and above, in the .htaccess file.
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
# add a trailing slash to /wp-admin
RewriteRule ^wp-admin$ wp-admin/ [R=301,L]
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
@jennimckinnon
jennimckinnon / wp-config.php allow sub-domains
Last active August 29, 2015 14:09
This is the code to add to the wp-config.php file to enable WordPress multisite as sub-domains
/* Multisite */
define( 'WP_ALLOW_MULTISITE', true );
define('MULTISITE', true);
define('SUBDOMAIN_INSTALL', true);
define('DOMAIN_CURRENT_SITE', 'yourdomain.com');
define('PATH_CURRENT_SITE', '/');
define('SITE_ID_CURRENT_SITE', 1);
define('BLOG_ID_CURRENT_SITE', 1);
@jennimckinnon
jennimckinnon / .htaccess
Last active August 29, 2015 14:10
Addings dynamic 301 redirects to the .htaccess file for WordPress from sub-directories to sub-domains
# You need the following line before the redirects for this to work
RewriteEngine On
# 301 Redirect to subdomain no query strings attached to the end of the redirected URL
RewriteCond %{HTTP_HOST} ^yourdomain\.com$ [NC]
RewriteCond %{QUERY_STRING} ^page_id=10$ [NC]
RewriteRule ^site1/$ http://site1.yourdomain.com/newpage? [R=301,NE,NC,L]
# 301 Redirect to subdomain with query strings attached to the end of the redirected URL
RewriteCond %{HTTP_HOST} ^yourdomain\.com$ [NC]
@jennimckinnon
jennimckinnon / .htaccess
Created November 25, 2014 00:40
Addings dynamic 301 redirects to the .htaccess file for WordPress from sub-domains to sub-directories.
# You need the following line before the redirects for this to work
RewriteEngine On
# 301 Redirect to subdirectory no query strings attached to the end of the redirected URL
RewriteCond %{HTTP_HOST} ^site2\.yourdomain\.com$ [NC]
RewriteCond %{QUERY_STRING} ^page_id=20$ [NC]
RewriteRule ^$ http://www.yourdomain.com/site2/newpage? [R=301,NE,NC,L]
# 301 Redirect to subdirectory with query strings attached to the end of the redirected URL
RewriteCond %{HTTP_HOST} ^site2\.yourdomain\.com$ [NC]
jQuery(document).ready(function($){
var offset = 100;
var speed = 250;
var duration = 500;
$(window).scroll(function(){
if ($(this).scrollTop() < offset) {
$('.topbutton') .fadeOut(duration);
} else {
$('.topbutton') .fadeIn(duration);
}
.topbutton {
height:50px;
width:50px;
position:fixed;
right:5px;
bottom:5px;
z-index:1;
background-image: url("http://example.com/wp-content/uploads/2015/01/topbutton.png");
background-repeat:no-repeat;
display:none;
function my_scripts_method() {
wp_enqueue_script(
'custom-script',
get_stylesheet_directory_uri() . '/js/topbutton.js',
array( 'jquery' )
);
}
add_action( 'wp_enqueue_scripts', 'my_scripts_method' );