Tagged: child theme, Latest News, Widget
-
AuthorPosts
-
March 28, 2014 at 4:29 pm #244450
Hello,
we would like to edit the Latest News widget and to ensure edits won’t get overwritten with new theme updates. We have already installed a Child Theme but cannot figure what include files need to be copied over so class-framework-widgets.php edits would take place.
What we want to do is remove the dates (yes this can be done with css) and make the images bigger (up from the 36 pixels).
Thank you!
March 29, 2014 at 11:21 am #244743Hi hypermediamarketing!
1) Please use the code I posted here: https://kriesi.at/support/topic/remove-dates-displayed-in-child-latest-news-widget/#post-241094 and place it into the child theme functions.php
2) To increase the size of the image use this css code:
.image_size_widget .tweet-thumb img, .image_size_widget .news-thumb img { width: 36px; height: 36px; } .image_size_widget .news-thumb { height: 44px; width: 44px; }
You can also use a bigger thumbnail size but then you must install a plugin like: http://wordpress.org/plugins/simple-image-sizes/ to increase the widget preview thumbnail size.
Regards,
PeterMarch 31, 2014 at 12:19 pm #245397Thank you for your answer, this solved 2/3 of the issues!
How can we remove the time from the widget as well? As a quick fix using
.image_size_widget .news-time { display: none; }
but is there a hook we can use much like for the date?
March 31, 2014 at 5:21 pm #245528Hi!
Actually the date & time output uses the same code & filter. The code I posted here: https://kriesi.at/support/topic/remove-dates-displayed-in-child-latest-news-widget/#post-241094 should remove the date & the time.
Cheers!
PeterMarch 31, 2014 at 5:56 pm #245572Hi again!
I don’t know if it’s our version of the setup or what but it’s only removing the date.
Set up:
Version: 2.5
Installed: enfold
AviaFramework Version: 1.8.6
AviaBuilder Version: 0.5Before custom code:
<span class="news-time">February 5, 2014 - 1:23 am</span>
After adding to functions.php:
function change_avia_date_format($date, $function) { return false; } add_filter('avia_widget_time', 'change_avia_date_format', 10, 2);
this is what we get:
<span class="news-time">1:23 am</span>
March 31, 2014 at 6:14 pm #245589Hi!
Ok, I think I found the problem. We’ll fix it with the next update. For now please hide the time with css or delete this line in enfold\framework\php\class-framework-widgets.php
echo "<span class='news-time'>".get_the_time($time_format)."</span>";
Cheers!
PeterMay 14, 2018 at 12:59 pm #956413Hi, I would like to override this file too, I have an addition to make into the code for the latest news widget, I have only been able to do this by hacking the class-framework-widgets.php file in the parent theme. I did this on a job months ago and updated recently to find my additions were gone. Luckily I had a staging ste which had the additions still in place so was able to replace the code again, it would be great to be able to sort this within the child theme.
May 16, 2018 at 7:17 am #957339Hi,
Just copy the whole latest new widget in the child theme’s functions.php file without the function_exist check. That should override the widget on the parent theme.
Best regards,
IsmaelJanuary 21, 2019 at 5:59 pm #1056831Hope I’m not posting on the wrong thread …
Is it possible to offset the posts included in the widget? For example, if I use the widget on the home page, I would like it to skip over the first 3 posts because I already have those showing on the page.
January 22, 2019 at 1:28 pm #1057181Hi djsparks,
Which widget are you referring to?
Could you please give us a link to your website, we need more context to be able to help you.
Best regards,
VictoriaJanuary 22, 2019 at 9:21 pm #1057448I’m referring to the widget this thread is about, the Latest News widget.
Thank you!
January 23, 2019 at 5:08 pm #1057819Hi djsparks,
Well, you’ll need to modify the code of the avia_newsbox widget. There is no easy snippet that can do that, unfortunately.
If you need further assistance please let us know.
Best regards,
Victoria -
AuthorPosts
- You must be logged in to reply to this topic.