View Full Version : Customize the Read More Tag
Hi,
I am looking to customize the read more text and make it look more like a button..
I have attached an example..
http://www.brianjmccloud.com/wp-content/uploads/2011/05/read_more.png
Let me know what you think & what I need to do in order to make this work.
Dan Nickerson
05-30-2011, 04:58 PM
You an just insert the html for the button into our custom read more option field in every post.
<img src="buttonimageurl">
Or if you need to do it for a lot of posts, it will have to be hardcoded and I don't have an answer for you right now on that.
Ok,
I was going to try that but wasn't sure if I could put HTML in that field..
I would prefer though to try and hardcode it into the website.
I have a sample of a code from another theme that I use but I'm not sure how to implement it into socrates..
Here is the code:
.read-more {-moz-border-radius:3px; border-radius: 3px; background:url("images/Read-More.gif") repeat-x scroll left top transparent; border:1px solid #DDDDDD; color:#FFFFFF; cursor:pointer; font-size:13px; font-weight:bold; padding:3px 10px; text-decoration:none; vertical-align:bottom; margin-bottom: 20px;}
a.read-more:hover { border-color: #FFFF00; color:#FFFF00; outline: medium none;}
Let me know if you come up with a solution.
Thank You,
Chap
Dan Nickerson
05-30-2011, 06:39 PM
In index.php
Find.
<?php the_content($readMoreText); ?>
Replace with
<?php the_content('<img src="' . get_bloginfo('template_directory'). '/images/imagename.jpg" alt="read more" title="Read more..." />'); ?>
Make sure you upload to image directory and match filename.
More info
http://codex.wordpress.org/Customizing_the_Read_More
Thanks Dan.. You're the man - I'll try it in the morning and let you know how it goes.
six-figure-income
08-31-2011, 05:31 AM
I am looking to add the more tag to posts that are already on my site in a bulk action rather then manually doing it for each post?
Is there a way to set it so that after so many lines of text the more tag gets applied?
Is the above code good to use? How and where would I use it?
Lisa
Dan Nickerson
08-31-2011, 09:08 AM
There's much not point to going back and doing posts that don't appear on the main page any more.
What you describe is an excerpt and your categories and archives already do it.
I would just make sure that your last 10-20 posts use the more tag.. because it's unlikely anyone will ever see the more tag on older posts.
Powered by vBulletin® Version 4.1.10 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.