Homepage › Community Forums › Legacy Theme Support › Read More…
Tagged: read more and more...
Hi,
I’ve added the “Read More” tag to almost 100% of my Posts. I’d like to be able to style the “Read More” but as it’s in the Dashboard I don’t know if I can style it thru the css stylesheet. If I can, where do I locate it…or maybe it’s inside Genesis and I can’t get at it? Is it able to be styled?
Thanx,
Tom tomjdolan.com
Yes you can edit this. If you take a look at the StudioPress Code Snippets page you’ll see this – http://my.studiopress.com/snippets/post-excerpts/#content-more-link ….you can add that code, but I would suggest renaming the function since it is already present in your portfolio file (to avoid duplicate errors). If you’re not using the portfolio template, then you can just add the code as is –
Then you can style it however you want by adding .more-link in your css.
Hi Wes,
Mornin’ from Tokyo. I looked the StudioPress code and saw that you’ve modified it a bit. When you say rename it, what do I rename? You’ve named it
>Read More< while StudioPress sez >[Continue Reading]<
So when I rename it, do I rename the top line of the code or the words within the brackets on the last line: >Read More< or >[Continue Reading]< or both locations? The reason I ask is that I will want to add a Portfolio Page in the future. Also,
When I add the code into my theme, I assume it goes into the php. functions, and if so, do I add it at the top of the functions code or do you suggest some other location within the functions list? Next,
Where is the best placement location in the css? And also, if I rename the code, does the css identifier .more-link still work in the css?
Thanx so much Wes,
Tom tomjdolan.com
Change the part that says – “custom_read_more_link” to something different, like – custom_read_more_link_2 or whatever you want.
Just add the code above to your functions file any where after the first
Hi Wes,
So I added the code you suggested into the php. functions file, and it looks like this:
// Add “Read More” link
add_filter( ‘excerpt_more’, ‘custom_read_more_link_2’ );
add_filter( ‘get_the_content_more_link’, ‘custom_read_more_link_2’ );
add_filter( ‘the_content_more_link’, ‘custom_read_more_link_2’ );
function custom_read_more_link_2() {
return ‘… <a class=”more-link” href=”‘ . get_permalink() . ‘” rel=”nofollow”>[Read More]</a>’; –I added these brackets– [ ] to the text.
}
As I didn’t blow-up my site, I was relieved. Then I added, my code creation to my css:
/* Read More Link
———————————————————— */
.more-link {
font-size: 14px;
font-color: #a80202;
}
Frankly Wes, I thought my css. looked as if you had done it…unfortunately it didn’t change much on the front end. What I saw was the addition of the Brackets, which is kinda neat, but no font change in size or color. So apparently my css is lacking something…what do you think Wes?
Thanx for all your assistance,
Tom
It should be color: #a80202; …….not font-color
Morning Wes,
While snapping pics of the Tokyo Marathon running past our Building this morning, I did adjust the css and it works well.
Thank you so much,
Tom
You’re Welcome!