Skip to content

Instantly share code, notes, and snippets.

View trishasalas's full-sized avatar

Trisha Salas trishasalas

  • Level Access
  • Tulsa, OK
View GitHub Profile
@trishasalas
trishasalas / Subscription checked by default
Last active August 29, 2015 13:55
support topic checked by default
/* 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');
<?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:
*
<?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' );
@trishasalas
trishasalas / bbpress-functions.php
Last active August 29, 2015 13:57
bbPress Forums Loop Using get_posts();
<?php
function date_compare($a, $b)
{
$t1 = strtotime($a->post_date);
$t2 = strtotime($b->post_date);
return $t1 - $t2;
}
// Cloud Loop
@trishasalas
trishasalas / bbpress-rss
Created March 27, 2014 20:40
Create a Clickable RSS Link for a bbPress Topic
// 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
@trishasalas
trishasalas / index.html
Created March 28, 2014 18:03
A Pen by Trisha Salas.
<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">
<?php
/*
Plugin Name: Nav Menu Exporter and Importer
Description: Export and Import nav menus. Requires WordPress Importer plugin
Author: hissy, megumi themes
Version: 0.1
Text Domain: nav-menu-exporter-importer
License: GPL version 2 or later - http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
*/
@trishasalas
trishasalas / 0_reuse_code.js
Created June 2, 2014 14:23
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@trishasalas
trishasalas / Inconceivable.php
Created July 8, 2014 05:56
A Princess Bride Quote in php.
class That_Word() {
$word = 'what you think the word means';
$that_word = 'what the word really means';
you_using_that_word(){
$word <> $that_word;
}
@trishasalas
trishasalas / skip-links.php
Created October 4, 2014 14:21
Skip Links