Skip to content

Instantly share code, notes, and snippets.

@jasonyingling
jasonyingling / gist:97e3b699d48982051952f5c37af88fde
Last active November 25, 2018 21:46
Remove Reading Time from specific posts
add_action( 'the_post', 'remove_reading_time_by_id' );
function remove_reading_time_by_id( $post_object ) {
$post_ids = array(
'53',
'10',
);
global $reading_time_wp;
if ( in_array( $post_object->ID, $post_ids ) ) {
remove_filter( 'the_content', array( $reading_time_wp, 'rt_add_reading_time_before_content') );
} else {
<body>
<?php do_action( 'wp_body_open' ); ?>
@jasonyingling
jasonyingling / functions.php
Created June 18, 2019 03:45
Adjust Reading Time WP postfix
/**
* Adjust the reading time postfix.
*/
function my_custom_reading_time( $postfix, $time, $singular, $multiple ) {
if ( $time == 1 ) {
$postfix = 'minuta';
} elseif ( $time == 2 || $time == 3 || $time == 4 ) {
$postfix = 'minuty';
} else {
$postfix = 'minut';
@jasonyingling
jasonyingling / gulpfile.js
Created February 1, 2019 04:26
A simple gulpfile setup for modern JavaScript and SASS
const { src, dest, watch } = require('gulp');
const sass = require('gulp-sass');
const minifyCSS = require('gulp-csso');
const babel = require('gulp-babel');
const concat = require('gulp-concat');
const browserSync = require('browser-sync').create();
function css() {
return src('./sass/*.scss', { sourcemaps: true })
.pipe(sass())
@jasonyingling
jasonyingling / functions.php
Last active June 11, 2021 12:22
Remove Reading Time WP From Yoast og:desc
/**
* A Function to remove the auto generated Reading Time from Yoast og:desc
*
* This hooks into Yoast's `wpseo_opengraph_desc` filter and uses a regular
* expression to remove the reading time for the post
*
* @see Reading Time WP Plugin
* @link https://wordpress.org/plugins/reading-time-wp/
*
* @param string $ogdesc The excerpt grabbed by Yoast for output.
# Fonts
# Add correct content-type for fonts
AddType application/x-font-ttf .ttf
## LEVERAGE BROWSER CACHING ##
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType application/x-font-ttf "access 1 week"
ExpiresByType image/jpg "access 1 week"
ExpiresByType image/jpeg "access 1 week"