Skip to content

Instantly share code, notes, and snippets.

/*social sharing buttons*/
.social a{
display:inline-block;
margin:10px 10px 5px 0;
padding:10px 15px;
color:#fff;
font-weight:bold;
text-align:center;
text-decoration:none;
border-radius:5px;
function get_the_user_ip() { if ( ! empty( $_SERVER['HTTP_CLIENT_IP'] ) ) { //check ip from share internet $ip = $_SERVER['HTTP_CLIENT_IP']; } elseif ( ! empty( $_SERVER['HTTP_X_FORWARDED_FOR'] ) ) { //to check ip is pass from proxy $ip = $_SERVER['HTTP_X_FORWARDED_FOR']; } else { $ip = $_SERVER['REMOTE_ADDR']; } return apply_filters( 'wpb_get_ip', $ip ); } add_shortcode('show_ip', 'get_the_user_ip');
Redirect 301 /oldpage.html http://www.MyAwesomeWebsite.com/newpage.html
function adsense() {
return ‘
<!– Start Here –>
Paste Your Adsense Code Here
<!– End Here –>
‘;
}
add_shortcode(‘adsense’, ‘adsense′);
.adstyle {
background:#f4f4f4;
width:927px;
height:90px;
text-align:right;
float:right;
border:solid 1px #c7c7c7;
}
<?php
function the_breadcrumb() {
global $post;
echo '<ul id="breadcrumbs">';
if (!is_home()) {
echo '<li><a href="';
echo get_option('home');
echo '">';
echo 'Home';
echo '</a></li><li class="separator"> / </li>';
<link rel="icon" href="http://www.MyAwesomeWebsite.com/favicon.ico" type="image/x-icon" />
<link rel="shortcut icon" href="http://www.MyAwesomeWebsite.com/favicon.ico" type="image/x-icon" />
function custom_login_logo() {
echo '<style type="text/css">
h1 a { background-image:url(/images/logo.jpg) !important; }
</style>';
}
add_action('login_head', 'custom_login_logo');
function my_login_logo_url() {
return get_bloginfo( 'url' );
}
add_filter( 'login_headerurl', 'my_login_logo_url' );
function my_login_logo_url_title() {
return 'Your Site Name and Info';
}
add_filter( 'login_headertitle', 'my_login_logo_url_title' );
<?php
class WP_HTML_Compression
{
// Settings
protected $compress_css = true;
protected $compress_js = true;
protected $info_comment = true;
protected $remove_comments = true;
// Variables