Skip to content

Instantly share code, notes, and snippets.

<?php
add_filter('wpseo_sitemap_index', 'add_subdomains_to_sitemap' ); // add link to custom sitemap
/**
* Add the link to the main sitemap index
* @param string $content Existing sitemap content.
* @return string Sitemap with extra content.
*/
function add_subdomains_to_sitemap( $content = '' ) {
@remkus
remkus / aauthorbox.php
Last active August 29, 2015 14:26 — forked from neilgee/aauthorbox.php
Genesis WordPress Customised Author Box
<?php
//do not copy the opening php tag above
/**
* Changing the AuthorBox in WordPress
*
* @package Changing the AuthorBox in WordPress
* @author Neil Gee
* @link http://wpbeaches.com/author-box-genesis/
<?php
class Yoast_GlotPress_SEO {
function __construct() {
add_filter( 'gp_title', array( $this, 'modify_title' ) );
add_action( 'gp_head', array( $this, 'meta_desc' ), 9 );
add_filter( 'gp_redirect_status', array( $this, 'modify_redirect_status' ), 10, 2 );
}
module.exports = function( grunt ) {
'use strict';
require( 'matchdep' ).filterDev( 'grunt-*' ).forEach( grunt.loadNpmTasks );
grunt.initConfig({
makepot: {
plugin1: {
options: {
@remkus
remkus / functions.php
Created January 6, 2014 12:12
Estimated Reading Time
<?php
/**
* Estimated Reading Time
*
* Use by adding it to a hook like add_action( 'genesis_after_entry', 'fm_estimated_reading_time' );
*
* @link http://briancray.com/posts/estimated-reading-time-web-design/
* @return void
*/
@remkus
remkus / functions.php
Created January 3, 2014 10:54
Best Author Fallback
<?php
/**
* Display best author posts as last widget in the sidebar
* @uses bap_get_user_posts
* @uses bap_get_single_post_user_id
* @return all the output
*/
function lh_best_author_posts() {
@remkus
remkus / functions.php
Created November 10, 2013 11:12
Clear APC cache with a single click
<?php
*/
* Clear APC cache with a single click
* @link http://kaspars.net/blog/wordpress/clear-apc-cache-button-for-wordpress
*/
if (function_exists('apc_clear_cache')) {
// Clear cache if something is edited
if (!empty($_POST) && is_admin())
apc_clear_cache();
@remkus
remkus / bp_redirect.php
Last active February 3, 2020 12:04
BuddyPress Privacy
<?php
add_filter( 'get_header', 'bp_guest_redirect', 1 );
/**
* Redirect BuddyPress guests to register page
* @return [type] [description]
*/
function bp_guest_redirect() {
global $bp;
if ( bp_is_activity_component() || bp_is_user_profile() || bp_is_groups_component() || bp_is_blogs_component() || bp_is_page( BP_MEMBERS_SLUG ) ) {
@remkus
remkus / wp-config.php
Last active May 27, 2019 17:07
Help! WordPress 3.7 won't do automatic updates!! AKA: put your FTP credentials in wp-config.php
<?php
/**
* For more information, as always, check the codex
* @link: http://codex.wordpress.org/Editing_wp-config.php#WordPress_Upgrade_Constants
**/
define( 'FTP_USER', 'username' );
define( 'FTP_PASS', 'password' );
define( 'FTP_HOST', 'ftp.example.org' ); // this usually can be 127.0.0.1