Community Forums › Forums › Archived Forums › General Discussion › Don't want excerpt, do want "read more"
- This topic has 11 replies, 2 voices, and was last updated 11 years ago by David Chu.
-
AuthorPosts
-
April 3, 2013 at 5:50 pm #32955haddonMember
I'm using the Genesis Featured Widget Amplified to show a title, featured image, and a link with "Read More" to a page. But the "Read More" won't show unless I say I want an excerpt (which I don't want). I tried putting in a 0 or 1 length excerpt, which does display the "Read More" but adds ... in front of it. I want to move the "Read More" to the right, which I can do - but it leaves the ... on the left because there is apparently no CSS associated with the ...
You can see it here: http://50.116.121.193/~wealthbr/聽for the time being, but if I can't figure this out I'm going to have to hard-code this! Takes the flexibility away from the widget framework, but I can't figure out any other way to do it. (Or am I missing something really simple?)
Thanks for your help,
CarolApril 3, 2013 at 6:05 pm #32962David ChuParticipantHi Carol,
Right, I just used that widget, and I forgot that it has the 3 dots even though it lets you play with the text.I have a bit of code that filters the "more" stuff, but I don't know if it will work in the context of that plugin. It might. I've seen contexts where it gets hairy, because if there's a loop happening, it may grab the wrong $post, so at times I've had to write a custom loop instead. If you want to try it, these goodies will go in your functions.php.
add_filter('excerpt_more', 'new_excerpt_more'); function new_excerpt_more($more) { global $post; return ' <a href="'. get_permalink($post->ID) . '">click to learn more</a>'; }
Funny, as I thought about this, at times I might just use a pinch of jQuery code to kill the dots. 馃檪
Cheers, Dave
Dave Chu 路 Custom WordPress Developer – likes collaborating with Designers
April 4, 2013 at 9:34 am #33083haddonMemberHi Dave, thanks for your reply. I did add this to my functions.php and while it didn't break anything, unfortunately it didn't change anything either. I imagine that the plugin is somehow taking priority? It seems that it's not even processing this function (I changed the "learn more" text and that's not showing on the page). But if I change a different function on the page, I CAN see the effect, so it is the right functions.php file...
Any other thoughts before I hard code?
Thank you again,
CarolApril 4, 2013 at 9:58 am #33092David ChuParticipantCarol,
Yes, I thought that might happen. Plugins often contain their own loops, and unless you're a hard-core coder, this may be a biggish deal. Here's something fun. Under Genesis... Theme Settings, at the bottom there are spots to place Header and Footer scripts. You could add this bit of code to the wp_head part and save. If it doesn't work, or you get an error, just delete the code. I think it will work, though. It should take out the 3 dots only in your featured post output. 馃檪<script type="text/javascript"> jQuery(document).ready(function($) { $('.featuredpost p').html( function (foo,oldhtml) { var content = oldhtml.replace("...",""); return content; }); }); </script>
Dave
Dave Chu 路 Custom WordPress Developer – likes collaborating with Designers
April 4, 2013 at 10:57 am #33109haddonMemberThanks for your effort... but alas, no luck. The code is in the header but the page still looks the same. I also substituted "…" for "..." just to see if that would make a difference (it didn't). Looking at your code (not that I know JQuery but) it sure looks like it should work. Oh well.
Thanks again!
Carol
April 4, 2013 at 11:47 am #33120David ChuParticipantOh, wow, you're right! That's a single character. I didn't see that, and that is a stock WordPress irritant. 馃檪 Your fix would have been my first try. That may be beyond me without tearing apart your code and plugin.
One last idea you can try. Shut off wptexturize. It's a blunt instrument, so if it does work, check your other content carefully. 馃檪 This line in functions.php:
remove_filter('the_content', 'wptexturize');
Beyond that, office visit required, or just hard-code it. 馃檪
Dave
Dave Chu 路 Custom WordPress Developer – likes collaborating with Designers
April 4, 2013 at 12:37 pm #33137haddonMemberWow, that didn't do it either. I wonder what the issue is. It should be a really stripped-down simple site. Metric on Genesis. The only plugin that's active is Genesis Featured Widget Amplified. (I had Genesis Simple Sidebars and Gravity Forms, but I deactivated them for testing.)
Oh well, spent way too much time on this problem. Just was thinking if it ever came up again, I'd already have it fixed!!
Thank YOU so much for your input and effort. I'm not sure I'll ever be able to help you, but I'll certainly pay it forward to someone else...
Carol
April 4, 2013 at 12:51 pm #33142David ChuParticipantCarol,
I hear ya. And I went a bit further on this than usual, as it got my dander up. 馃檪 When one is not hands-on, it's always a challenge, but good practice for my interpretive (and psychic) abilities. 馃檪Nice to meet someone smart and pleasant! Maybe I'll see you around. I do Twitter all the time, and hang out with #GenesisWP people there.
Best,
Dave
Dave Chu 路 Custom WordPress Developer – likes collaborating with Designers
April 4, 2013 at 1:00 pm #33148haddonMemberBack at 'cha! I also enjoyed your food blog post about making mayonnaise. My daughter was just saying that she wanted to do that!! The Universe does strange things, doesn't it?
Thanks again.
Carol
April 4, 2013 at 1:25 pm #33156David ChuParticipantCarol,
Yes, it does work in strange ways! Glad you enjoyed that. I make a mean hamburger, too! 馃檪btw, I just got my test bed site to behave in the above scenario. (it was driving me nuts, and I have a designer I work with who may want ellipsis squelched someday!) I used the filter on content, and then my original jQuery above vanished the dots. I slightly steered you wrong, I think. In your case, your plugin may be using "excerpt" instead of "content". That darned filter does convert various on-the-fly.
If so, you can try this in functions.php. It may work, unless he/she is using some hand-coded loop, in which case PHP plugin programming required:
remove_filter( 'the_excerpt', 'wptexturize' );
Best, Dave
Dave Chu 路 Custom WordPress Developer – likes collaborating with Designers
April 4, 2013 at 2:42 pm #33176haddonMemberSigh. That didn't do it either. This is beyond me, unfortunately. Although I did modify home.php and renamed it front-page.php because I wanted the client to be able to easily update his homepage content using the WYSIWYG interface. (I followed a blog post/tutorial by Nick who created the Widget Amplified on how to do that, although now that I'm thinking about it, maybe I introduced some problem in that process that is causing this.)
Anyway, enough!
Thanks so much for everything,
Carol
April 4, 2013 at 3:07 pm #33183David ChuParticipantThis reply has been marked as private. -
AuthorPosts
- The forum ‘General Discussion’ is closed to new topics and replies.