Skip to content

Instantly share code, notes, and snippets.

View nusserstudios's full-sized avatar

Nusser Studios nusserstudios

View GitHub Profile
/*
* Profile Builder Edit Profile Link in single-userlisting visible only for users with the edit_users permission
* Usage: [pb-edit-profile-link link="http://www.example.com/edit-profile" title="User Profile"]
*/
add_shortcode('pb-edit-profile-link', 'func_pb_edit_profile_link');
function func_pb_edit_profile_link( $atts ){
if ( !isset( $atts['link'] ) || !isset( $atts['title'])){
return '';
}
@nusserstudios
nusserstudios / Functions
Last active June 25, 2018 07:26
Zurb Foundation Pagination Function for WordPress
<?php
function foundation_pagination($before = '', $after = '') {
global $wpdb, $wp_query;
$request = $wp_query->request;
$posts_per_page = intval(get_query_var('posts_per_page'));
$paged = intval(get_query_var('paged'));
$numposts = $wp_query->found_posts;
$max_page = $wp_query->max_num_pages;
if ( $numposts <= $posts_per_page ) { return; }
if(empty($paged) || $paged == 0) {
@nusserstudios
nusserstudios / Contract Killer 3.md
Created March 31, 2016 12:44
The latest version of my ‘killer contract’ for web designers and developers

Contract Killer

The popular open-source contract for web professionals by Stuff & Nonsense

  • Originally published: 23rd December 2008
  • Revised date: March 15th 2016
  • Original post

ssh-keygen -E md5 -lf ~/.ssh/id_rsa.pub
@nusserstudios
nusserstudios / Composer ACF
Last active March 12, 2016 16:31
Advanced Custom Fields PRO for Composer
{
"repositories": [
{
"type": "package",
"package": {
"name": "advanced-custom-fields/advanced-custom-fields-pro",
"version": "5.0",
"type": "wordpress-plugin",
"dist": {
"type": "zip",
<?php
/**
* Foundation 5 Top Bar Menu Walker Class for WordPress 3.9+
*/
class Foundation_Walker extends Walker_Nav_Menu
{
function display_element( $element, &$children_elements, $max_depth, $depth=0, $args, &$output )
{
$element->has_children = !empty( $children_elements[$element->ID] );