Community Forums › Forums › Archived Forums › General Discussion › Academy Pro: Remove Featured images from Category template
- This topic has 12 replies, 4 voices, and was last updated 7 years, 6 months ago by
jcd.
-
AuthorPosts
-
January 22, 2018 at 2:20 am #215604
greatbigterry
MemberHi - i'd like to remove Featured images from showing on category pages.
What is the exact code to do this please?
January 22, 2018 at 2:35 am #215605Brad Dalton
ParticipantApril 19, 2018 at 1:57 pm #219120Chuck
MemberBrad, I have been working with this theme and have tried the above. I need to remove the images in the category "news" so, none of the post use featured images. BUT Academy Pro grabs an image from the post to create a post thumbnail that is included above the post.
I created a category-news.php template. I added a "content-sidebar" layout just to test if it was working and it is.
However, the above does not remove the image: http://ccec2.flywheelsites.com/category/news/
I wonder if /lib/featured-image.php or /lib/grid-layout.php is running after the template? Any help would be appreciated.
Chuck Smith
Twitter: @polishedwpApril 19, 2018 at 2:40 pm #219123Brad Dalton
ParticipantIt's been repositioned in functions.php so the standard code will not work. Use this:
https://gist.github.com/braddalton/99fd598dab76b79a79f907e8200e4b67#file-category-php
April 19, 2018 at 3:52 pm #219124Chuck
MemberThanks Brad, I ended up wrapping in a function:
add_action( 'genesis_entry_header', 'cs_category_no_image'); function cs_category_no_image() { if (is_category( 'news')) { remove_action( 'genesis_entry_header', 'genesis_do_post_image', 8 ); } }Works perfectly.
Chuck Smith
Twitter: @polishedwpMay 12, 2018 at 10:23 am #219800jcd
MemberThis seems to be the closest related to what I'm trying to do...
I notice when I drop a full-width image into a post, it automatically turns it into a featured image above the blog article (even when I don't designate a featured image).
EDIT: And now I notice if I remove the photo from the post, it remains as the featured image. strange?
How would I just get rid of the featured image function altogether? see an example here: http://jcdf.jcdeen.com/sometimes-you-need-to-put-the-most-focus-on-this/
May 12, 2018 at 10:27 am #219802Brad Dalton
ParticipantThere's code in the lib > featured-images.php file between lines 35 - 49 which you can remove.
May 12, 2018 at 10:31 am #219803jcd
Memberthanks, but not sure I see it?
May 12, 2018 at 10:52 am #219805jcd
MemberActually, I misread.
Is there a way to cancel it out in the functions file? I don't want to edit too many things. I know for the purpose of a framework, it's important to focus on the style.css and functions.php file.
May 12, 2018 at 11:07 am #219806Brad Dalton
ParticipantMay 12, 2018 at 11:09 am #219807jcd
Memberright, but is there a way to cancel it out via the functions file?
or will altering the featured-images.php file affect future updates?
May 13, 2018 at 8:34 am #219822Brad Dalton
ParticipantMay 14, 2018 at 9:30 am #219843jcd
Memberit worked thanks
-
AuthorPosts
- The forum ‘General Discussion’ is closed to new topics and replies.