Skip to content

Instantly share code, notes, and snippets.

Brian Richards brichards

Block or report user

Report or block brichards

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
brichards / comments-page.php
Created Aug 7, 2019
Plugin to make WordPress comments available at <post_url>/comments/.
View comments-page.php
* Plugin Name: Comments Page
* Plugin URI:
* Description: Makes comments for a post accessible at <post_url>/comments/.
* Author: Brian Richards
* Author URI:
* Text Domain: comments-page
* Domain Path: /languages
* Version: 0.1.0
brichards / rewrites-1.php
Created Feb 28, 2016
In all of the below cases permalinks have been flushed. The endpoint works perfectly fine for all scenarios _except_ the home page.
View rewrites-1.php
Using only this, hiting ^/bpa/whatever/ serves blog archive instead of static front page.
* Create url endpoint for BPA
* @since 1.0.0
function cfpurl_rewrite_rules() {
View Chatpen.markdown


Multiuser chat built with React and Firebase. Note that this is on the Firebase free plan, so if more than 50 users are on it things may go south.

A Pen by Brad Daily on CodePen.


View .htaccess
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f [NC]
RewriteRule ^(.*\.(js|css|png|jpe?g|gif|ico))$1 [NC,P,L]
View no-translation.php
$url = esc_url( get_post_meta( $post->ID, '_project-url', true ) );
if ( ! empty( $url ) {
printf( '<p>%s</p>', $url );
View kb-press.php
* Output HTML markup for forum post list.
* @since 1.0.0
* @param integer $post_count Post count.
function skbp_output_forum_posts_list( $post_count = 5 ) {
View pre-commit
echo PHP_EOL;
echo 'Starting unit tests' . PHP_EOL;
exec( 'phpunit', $test_output, $returnCode );
if ( 0 !== $returnCode ) {
echo implode( PHP_EOL, $test_output );
echo PHP_EOL;
brichards / functions.php
Created Jan 3, 2014
Make all WP oEmbedded videos responsive.
View functions.php
* Wrap an embedded video with a container for simpler styling.
* @since 1.0.0
* @param string $output HTML Markup.
* @param string $url oEmbed URL.
View gist:7517250
=== Almost always running ===
Google Chrome (10 tabs average)
Vagrant (running VirtualBox)
SublimeText 2
View gist:7191030
* Change "Featured Image" to "Achievement Image" throughout media modal.
* @since 1.3.0
* @param array $strings All strings passed to media modal.
* @param object $post Post object.
* @return array Potentially modified strings.
You can’t perform that action at this time.