Community Forums › Forums › Archived Forums › General Discussion › Editing Featured Posts widget on homepage
- This topic has 15 replies, 5 voices, and was last updated 7 years, 2 months ago by
youmobile.
-
AuthorPosts
-
January 9, 2018 at 1:03 am #215218
greatbigterry
MemberHi, my homepage includes the Featured Posts widget on the homepage. I've set the widget in Customize to display the headline, text, a thumbnail and category of the post.
I'd like to reorder these and remove some text that shows before the category (removing "Filed Under:" Video-Audio) - how would I edit this in functions.php?
Many thanks
January 14, 2018 at 2:06 am #215372Brad Dalton
ParticipantYou'll need to use the widget settings or rewrite the function used in the featured posts widget.
January 14, 2018 at 2:33 pm #215388greatbigterry
MemberThanks Brad
Newb question, apologies, but how would I find out the name of the hook for the Features Posts widget? I'm actually using Featured Posts Advanced, but any info on how I'd find the name of the hook would be fantastic
January 14, 2018 at 11:01 pm #215397Brad Dalton
ParticipantI think in your case you might want to try CSS first to hide the text you don't want showing.
To reorder the different widget elements, you would need to rewrite the widget code rearranging the order of the code for each element.
January 15, 2018 at 12:07 am #215401greatbigterry
MemberThanks Brad - I've got a few other changes I'd like to make as well so I think I'll need to rewrite the widget code - how would I find the name of the hook to start learning how I rewrite this?
January 15, 2018 at 12:19 am #215402Brad Dalton
ParticipantJanuary 15, 2018 at 12:25 am #215403greatbigterry
MemberThanks Brad
January 15, 2018 at 1:44 am #215405nooxm123
MemberI'm too having this problem for the best mobile price and specs webstise. Can I do this with custom css?
January 16, 2018 at 11:37 am #215449nici-
MemberHi there,
I tried editing the post_info part in featured post widget. I want to change the output format of the post_comments to something like:
[post_comments zero="0" one="1" more="%"]
Thus I added this format details into the featured post widget on line 54:
'post_info' => '[post_date] ' . __( 'By', 'genesis' ) . ' [post_author_posts_link] [post_comments zero="0" one="1" more="%"]',
Only unfortunately the widget still outputs the default format including the word "Comments" etc.
Any hint on how I can change the output format of post_comment in featured post widget?
Best regards and thank you,
nici-
January 16, 2018 at 11:45 am #215450nici-
MemberSecond problem: When editing the output of featured post widget here
genesis > lib > widgets > featured-post-widget.php
than these changes will be overwritten by updating genesis, right?
I'd like to add some more content to the output like star rating etc. I guess there must be a hook to add things _into the content output_ of the widget?
Best regards
nici-January 16, 2018 at 12:01 pm #215451nici-
MemberOk, I found out I can define
zero="0" one="1" more="%"
right in the widget settings! Great!
January 17, 2018 at 10:03 pm #215483Brad Dalton
ParticipantThere is a filter you could try :
$title = apply_filters( 'genesis_featured_post_title', $title, $instance, $args );
January 17, 2018 at 10:25 pm #215484Brad Dalton
ParticipantActually, i think you'll need to rewrite the widget as that filter only modifies the post title.
January 18, 2018 at 1:12 am #215488greatbigterry
MemberHey Brad - when you say rewrite the widget, what does that mean? Where do we start to look to find this sort of thing out?
January 18, 2018 at 1:28 am #215490Brad Dalton
ParticipantSeptember 26, 2018 at 4:45 am #223408 -
AuthorPosts
- The forum ‘General Discussion’ is closed to new topics and replies.