Skip to content

Instantly share code, notes, and snippets.

@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 August 17, 2016 08:18 — forked from srikat/functions.php
Make BuddyPress Members page obey its Page layout setting in Genesis. https://sridharkatakam.com/make-buddypress-members-page-obey-page-layout-setting-genesis/
<?php
/**
* Make BuddyPress Members page obey its Page layout setting
*/
add_filter( 'genesis_pre_get_option_site_layout', 'sk_do_members_page_layout' );
function sk_do_members_page_layout( $opt ) {
// if the current page is not the members directory, abort.
if ( ! bp_is_members_directory() ) {
@remkus
remkus / cpt-rss-include.php
Created August 18, 2016 08:32 — forked from norcross/cpt-rss-include.php
include CPT in an RSS feed
<?php
function mmk_rss_include( $query ) {
if (!$query->is_feed)
return $query;
$query->set( 'post_type' , array( 'post', 'YOUR_POST_TYPE_NAME' ) );
return $query;
@remkus
remkus / childpages-looping.php
Last active March 24, 2016 14:01 — forked from crondeau/chilpages-looping.php
I used this code to loop through child pages of a custom post type called work. Each Work piece had a title, featured image and pdf. The child pages, describe the details of the project or work piece and display as an accordion. So basically what we have is an accordion within an accordion.
<?php
// loop through the sub-pages of your custom post type
$childpages = new WP_Query( array(
'post_type' => 'wpkb-article',
'post_parent' => $this_page,
'posts_per_page' => 100,
'orderby' => 'menu_order'
));
while ( $childpages->have_posts() ) : $childpages->the_post(); ?>
@remkus
remkus / deploy.sh
Created October 4, 2012 17:44 — forked from BFTrick/deploy.sh
WordPress Plugin Deploy Script
#! /bin/bash
# A modification of Dean Clatworthy's deploy script as found here: https://github.com/deanc/wordpress-plugin-git-svn
# The difference is that this script lives in the plugin's git repo & doesn't require an existing SVN repo.
# main config
PLUGINSLUG="______your-plugin-name______"
CURRENTDIR=`pwd`
MAINFILE="______your-plugin-name______.php" # this should be the name of your main php file in the wordpress plugin
# git config
@remkus
remkus / functions.php
Created June 5, 2012 18:41 — forked from gregrickaby/functions.php
Custom Post-Info with Google Rich Snippet support
remove_action( 'genesis_before_post_content', 'genesis_post_info' );
add_action( 'genesis_before_post_content', 'child_post_info' );
/**
* Custom Post-Info with Google Rich Snippet support
*
* @author Greg Rickaby
* @since 1.0.0
*/
function child_post_info() {
if ( is_page() )
<?php
add_filter( 'genesis_author_box', 'zip_author_box', 10, 6 );
/**
* Filters author box by adding extra link
*
* @access public
* @param mixed $output
* @param mixed $context
* @param mixed $pattern
@remkus
remkus / rkv_date_convert
Created April 1, 2012 17:32 — forked from norcross/rkv_date_convert
Convert date entry to UNIX timestamp
// Make two admin-only fields (as text fields)
// and post to the custom fields from Gravity Forms
// instead of the "real" date picker.
// NOTE: change the input IDs to match the ones on your form
function rkv_datesubmit_fix ($form){
//event start date field id is 3
//event end date field ID is 4
$raw_srt = $_POST['input_3'];
$raw_end = $_POST['input_4'];