This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
define('WP_MEMORY_LIMIT', '128M'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function redirect_user_on_role() | |
{ | |
//retrieve current user info | |
global $current_user; get_currentuserinfo(); | |
//If login user role is Subscriber | |
if ($current_user->user_level == 0) | |
{ | |
wp_redirect( home_url() ); exit; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'tgmsp_caption_output', 'tgm_soliloquy_custom_html', 10, 4 ); | |
function tgm_soliloquy_custom_html( $html, $id, $image, $i ) { | |
// If the ID doesn't match the one we want to modify, return the default HTML output. Change 324 to your slider ID. | |
if ( '324' !== $id ) | |
return $html; | |
// Append custom code output of the caption to do whatever. $i is the number of the slide. | |
$html .= '<div class="my-custom-class"><p>My custom stuff!</p></div>'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var urlArray = ['http://url1.com', 'http://url2.com', 'http://url3.com']; | |
var random_url; | |
var redirect_after_milliseconds = 2000; | |
$(function() { | |
random_url = urlArray[Math.floor(Math.random() * urlArray.length)]; | |
setTimeout(function() { | |
// similar behavior as an HTTP redirect | |
window.location.replace(random_url) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php if ( is_user_logged_in() ) : ?> | |
<?php global $current_user; | |
get_currentuserinfo(); | |
?> | |
/* INSERT ContactForm7 ShortCode HERE */ | |
<?php echo do_shortcode( 'CONTACT_FORM_7_SHORTCODE' ); ?> | |
<script> $(function() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function fb_move_admin_bar() { | |
echo ' | |
'; | |
} | |
// on backend area | |
add_action( 'admin_head', 'fb_move_admin_bar' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Function to add featured image in RSS feeds | |
function featured_image_in_rss($content) | |
{ | |
// Global $post variable global $post; | |
// Check if the post has a featured image | |
if (has_post_thumbnail($post->ID)) | |
{ | |
$content = get_the_post_thumbnail($post->ID, 'full', array('style' => 'margin-bottom:10px;')) . $content; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
define( 'WP_DEFAULT_THEME', 'default-theme-folder-name' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function my_redirect( $to, $requested, $user ){ | |
if( !isset( $user->user_login ) ){ // we only want this to run when credentials have been supplied | |
return $to; | |
} | |
$regtime = strtotime($user->user_registered); | |
$now = strtotime("now"); | |
$diff = $now - $regtime; | |
$hours = $diff / 60 / 60; | |
if( $hours < 48 ){ | |
return "/somepage/"; // it's been less than 48 hours, redirect to message. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function va_string_is_null_or_empty($string) { | |
return (!isset($string) || trim($string) === ''); | |
} | |
function va_get_acf_imagetag_from_image_object( $image_object_fieldname, $image_size = '', $is_option_field = false, $is_sub_field = false ) { | |
$image_size = ''; | |
$image_width = ''; | |
$image_height = ''; |
OlderNewer