Skip to content

Instantly share code, notes, and snippets.

@portfola
portfola / author.php
Last active May 6, 2023 18:15
Custom User Taxonomies in WordPress
<?php
/**
* The template for displaying Profile pages.
*
* Used for Artist and Cultural Org "mini" pages.
*
* @package ArtsWestchester
* @since ArtsWestchester 1.0
*/
@jchristopher
jchristopher / gist:7312074
Last active August 12, 2020 02:43
Supplemental SearchWP search engine integration with Genesis, supports pagination
<?php
/* Template Name: Genesis and SearchWP integration with pagination */
function prefix_searchwp_form( $query ) {
echo '<form class="searchwp-form" action="" method="get">';
echo '<input type="text" id="searchwpquery" name="searchwpquery" value="' . esc_attr( $query ) . '" />';
echo '<button type="submit">' . __( 'Search', 'text-domain' ) . '</button>';
echo '</form>';
}
@strangerstudios
strangerstudios / pmpro-change-role-at-checkout.php
Created November 2, 2013 16:08
Add author role to members at checkout. Add this to your active theme's functions.php or a custom plugin.
<?php
/*
This code will make members signing up for membership level #1 authors and make them subscribers when they cancel.
*/
function my_pmpro_after_change_membership_level($level_id, $user_id)
{
if($level_id == 1)
{
//New member of level #1. If they are a subscriber, make them an author.
$wp_user_object = new WP_User($user_id);
@JiveDig
JiveDig / change_login_logo.php
Last active December 26, 2015 19:19
Change login logo and link. logo.png goes in /child_theme/images/ directory
/**
* Change login logo
* Max image width should be 320px
* @link http://andrew.hedges.name/experiments/aspect_ratio/
*/
add_action('login_head', 'rgt_custom_dashboard_logo');
function rgt_custom_dashboard_logo() {
echo '<style type="text/css">
.login h1 a {
background-image:url('.get_stylesheet_directory_uri().'/images/logo.png) !important;
@robneu
robneu / genesis-searchwp-image-search.php
Last active September 14, 2019 21:25
Create a custom search template to display custom search results using SearchWP and the Genesis Framework.
<?php
/**
* This file adds the SearchWP Images template to your theme.
*
* Template Name: SearchWP Images
*
* @author Robert Neu
* @package Genesis
* @subpackage SearchWP
*/
<?php
/**
* Template Name: Authors
*
* @package BE_Genesis_Child
* @since 1.0.0
* @link https://github.com/billerickson/BE-Genesis-Child
* @author Bill Erickson <bill@billerickson.net>
* @copyright Copyright (c) 2011, Bill Erickson
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
@strangerstudios
strangerstudios / gist:1389944
Created November 23, 2011 21:17
Paid Memberships Pro Extra Checkout/Profile Fields Example
<?php
/*
Adding First and Last Name to Checkout Form
*/
//add the fields to the form
function my_pmpro_checkout_after_password()
{
if(!empty($_REQUEST['firstname']))
$firstname = $_REQUEST['firstname'];