Skip to content

Instantly share code, notes, and snippets.

View theukedge's full-sized avatar

Dave Clements theukedge

View GitHub Profile
[gravityform id="1" name="Contact Form" title="false" description="false" ajax="true"]
[gravityform id="1" name="Contact Form" title="false" description="false" ajax="true" tabindex="100"]
<?php
function featured_image_in_feed( $content ) {
global $post;
if( is_feed() ) {
if( has_post_thumbnail( $post->ID ) ){
$output = get_the_post_thumbnail( $post->ID, 'large', array( 'style' => 'float:right; margin: 10px;' ) );
$content = $output . $content;
}
if( has_post_format( 'gallery' ) ) {
<?php
if( get_post_meta( get_the_ID(), 'diww_sponsored', true ) == 'sponsored' ) {
// DO SOMETHING HERE IF TRUE
}
<?php
if( get_post_meta( get_the_ID(), 'diww_sponsored_type', true ) == 'giveaway' ) {
// DO THIS IF GIVEAWAY
}
<?php
if( get_post_meta( get_the_ID(), 'diww_sponsored', true ) == 'sponsored' ) {
if( get_post_meta( get_the_ID(), 'diww_sponsored_type', true ) == 'giveaway' ) {
$sponsored_content = '<p class="sponsored">This is a sponsored giveaway.</p>';
$sponsored_content .= $content;
return $sponsored_content;
}
}
<?php
if( get_post_meta( get_the_ID(), 'diww_sponsored', true ) == 'sponsored' ) {
if( get_post_meta( get_the_ID(), 'diww_sponsored_type', true ) == 'giveaway' ) {
$sponsored_content = '<p class="sponsored">This is a sponsored giveaway.</p>';
$sponsored_content .= $content;
return $sponsored_content;
}
if( get_post_meta( get_the_ID(), 'diww_sponsored_type', true ) == 'review' ) {
$sponsored_content = '<p class="sponsored">This is a sponsored review.</p>';
<?php
function diww_show_sponsor($content) {
if( get_post_meta( get_the_ID(), 'diww_sponsored', true ) == 'sponsored' ) {
if( get_post_meta( get_the_ID(), 'diww_sponsored_type', true ) == 'giveaway' ) {
$sponsored_content = '<p class="sponsored">This is a sponsored giveaway.</p>';
$sponsored_content .= $content;
return $sponsored_content;
}
if( get_post_meta( get_the_ID(), 'diww_sponsored_type', true ) == 'review' ) {
<?php
function diww_pre_content($content) {
$pre_content = '<p class="sponsored">This is sponsored content.</p>';
$pre_content .= $content;
return $pre_content;
}
add_filter( 'the_content', 'diww_pre_content' );
<?php
// DISPLAY USER'S FIRST NAME
function user_first_name() {
global $current_user;
get_currentuserinfo();
$first_name = esc_attr( $current_user->user_firstname );
return $first_name;
}