• Resolved MirkoB82

    (@mirkob82)


    Hello,

    i’m developing a website with Sydney by A-Themes installed, but i noticed that in this theme there is no “no-featured image” template for posts, nor the template editor available.

    As i created a specific taxonomy for posts (i have “Pages”, “posts”, and “characters”), i would like to create a post template for the theme that is not showing the featured image in its body – while having “standard” posts showing it.

    Any help would be appreciated as i’m not that confident with php at the moment (just css but css is applied to all posts regardless of their taxonomy).

    thanks!

Viewing 7 replies - 1 through 7 (of 7 total)
  • Moderator t-p

    (@t-p)

    I recommend asking at https://wordpress.org/support/theme/sydney/#new-post so its developers and support community can help you with this.

    Moderator bcworkz

    (@bcworkz)

    If you do not specify a featured image, none will be displayed πŸ™‚

    I assume you know this and have some other reason for hiding featured images. You could hide them with custom CSS, but the image will still consume bandwidth. Sydney is a classic theme with PHP based templates. You could create a child theme which includes custom templates such as one that does not display featured images. Customizing templates does involve PHP coding, but since you’d be mainly removing featured image code, it doesn’t require a deep knowledge of PHP.

    Sydney may have a setting to suppress featured images that you and I are unaware of, so t-p’s above suggestion remains a good one.

    Thread Starter MirkoB82

    (@mirkob82)

    @bcworkz hello, and thanks for replying.

    Actually, in my website i would like to suppress featured image just on post loading (dunno whether it’s in pre-content or in content loading actually), and not to suppress from the whole post, as i would like it to appear in the posts carousel.

    To make it simple, i have a list of charachters and as i can’t define a specific template for such content taxonomy (characters’ posts), i was about to create a page layout with SiteOrigin blocks, including the featured image but paginated in a different way, then put the featured image in a block of those (actually, also standard blocks would function) – therefore suppress featured image from post body because i would have the featured image displayed twice otherwise.

    If thers’s a simpler way to edit the template (but Sydney doesn’t allow to open template editor), i would surely appreciate!

    I tried to open post-full.php on atom, but i found just this code:

    <div id="primary" class="content-area">
        <main id="main" class="site-main" role="main">
    
        <?php
            while ( have_posts() ) : the_post();
                the_content();
            endwhile;
        ?>
    
    
        </main><!-- #main -->
    </div><!-- #primary -->

    and i can’t find the code which this call is pointed at … – nor to edit it.

    @t-p ok i’ll post the question in their board as well, thanks!

    Ps: if you both have more suggestions on how to deal with the problem, i thank you in advance.

    Moderator bcworkz

    (@bcworkz)

    I believe Sydney outputs the featured image from its content-single.php file. In WP PHP code, a featured image is called a post thumbnail, even when its a big full width image. It looks like there’s a theme setting somewhere where you can specify featured image display, though it likely applies site wide, not for a particular post type. As always, theme specific support forums are the best place to learn about theme specific features.

    It’s not a good idea to alter theme templates. Instead you can override default theme behavior by using templates in a child theme. A child theme can be used to store all manner of custom code, not just templates. You can cause WP to use a specific template for your custom post type by naming it a certain way.

    You could copy Sydney’s content-single.php file over to your child theme, naming it as shown in the above link. To suppress featured image output, comment out any sydney_single_post_thumbnail() calls.

    Thread Starter MirkoB82

    (@mirkob82)

    Hello. @bcworkz thanks for the help!

    yes, i have a “sydney child” created, which i use to add css into its own style.css file without harming the father theme.

    seems like i solved it someway, but unintentionally: what i actually did, is to take “page.php” (Default php for all pages) and take it to the Child Theme with the name “page-personaggio.php” (“personaggio” is the content Type created with CPT-UI).

    I thought i had to delete or comment some lines as you suggested, but actually the featured image disappeared from the default position (i can see it, but because i recalled it from the post editor in a 2-columns section). Do you confirm?

    https://amicomics.com/personaggio/dummy-character/

    thanks

    Moderator bcworkz

    (@bcworkz)

    I don’t know Sydney well enough to explain how you managed to suppress the featured image in its usual position, but the results speak for themselves. If the layout is as you desire, then it’s all good πŸ™‚

    Thread Starter MirkoB82

    (@mirkob82)

    Thanks for your reply πŸ˜‰ well, that’s a first step πŸ™‚ i’ll customize it with siteorigin from now on and i’ll clone posts and save the layout to keep the scheme on all characters. Thanks for now πŸ™‚

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘hide featured image from post body based on taxonomy’ is closed to new replies.