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
<!doctype html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8" /> | |
<!--<meta http-equiv="refresh" content="2">--> | |
<title>refresh</title> | |
<link rel="stylesheet" href="style.css" /> | |
</head> | |
<body> | |
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
.box{ | |
width: 728px; | |
height: 90px; | |
padding: 5px; | |
display: inline-block; | |
-moz-box-shadow: 0 0 8px #8b3d92; | |
-webkit-box-shadow: 0 0 8px #8b3d92; | |
box-shadow: 0 0 8px #8b3d92; | |
-moz-border-radius: 8px; | |
-webkit-border-radius: 8px; |
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
global $wpdb; | |
$post_name = get_query_var('name'); | |
$post_id = $wpdb->get_var("SELECT ID FROM $wpdb->posts WHERE post_name = $post_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
/* | |
Remove title attribute from wp_tag_cloud | |
Adding this snippet to the functions.php of your wordpress theme will remove the title=”” attribute from the anchor tags when using wp_tag_cloud. | |
*/ | |
function replace_wps_title_att($output) { | |
$output = preg_replace('` title="(.+)"`', '', $output); | |
return $output; | |
} |
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
/* | |
Send email notification when user role changes | |
Adding this snippet to the functions.php of your wordpress theme will send the member an email notification when the user’s role has changed. | |
*/ | |
function user_role_update( $user_id, $new_role ) { | |
$site_url = get_bloginfo('wpurl'); | |
$user_info = get_userdata( $user_id ); | |
$to = $user_info->user_email; | |
$subject = "Role changed: ".$site_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
/* | |
Add post divider in between two posts or more | |
Add this snippet right before the closing of the loop to auto insert a post divider “div” that you can style using the “post-item-divider” class. | |
*/ | |
<?php | |
if (($wp_query->current_post + 1) < ($wp_query->post_count)) { | |
echo '<div class="post-item-divider">Post Divider</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
/* | |
Adjust settings on theme activation | |
Place this in your functions.php to adjust your default WordPress settings when activating your theme for the first time. This function also deletes the default post, page and comment that are created when you install WordPress. | |
*/ | |
add_action( 'after_setup_theme', 'the_theme_setup' ); | |
function the_theme_setup() | |
{ | |
// First we check to see if our default theme settings have been applied. | |
$the_theme_status = get_option( 'theme_setup_status' ); |
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
/* | |
Count total number of jpg, gif, png images in media library | |
Adding the first snippet to the functions.php of your wordpress theme will display a count of all images within the media library. Add the second snippet in the location you wish to display the count total. | |
use this : <?php img_count(); ?> | |
*/ | |
function img_count(){ | |
$query_img_args = array( | |
'post_type' => 'attachment', | |
'post_mime_type' =>array( |
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
/* | |
Countdown timer shortcode, display content after specified date | |
use this : [cdt month="10" day="17" year="2011"] | |
This is content that will only be shown after a set number of days. | |
*/ | |
function content_countdown($atts, $content = null){ | |
extract(shortcode_atts(array( | |
'month' => '', | |
'day' => '', |
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
/* [image src="" width="" height="" align=""][/image] */ | |
add_shortcode("image","gsn_image"); | |
function gsn_image($atts, $content=''){ | |
extract( shortcode_atts( array( | |
'src' => 'none', | |
'content'=> $content, | |
'width' => '', | |
'height' => '', | |
'align' => 'center' | |
), $atts ) ); |
OlderNewer