This file contains 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
/* set forum subscription field checked by default */ | |
function my_forum_topic_subscribed_by_default() { | |
echo '<script type="text/javascript">jQuery("#bbp_topic_subscription").prop("checked","checked");</script>'; | |
} | |
add_action('bbp_theme_after_topic_form_subscriptions', 'my_forum_topic_subscribed_by_default'); |
This file contains 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 | |
/** | |
* Plugin Name: Static Templates | |
* | |
* If most of your site content is in .php template files, and you're tired of | |
* creating new pages, assigning them page templates, creating page templates | |
* then doing it all over again on production, this plugin is for you. | |
* | |
* Examples: | |
* |
This file contains 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 | |
add_action( 'wp_enqueue_scripts', 'enqueue_my_styles' ); | |
function enqueue_my_styles() { | |
global $wp_styles; | |
// Load the main stylesheet | |
wp_enqueue_style( 'my-theme', get_stylesheet_directory_uri() . '/style.css' ); |
This file contains 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 | |
function date_compare($a, $b) | |
{ | |
$t1 = strtotime($a->post_date); | |
$t2 = strtotime($b->post_date); | |
return $t1 - $t2; | |
} | |
// Cloud Loop |
This file contains 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
// Make an RSS Feed Link for a bbPress Topic | |
// First Create Your Function | |
function bbpress_rss() { | |
$url = "http" . (($_SERVER['SERVER_PORT']==443) ? "s://" : "://") . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; | |
echo ' <a href="' . $url . 'feed">Subscribe via RSS</a>'; | |
} | |
// Then Echo the Function |
This file contains 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
<div class="wrapper"> | |
<div class="cat animal"> | |
<div class="head"> | |
<span class="nose"></span> | |
<div class="ears"></div> | |
<div class="stripes stripes-right"></div> | |
<div class="stripes stripes-left"></div> | |
<div class="tongue"></div> | |
</div> | |
<div class="body"> |
This file contains 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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains 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
class That_Word() { | |
$word = 'what you think the word means'; | |
$that_word = 'what the word really means'; | |
you_using_that_word(){ | |
$word <> $that_word; | |
} |
This file contains 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
<body> | |
<a href="#maincontent">Skip to main content</a> | |
... | |
<main id="maincontent> | |
<h1>Heading</h1> | |
<p>This is the first paragraph</p> |
OlderNewer