Horje
Custom Widget Request - Wordpress Solution
[Solved] - Custom Widget Request - Wordpress Solution
Try following codes
Hi, I am in need of a custom widget that I can add to the functions.php file of my wordpress theme. I would like a custom widget for 'recent posts'. I would like for it to have the exact same functionality as the default 'recent posts' widget (allow user to enter title and choose how many posts to display). The only thing I would like changed is the output. Instead of just displaying the post title with the link to the post, I would like to display the post title and below that the first 25 words of the post content with a "..." added at the end. Here is the static HTML to give you an idea of how I'd like the the final output to appear. The post title should be in an

and the post content below it should be wrapped in a

. Also, the post content should link to the post.


<h4>March 7, 2010</h4>
<p class="footer_post"><a href="#">Aunt Polly placed small trust in such evidence. She went out to see for herself; and she would have been content to find twenty per cent. of Tom’s statement true...</a></p>


<h4>February 28, 2010</h4>
<p class="footer_post"><a href="#">Within two minutes, or even less, he had forgotten all his troubles. Not because his troubles were one whit less heavy and bitter to him than...</a></p>



<h4>February 14, 2010</h4>
<p class="footer_post"><a href="#">Tom appeared on the sidewalk with a bucket of whitewash and a long-handled brush. He surveyed the fence, and all gladness left him and a deep melancholy settled...</a></p>


Solution - 1

No worries, currently working on it... a widget from scratch so you don't have to do nothing else that just copy & paste...


Solution - 2

Have you checked this plugin out? http://wordpress.org/extend/plugins/advanced-most-recent-posts/

Date: 2022-10-21 05:23:03
Category: Wordpress
More for You