-
Author
-
August 15, 2014 at 21:49 #25765nicheleadParticipant
Hi,
My site is set to auto-display the featured image of a post at the top of the post.
[Theme Options – Blog – Display media on post page (ON)].This option setting works fine for posts and some CPTs, but
For some Custom Post Types I don’t want the feature image to be auto-displayed at the post.
I create custom php template files to display single custom posts, and the problem is that the theme options setting I mentioned above keep displaying the large feature image at the top of the custom post.Can you please help me with a code snippet (at least until there is a setting in the theme options to select which post types) to insert in the function.php of the child theme, that will let me define which post types to exclude from this default theme behavior.
Thanks 🙂
August 18, 2014 at 17:36 #25919CatalinModeratorHello,
The template can be found here:
C:\wamp\www\wordpress\wp-content\themes\sweetdate\content-image.php
You can use this file by copying it in your child theme folder and remove this part:
COPY CODE<?php if (get_post_thumbnail_id()) { ?> <div class="twelve columns"> <div class="article-media clearfix"> <?php the_post_thumbnail();?> </div><!--end article-media--> </div><!--end twelve--> <?php } ?>
Thank you,
CatalinHi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionAugust 21, 2014 at 13:13 #26298giorgosParticipantI try to achieve the same. Do not display Featured image for some custom post types. How can I achieve this on Kleo?
Thanks!
August 21, 2014 at 18:30 #26330AbeKeymasterfor custom post types try editing wp-content\themes\sweetdate\content.php
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution---
@ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.August 22, 2014 at 13:57 #26384giorgosParticipantThanks Abe, but still not manage to achieve this. I have a custom post type (mycred_rank) and I want to have a featured image for this type as for the normal posts, but instead I don’t want the image to be displayed. (huge image is displayed at the top of the page, although the featured image is small)
Can you help?
August 22, 2014 at 15:59 #26394sharmstrModeratorI haven’t tested this, but I think you can copy /kleo/content.php to your child theme, then edit line 36
COPY CODE<?php if ( kleo_postmedia_enabled() && kleo_get_post_thumbnail() != '' ) : ?>
to
COPY CODE<?php if ( kleo_postmedia_enabled() && kleo_get_post_thumbnail() != '' && get_post_type() != 'mycred_rank' ) : ?>
Let me know if that works or not.
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
August 24, 2014 at 06:02 #26465sharmstrModeratorAwesome.
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
-
AuthorPosts
The topic ‘disable featured image auto display in custom post type’ is closed to new replies.