Year Shortcode For WordPress

Here is to show year in your WordPress just copy paste this code to your theme function.php file function year_shortcode() { $year = date(‘Y’); return $year; } add_shortcode(‘year’, ‘year_shortcode’); now Use [year] in your posts.

Customize Login Page of WordPress

Change the Logo Image Change the wordpress logo with your logo by this code (paste these lines in your theme function.php file) function custom_login_logo() { echo ‘<style type=”text/css”>h1 a { background: url(‘.get_bloginfo(‘template_directory’).’/images/logo-login.gif) 50% 50% no-repeat !important; }</style>’; } add_action(‘login_head’, ‘custom_login_logo’); Change the URL Of Logo On login page of wordpress when you click on logo […]

Change Text Selection Color Using CSS

/* Mozilla based browsers */ ::-moz-selection { background-color: #DE6B1E; color: #fff; } /* Works in Safari */ ::selection { background-color: #DE6B1E; color: #FFF; } /* Works in Opera */ ::-o-selection { background-color: #DE6B1E; color: #FFF; } ::-ms-selection { background-color: #DE6B1E; color: #FFF; } /* Works in Internet Explorer */ ::-webkit-selection { background-color: #DE6B1E; color: #FFF; […]

SEO Tips & Tricks

1. Don’t Discard Your Hyperlinks

A quite typical trouble for a lot of webmasters is that 70 % of their new links indicate and 30 % of their incoming links indicate Online search engine think that these are 2 totally various web pages on your web site, for that reason the material on obtains just 70 % of the “link passion” it actually is entitled to. How to take care of that? You should make a 301 Redirect from one web page to the other and your troubles are gone. Look into the folder with index. htm, index. php or whatever your website is making use of. There ought to be a. htaccess documents – if there isn’t one, just make it with any type of text editor. When you have actually a. htaccess data, add those lines to it:.

RewriteEngine On.
RewriteCond % HTTP_HOST ^ [NC] RewriteRule ^(. *)$$1 [L, R=301]

Show Your Latest Tweet In Just 5 Lines Of Code

This piece of code is just awsome as it lets you show your latest tweet with no more than 5 lines of code using the twitter search feed. Add this code to functions.php function wp_echoTwitter($username){ include_once(ABSPATH.WPINC.’/rss.php’); $tweet = fetch_rss(“” . $username . “&rpp=1”); echo $tweet->items[0][‘atom_content’]; } To display latest tweet within your theme, use the […]

Add “Read More” Permalink To The End Of The_Excerpt

Adding this snippet below into the functions.php file of your WordPress theme will add a “read more” permalink at the end of the_excerpt, pretty much like what the_content does. function excerpt_readmore($more) { return ‘… <a href=”‘. get_permalink($post->ID) . ‘”>’ . ‘Read More’ . ‘</a>’; } add_filter(‘excerpt_more’, ‘excerpt_readmore’);

How Do I Make A Picture As A Background On My Web Pages?

Point the body background to the name of your image you wish to use as the background as shown below. This body line should be the first line after your < / head> tag. <body background=”picture.gif”> You can also have the background image fixed, so it does not move when using the scroll bar in […]