- This topic has 20 replies, 4 voices, and was last updated 3 years, 4 months ago by
Igor.
-
AuthorPosts
-
July 28, 2017 at 2:37 pm #356446
Zach
I have a custom post type and regular posts/pages, and I’d like to avoid showing the featured image above their single posts.
Single Post Header Location is set to “hide” in the customizer. That works for posts/pages, but the featured image is still showing on CPT single posts. Is this something related to the beta Page Header system? (I have no Page Header defined in the admin, and no mappings in the Global Locations, but if I make an empty Page Header and apply it to my CPT as a location, the featured image still shows.)
I can work around it by using the “disable elements” metabox on each Artwork post but that seems like a hack. Am I missing something? (Note: I’ve only been using CPTs for a few days before switching to GPP beta, so I’m not 100% sure that this behavior is related to the beta.)
July 28, 2017 at 4:55 pm #356482Leo
StaffCustomer SupportHi there,
That’s not due to beta.
Give this a shot: https://generatepress.com/forums/topic/remove-featured-image-on-custom-post-type/#post-337093
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/July 28, 2017 at 8:17 pm #356521Tom
Lead DeveloperLead DeveloperThe Single Post Page Header option set to hide should remove it from all post types.
Can you link me to the post?
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentJuly 29, 2017 at 12:08 am #356550Zach
Thanks for getting back to me. The snippet didn’t work (tweaked for my CPT name “artwork”).
Here’s a link that shows the problem:
https://www.zachpoff.com/site/artwork/pondstation/and another where the featured image was successfully removed via “disable elements” metabox:
https://www.zachpoff.com/site/artwork/witnesses-trikaya/FYI: These CPT posts used to be pages, but I used the Post Type Switcher plugin to switch them to the Artwork CPT. They seem to work fine in all other respects so I doubt it’s related.
July 29, 2017 at 10:18 am #356728Tom
Lead DeveloperLead DeveloperAny chance you can send me temporary admin login details?: https://generatepress.com/contact/
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentJuly 29, 2017 at 2:20 pm #356828Zach
Done. (via pre-sales form)
And to thicken the plot, I just noticed that single Pages are showing the errant featured images too. This site is in transition so there are currently Posts, Pages, & CPTs that all began as Pages long ago.In summary:
Posts (“DIY Resources”) no featured image (as per customizer)
Pages (“Software”): featured images showing
CPT’s (“Artwork”) featured images showingJuly 30, 2017 at 1:43 am #356959Zach
FYI… All theme-specific customizations are in a child theme. All theme-agnostic stuff (registering CPT) is in a plugin.
July 30, 2017 at 11:32 am #357168Tom
Lead DeveloperLead DeveloperBasically what’s happening here is the Single Post Page Header option is meant for the “post” post type only, so setting it to hide is only going to work on single blog posts.
Obviously not ideal – those Page Header location options are quite old and need to be re-worked.
Did this work “correctly” prior to 1.4?
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentJuly 30, 2017 at 11:40 am #357171Tom
Lead DeveloperLead DeveloperIn GPP 1.5, we’ll be focusing on blog options, including single featured image options (same as the current featured image options). This will allow us to change the location and remove featured images from single posts.
For now, try this:
add_action( 'wp', 'tu_remove_single_cpt_page_header' ); function tu_remove_single_cpt_page_header() { if ( 'artwork' == get_post_type() ) { remove_action( 'generate_after_header','generate_page_header' ); } }
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentJuly 30, 2017 at 1:31 pm #357225Zach
That snippet worked for the CPTs. However the featured images are still showing on Pages, strangely, they’re within the post content area instead of the page header. example:
https://www.zachpoff.com/site/software/brightsign-video-sync-scripts/
Any ideas about that?
I made the CPT just a few days before switching to GPP beta, but I’m pretty sure they were displaying normally in the release version. I’m willing to downgrade to check if you give me some guidance (if it won’t mess up the db). This site is months away from being public so I’m willing to experiment!
Looking forward to 1.5’s blog options. As mentioned in another thread I’d really appreciate an option to put text over images in the blog index, like a stripped-down alternative to fancy grid plugins. (Not thrilled with hover effects and corny animations, but I love the clean look of a grid of images with titles and optional metadata overlaid) example:
http://the7.io/main/portfolio/portfolio-grid/3-portfolio-grid/July 30, 2017 at 6:32 pm #357307Tom
Lead DeveloperLead DeveloperI just made an adjustment – any chance I can link you to the version with this change so we can test it out before I release another release candidate?
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentJuly 30, 2017 at 10:17 pm #357340Zach
Absolutely.
July 31, 2017 at 10:32 pm #357877Tom
Lead DeveloperLead DeveloperHaven’t forgotten about you – just cleaning some things up to make sure I have it working 100%.
Will let you know 🙂
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentAugust 3, 2017 at 4:05 pm #359424Tom
Lead DeveloperLead DeveloperI just released RC.2 which should fix this issue.
Let me know 🙂
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentAugust 4, 2017 at 5:19 am #359632Zach
Removed the snippet you posted earlier and upgraded to RC.2.
It works for my Custom Post Types (archive and single posts):
CPT archive: https://www.zachpoff.com/site/artwork/
CPT single: https://www.zachpoff.com/site/artwork/pondstation/
(note that the yellow banner is created using the new Page Header system with all Global Locations selected.)BUT…
CPT taxonomy archive pages ignore the new Page Header system completely:
https://www.zachpoff.com/site/artwork/type/installation/I noticed another issue relating to custom image sizes in the Page Header, but I’ll continue that on this thread since it’s only visible in situations where the new Page Header system is turned off.
-
AuthorPosts
- You must be logged in to reply to this topic.