Tagged: x
-
AuthorPosts
-
December 14, 2016 at 7:59 pm #1293683
WPDaveParticipantI’m displaying excerpts with a recent_posts short code:
[recent_posts count=”2″ orientation=”horizontal” enable_excerpt=”true”]
This causes the entire excerpt to be part of the link to the post. I’d prefer not to have that entire excerpt be styled as a link. I would prefer to have only the “Read More” text at the end of the excerpt be the anchor.I’ve been using the x_shortcode_recent_posts_v2code function given elsewhere on this forum and I’ve tried modifying the function to put the tag deep inside of the $output string instead of at the outer level. Unfortunately, this causes the recent_posts styling to fall apart because the CSS styling depends on the HTML structure not being changed. E.g., there is a CSS class that sets the width (when using the horizontal orientation):
.x-recent-posts a.x-recent-post2 {
width: 48%;
}If I change the outer to a <div> and put the around a “Read More” string the layout falls apart.
Is there any relatively easy way to make just the “Read More” text be the link?
David Salahi
Staging site: http://pia.videoperformance.video/December 14, 2016 at 10:03 pm #1293761
WPDaveParticipantOK, never mind. As sometimes happens, I kept working the problem after posting my request and eventually I came up with a good solution. I added some CSS to change the text color inside the recent_post object back to the standard text color. Then, I edited the functions.php file to strip off the “Read More” text which is included in that text. Finally, outside the <span> which includes that text I added the Read More text back in and gave it its own class which I could then use to style as an anchor.
Problem solved.
December 14, 2016 at 11:23 pm #1293816
RupokMemberGlad that you are all set now. Have a nice day!
-
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-1293683 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>
