This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<title>Site Maintenance</title> | |
<style> | |
body { text-align: center; padding: 150px; } | |
h1 { font-size: 50px; } | |
body { font: 20px Helvetica, sans-serif; color: #333; } | |
article { display: block; text-align: left; width: 650px; margin: 0 auto; } | |
a { color: #dc8100; text-decoration: none; } | |
a:hover { color: #333; text-decoration: none; } | |
</style> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* This file is just for WordPress security and thats about it | |
* Copy in functions.php | |
* Uses send_headers as opposed to wp_header so as to ensure it works even when the webiste is cached | |
*/ | |
add_action('send_headers', function(){ | |
// Enforce the use of HTTPS | |
header("Strict-Transport-Security: max-age=31536000; includeSubDomains"); | |
// Prevent Clickjacking |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
RewriteCond %{HTTP_HOST}#%{HTTPS}s ^www\.([^#]+)#(?:off|on(s)) [NC] | |
RewriteRule ^ http%2://%1%{REQUEST_URI} [R=301,L] | |
</IfModule> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Colour Guessing game</title> | |
</head> | |
<body onload="do_game()"> | |
<script type="text/javascript"> | |
var colors = []; | |
var target; | |
var guess_input; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 1. Define a function called get_class_average that has one argument students. You can expect students to be a list containing your three students. | |
# 2. First, make an empty list called results. | |
# 3. For each student item in the class list, calculate get_average(student) and then call results.append() with that result. | |
# 4. Finally, return the result of calling average() with results. | |
lloyd = { | |
"name": "Lloyd", | |
"homework": [90.0, 97.0, 75.0, 92.0], | |
"quizzes": [88.0, 40.0, 94.0], | |
"tests": [75.0, 90.0] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//Do not add the line above | |
if ( current_user_can('contributor') && !current_user_can('upload_files') ) | |
//checks if the current user is a contributor | |
add_action('admin_init', 'allow_contributor_uploads'); | |
function tayo_allow_contributor_uploads() { | |
$contributor = get_role('contributor'); | |
$contributor->add_cap('upload_files'); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Customize the post meta function | |
add_filter( 'genesis_post_meta', 'post_meta_filter' ); | |
function post_meta_filter( $post_meta ) { | |
if ( is_single() ) { | |
// change the category and tags to anything you like | |
$post_meta = '[post_tags sep=", " before="' . __( 'Tags:', 'temmyhlee' ) . ' "] [post_categories sep=", " before="' . __( 'Category:', 'temmyhlee' ) . ' "]'; | |
return $post_meta; | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Add Copyright text | |
add_filter ( 'genesis_footer_creds_text', 'temmyhlee_custom_footer_credits', 10, 7); | |
function temmyhlee_custom_footer_credits ($creds ) { | |
; | |
$creds = '<p>[footer_copyright]. Made with <i class="ion-heart"></i> by <a href="http://temmyhlee.com/" target="_top">Temmyhlee</a> · Supported by <a href="http://moorgist.com" target="_blank">Moorgist.com</a></p> <p class = "affiliate"> Do note that I drop affiliate links all over this site as it helps me get bucked up. (Take no offence).</p>'; | |
return $creds; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//* Add new widget Between Posts Area | |
genesis_register_sidebar( array( | |
'id' => 'between-posts-area', | |
'name' => __( 'Between Posts Area', 'basicwp-theme' ), | |
'description' => __( 'This widget show between and after few posts.', 'basicwp-theme' ), | |
) ); | |
//* Add widget area between and after 3 posts | |
add_action( 'genesis_after_entry', 'basicwptheme_between_posts_area' ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//* Do NOT include the opening php tag | |
add_action( 'genesis_after_entry', 'google_ad' ); | |
/** | |
* Insert one random ad after every second post. | |
* | |
* Scope: Posts page and all category archives. | |
* | |
* @author Sridhar Katakam |
NewerOlder