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 custom_login_logo() { | |
echo | |
'<style type="text/css"> | |
h1 a { | |
background-image:url('.get_site_url().'/wp-content/uploads/login.png) !important; | |
background-size: 100% auto !important; | |
margin-left: 8px !important; | |
width: 312px !important; | |
} | |
</style>'; |
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
UPDATE wp_options SET option_value = replace(option_value, 'http://localhost:8888/wordpress', 'http://www.YOUR_SITE_URL.com') WHERE option_name = 'home' OR option_name = 'siteurl'; |
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 excerpt_readmore($more) { | |
return '... <a href="'. get_permalink($post->ID) . '" class="readmore">' . 'Read More' . '</a>'; | |
} | |
add_filter('excerpt_more', 'excerpt_readmore'); ?> |
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_filter( 'use_default_gallery_style', '__return_false' ); |
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 twtreplace($content) { | |
$twtreplace = preg_replace('/([^a-zA-Z0-9-_&])@([0-9a-zA-Z_]+)/',"$1<a href=\"http://twitter.com/$2\" target=\"_blank\" rel=\"nofollow\">@$2</a>",$content); | |
return $twtreplace; | |
} | |
add_filter('the_content', 'twtreplace'); | |
add_filter('comment_text', 'twtreplace'); | |
?> |
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
// Back To Top | |
$('a.top').click(function(){ | |
$(document.body).animate({scrollTop : 0},800); | |
return false; | |
}); | |
//Create an anchor tag | |
<a class=”top” href=”#”>Back to top</a> |
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
$(‘img’).load(function() { | |
console.log(‘image load successful’); | |
}); |
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 | |
//Insert ads after second paragraph of single post content. | |
add_filter( 'the_content', 'prefix_insert_post_ads' ); | |
function prefix_insert_post_ads( $content ) { | |
$ad_code = '<div>Ads code goes here</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
<?php | |
function show_image_sizes( $sizes ) { | |
$new_sizes = array(); | |
$added_sizes = get_intermediate_image_sizes(); | |
// $added_sizes is an indexed array, therefore need to convert it | |
// to associative array, using $value for $key and $value | |
foreach( $added_sizes as $key => $value) { | |
$new_sizes[$value] = $value; |
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 excerpt_read_more_link($output) { | |
global $post; | |
return $output . '<a href="'. get_permalink($post->ID) . '">Read All ...</a>'; | |
} | |
add_filter('the_excerpt', 'excerpt_read_more_link'); | |
?> |
OlderNewer