Skip to content

Instantly share code, notes, and snippets.

@remkus
remkus / bulk-run.sh
Created December 5, 2023 13:24
Run WP CLI commands in Bulk
#!/bin/bash
# @link https://remkusdevries.com/wp-cli/run-wp-cli-scripts-in-bulk-across-various-servers
# List of iTerm2 profile names
profiles=(
"Example 1"
"Example 2"
"Example 3"
# ...add all profiles here
@remkus
remkus / create-wordpress-with-valet.sh
Created October 31, 2023 16:51 — forked from CoachBirgit/create-wordpress-with-valet.sh
Bash script: Use WP-CLI on Laravel/Valet to download, install and configure WordPress like a breeze.
#! /bin/bash
# Author: Birgit Olzem aka @CoachBirgit
# Version: 1.0
# Created on: January 19th 2022
# Requires WP-CLI, cURL, wget
# credits for the origin idea to Jeremy Herve: https://jeremy.hu/dev-environment-laravel-valet-wp-cli/
### How to use
@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 / change_genesis_menu_settings.php
Last active July 26, 2021 09:18
Change the Genesis Theme Menu Settings
<?php
add_filter( 'genesis_theme_settings_menu_ops', 'fsm_change_genesis_theme_menu' );
/**
* Change Genesis Dashboard Menu Settings
* @param object $menu_ops Menu arguments object
* @return object $menu_ops Ammended menu arguments object
* @author Remkus de Vries
* @link https://gist.github.com/defries/4296462
*
@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
# Redirect from HTTP to HTTPS
RewriteEngine On
RewriteCond %{SERVER_PORT} ^80$
RewriteRule ^(.*)$ https://%{SERVER_NAME}%{REQUEST_URI} [L,R=301,NC]
@remkus
remkus / gist:3851741
Created October 8, 2012 09:51
Function to add category nicenames to body class
<?php
add_filter( 'body_class', 'tax_body_class' );
/**
* This function adds category nicenames to body class.
*
* @access public
* @author Remkus de Vries
* @param mixed $classes
* @return void
@remkus
remkus / wp-config-snippet.php
Created December 7, 2012 13:17
wp-config.php & local-config.php & PressUp Box
<?php
if ( file_exists( dirname( __FILE__ ) . '/local-config.php' ) ) {
include( dirname( __FILE__ ) . '/local-config.php' );
define( 'WP_LOCAL_DEV', true );
} else {
define( 'DB_NAME', $_SERVER["DB_NAME"] );
define( 'DB_USER', $_SERVER["DB_USER"] );
define( 'DB_PASSWORD', $_SERVER["DB_PASSWORD"] );
define( 'DB_HOST', 'localhost' );
@remkus
remkus / remove-#more.php
Created December 22, 2012 16:05
Remove #more on jump
<?php
add_filter( 'the_content_more_link', 'remove_more_link_scroll' );
/**
* Remove the #more jump when clicking to full post in WordPress
*
*/
function remove_more_link_scroll( $link ) {
$link = preg_replace( '|#more-[0-9]+|', '', $link );