Skip to main content

Posts

Showing posts with the label admin hack

Inserting custom content after each post programmatically

There are time when you may want to automatically display a custom text below each of your posts. You can hard-code it, but why do it when there is better way to do so using a WordPress hook. Here’s how to do. Paste the following code into your functions.php and save the file. Custom content will be inserted below each of your posts. function add_post_content($content) { if(!is_feed() && !is_home()) { $content .= ' This article is copyright © '.date('Y').' '.bloginfo('name').' '; } return $content; } add_filter('the_content', 'add_post_content'); Related Articles: Inserts Posts Programmatically to WordPress Insert Categories & Tags Programmatically to WordPress

Customizing the wordpress login page without Plugin

Every one love to see their site totally branded. It does feel good when your users see the WordPress login page when they have to login, may be just to post a comment. Biggest problem come when you are developing for a client. Well though most of them don't know the solution is simple. You don't have to rely on any plugin just to do few modifications on the login page. You just have to add few lines to your functions.php file within your theme folder. "This is the final result, after adding the below code to functions.php" add_action("login_head", "my_login_head"); function my_login_head() { echo "<style>body.login #login h1 a { background: url('".get_bloginfo('template_url')."/styles/logo.gif') no-repeat scroll center top transparent; height: 49px;width: 229px; margin-left:auto;margin-right:auto; } body {background: url('".get_bloginfo('template_url')."/styles/bg.jpg') re...