Customizing the Read More link with WordPress
If you have set your WordPress site to display post excerpts on the front or home page, you will want visitors to click on the title or a link to encourage them to continue reading your post or article, right? WordPress makes this technique easy, and customizable.
Here is the steps:
- Go to wordpress admin panel --> Design tab --> Theme Editor.
- Select Main Index template (index.php) to edit it
- Find the lineĀ "<?php the_content('Read the rest of this entry »'); ?>"
- And replace it with the following code.
<?php
$content = get_the_content($more_link_text, $stripteaser, $more_file);
if(strlen($content)>500) // chanage 500 as per your needs
{
$part_msg=substr($content, 0, 500);// chanage 500 as per your needs
echo '<p>'.$part_msg.'... ';
?>
<br /><br />
<a href="<? comments_link(); ?>">Read More...</a></div>
<?php
echo '</p>';
}
else
{
echo '<p>'.$content.'</p></div>';
}
?>
Where "500" represents number of characters that you want to show.
If you cannot able to make the above changes with the wordpress theme editor, use your ftp.
Here is the template directory
/public_html/blog/wp-content/themes
or
/www/blog/wp-content/themes
where blog is the directory where i installed my wordpress
Problem with WordPress admin-login? or Forgot your WordPress admin password?
Reset your local wordpress password easily
While building my theme I installed wordpress with lots of sample data and I realized.
I forgot my password and couldn't recover it even with a "forgot password" link. So after
playing around for 30 mins, I reset my password. This is how.
Wordpress admin login error happen for two following reason:
- User may forgot the admin password
- User might have entered wrong site url in setting tab
go to your mysql administrator (usually called as phpmyadmin)
- select your wordpress database
- run the following update query with your password as in bracket using sql tab
SELECT 'wordpress' //this should be your database name
UPDATE `wp_users` SET `user_pass` = MD5( 'password' ) WHERE `ID` =1 LIMIT 1 ;
where password is your new password. Your password is reset, for the admin acount.
For admin side login problem, there might be another reason. You might have given wrong site
url. This can be update by the following query
UPDATE `wp_options` SET `option_value` = 'You site url' WHERE `wp_options`.`option_id` =1
LIMIT 1 ;
It will update your site url in the wp_options table and it will solve your login error.
