• Resolved chocolateteapot

    (@chocolateteapot)


    My featured image is displaying twice.

    I’ve watched some tutorials and that doesn’t seem to happen. I’ve chosen the ‘replace content’ option.

    I don’t think it’s a problem with Pods, I think it’s a problem with the placement of the featured image within the theme? I wondered if there was a workaround?

    This is the code that I’ve used in the Pods template.
    `<div class=”page-content”>
    <article id=”{@ID}” class=”{@ID} our_team type-our_team alliance-member status-publish has-post-thumbnail hentry”>
    <div class=”image”>
    <a href=”{@website}” target=”_blank” rel=”noopener”><img src=”{@post_thumbnail_url.medium}” title=”{@post_title}” ></a> </div>
    <div class=”content”>
    <h3 class=”title”>{@post_title}</h3>
    <div class=”regency”></div> <div class=”entry-content”>
    {@post_content}
    </div>
    </div>
    <div class=”extra-info”>
    <p class=”email”><i class=”fa fa-envelope thim-color”></i><a href=”mailto:{@email}”>{@email}</a></p><p class=”email”><i class=”fa fa-phone thim-color”></i>{@tel}</p>
    <ul class=”thim-social”>
    <li><a href=”{@facebook}” class=”facebook”><i class=”fa fa-facebook”></i></a></li>
    <li><a href=”{@twitter}” class=”twitter”><i class=”fa fa-twitter”></i></a></li>
    <li><a href=”{@instagram}” class=”instagram”><i class=”fa fa-instagram”></i></a></li>
    </ul>
    </div>
    </article>
    <div class=”clear”></div>

    </div>
    Any help appreciated, thanks.

    The page I need help with: [log in to see the link]

Viewing 7 replies - 1 through 7 (of 7 total)
  • Hi
    Is the smaller image what you are after, is that right?

    The larger image looks like it is the featured image from a blog page and probably outputted from the theme’s single template.

    You would have to modify the blog page template, if you don’t need that one.

    WordPress Template Hierarchy

    Morris

    Thread Starter chocolateteapot

    (@chocolateteapot)

    Thanks. Is there any way of telling Pods to use a different type of page template?

    I’ve run into this. I don’t want to fight with my themes so for Pods CPTs I disable the featured image and create my own image fields. That ensures they only show once despite what the theme post template might want to do, and it also allows me to control placement and flow in auto templates. I know there’s a principle of using whatever WordPress gives you and I’m going against that. Sorry.

    Hi
    You can use a single page with the CPT.

    i.e. single-cpt.php, where cpt is equal to you Custom Post Type’s name

    Copy your single page into single-cpt.php and modify the code where it outputs the feature image. I normally just add ‘//’ in front so that that code isn’t executed and if all looks OK, I then delete that line.

    Resave it and you should be good to go.

    I normally install another plugin that tells me the template being used. So if you have created your new page it should say it at the top in the admin menu if you have it switched it on.

    Morris

    Thread Starter chocolateteapot

    (@chocolateteapot)

    Thanks very much!

    I’ve hidden the elements that I don’t want for now.

    Hi
    How have you hidden the elements for now?

    Did you hide them on the single.php template? If so then normal blog or Post CPT’s won’t have a featured image also.

    I would have created another single page just for your CPT.

    Morris

    Thread Starter chocolateteapot

    (@chocolateteapot)

    I used css to target the new content type and then used {display: none;} to hide the blog header and the featured image.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Featured Image’ is closed to new replies.