Skip to content

Instantly share code, notes, and snippets.

@andyknapp
andyknapp / remove-submenu.php
Created November 14, 2013 01:11
remove WP submenu pages from dashboard for gravity forms
function ak_remove_submenu_pages() {
if( !current_user_can('administrator') ) {
remove_submenu_page( 'gf_edit_forms', 'gf_edit_forms' );
remove_submenu_page( 'gf_edit_forms', 'gf_new_form' );
remove_submenu_page( 'gf_edit_forms', 'gf_new_formf_help' );
// remove_submenu_page( 'gf_edit_forms', 'gf_entries' );
remove_submenu_page( 'gf_edit_forms', 'gf_settings' );
remove_submenu_page( 'gf_edit_forms', 'gf_export' );
remove_submenu_page( 'gf_edit_forms', 'gf_update' );
remove_submenu_page( 'gf_edit_forms', 'gf_addons' );
@andyknapp
andyknapp / excerpt
Created November 7, 2013 19:05
Replace WP's default [...] after an excerpt to the permalink
function new_excerpt_more( $more ) {
return ' <a class="read-more" href="'. get_permalink( get_the_ID() ) . '">Read More</a>';
}
add_filter( 'excerpt_more', 'new_excerpt_more' );
@andyknapp
andyknapp / childpg-menu
Created October 31, 2013 18:16
Display a menu of child pgs on parent pg
<?php
$children = wp_list_pages('title_li=&child_of='.$post->ID.'&echo=0&sort_column=menu_order');
if ($children) { ?>
<section class="child-menu parent-pg">
<ul>
<li class="icon-arrow"></li>
<?php echo $children; ?>
</ul>
</section>
@andyknapp
andyknapp / menu-class.js
Created October 10, 2013 16:35
add a class to menu item based on matching (absolute) urls.
jQuery(document).ready(function($){
// Get current url
// Select an a element that has the matching href and apply a class of 'active'. Also prepend a - to the content of the link
var url = window.location.href;
$('.menu a[href="'+url+'"]').addClass('current_menu_item');
});
@andyknapp
andyknapp / wp-breadcrumbs.php
Last active December 24, 2015 07:39
WordPress breadcrumbs
<?php
global $post; // first check if pg has parent
if ( is_page() && $post->post_parent ) { ?>
<section class="child-menu">
<?php
$parent_url = get_permalink($post->post_parent);
$parent_title = get_the_title($post->post_parent);
if ( $parent_url != the_title('', '', false) ) {
echo '<a class="sub-child" href='. $parent_url . '>' . $parent_title . '</a> <span>&raquo;</span> ';
@andyknapp
andyknapp / functions.php
Created August 22, 2013 15:43
expand editor role capabilities to include gravity forms
function add_grav_forms(){
$role = get_role('editor');
$role->add_cap('gform_full_access');
}
add_action('admin_init','add_grav_forms');
@andyknapp
andyknapp / functions.php
Created August 22, 2013 15:36
remove WP dashboard widgets
function ak_remove_dashboard_widgets() {
remove_meta_box( 'dashboard_quick_press', 'dashboard', 'side' );
remove_meta_box( 'dashboard_primary', 'dashboard', 'side' );
remove_meta_box( 'dashboard_secondary', 'dashboard', 'side' );
remove_meta_box( 'dashboard_incoming_links', 'dashboard', 'normal' );
remove_meta_box( 'dashboard_recent_comments', 'dashboard', 'normal');
}
add_action('wp_dashboard_setup', 'ak_remove_dashboard_widgets' );
@andyknapp
andyknapp / functions.php
Created August 22, 2013 15:29
deregister plugin css files
function ak_deregister_styles() {
wp_deregister_style( 'soliloquy-style' );
wp_deregister_style( 'tribe-events-calendar-style');
}
add_action( 'wp_print_styles', 'ak_deregister_styles', 100 );
@andyknapp
andyknapp / functions.php
Last active December 21, 2015 12:49
Remove menu items from WP dashboard for all user roles expect admin
function ak_remove_menu_pages() {
if( !current_user_can('administrator') ) {
remove_menu_page('link-manager.php');
}
}
add_action( 'admin_menu', 'ak_remove_menu_pages' );

Website Contract [month] [year]

Description of this Contract

This contract is not meant to trick or deceive you; the intention is purely to protect both parties. I have tried to keep the wording as plain as possible, but if anything is unclear, please let me know and I will be more than happy to clarify it with you. Also, until you sign it, please feel free to request to change bits of it to suit your requirements.

In short, [client name] is contracting me, [my name], to [description of my role] between [start date and finish date].

By signing this, you are confirming that you have the power and ability to enter into this contract on behalf of [client's company].