Skip to content

Instantly share code, notes, and snippets.

View theukedge's full-sized avatar

Dave Clements theukedge

View GitHub Profile
<?php
function below_the_title() {
echo '<h3>Make sure your title is punchy and relevant to the content.</h3>';
}
add_action( 'edit_form_after_title', 'below_the_title' );
function below_the_editor() {
echo '<h4>Now remember to add in your tags, categories and featured image!</h4>';
<?php
// SEND ACCESS LEVEL TO GRAVITY FORMS
function get_access_level(){
global $user_ID;
$plan_id = rcp_get_subscription_id( $user_ID );
$access_level = rcp_get_subscription_access_level( $plan_id );
return $access_level;
}
<?php
// DISABLE CERTAIN FIELDS
function enqueue_gf_disable() {
wp_enqueue_script( 'gf-disable', plugins_url( '/scripts/gravity-forms-disable.js', dirname(__FILE__) ) );
}
add_action( 'wp_enqueue_scripts', 'enqueue_gf_disable' );
jQuery(document).ready(function($){
$(".gform_wrapper .disable input").attr('disabled','disabled');
});
<?php
// DISPLAY YOUR AGE //
function whats_my_age_again($birthday) {
extract( shortcode_atts( array(
'birthday' => 'birthday'
), $birthday));
return date("Y", time() - strtotime($birthday)) - 1970;
}
I am [show-my-age birthday="02/19/1985"] years old.
<?php // get post attachments
$post_attachments = get_posts( array (
'post_type' => 'attachment',
'post_parent' => $post->ID
));
?>
<ul>
<?php foreach ( $post_attachments as $post_attachment ) {
echo '<li>' . wp_get_attachment_link( $post_attachment->ID, '', false, false ) . '</li>';
} ?>
<?php if( in_category( array( '52', '59', '60', '61', '62', '63' ) ) || is_category( array( 52, 59, 60, 61, 62, 63 ) ) || is_page( '9875' ) ) { // SYSTEMS MENU
wp_nav_menu( array('menu' => 'systems-menu', 'container' => false, 'items_wrap' => '<ul id="primary-main-menu" class=%2$s><li class="first-child-divider"></li>%3$s</ul>', 'fallback_cb' => false));
}
#side-tabs a.support {
background: url('http://www.yourdomain.com/wp-content/themes/yourtheme/images/support-tab.png');
left: 0px;
top: 250px;
height: 108px;
width: 45px;
margin: 0;
padding: 0;
position: fixed;
z-index: 9999;
<div id="side-tabs">
<a class="support" href="http://www.yourdomain.com/support-request/"></a>
</div>