• Resolved Rui Freitas

    (@rui-freitas)


    Hi.

    Is it possible to remove the featured image from the posts but keep it on the featured post?(I’m not sure my question is clear…) πŸ™

Viewing 15 replies - 1 through 15 (of 15 total)
  • Its not very clear actually. What is a featured post?

    Thread Starter Rui Freitas

    (@rui-freitas)

    I called it featured post because I am not english natural speaker and as my version is translated, I don’t know the correct name.
    what I would really mean is the post that we can tag as featured to display on the home page of the site.
    Is it better now?…
    πŸ™

    I understand you now, and you did get the term right. Twenty Fourteen has a special tag that puts posts tagged ‘featured’ on top.

    What happens if you only set featured images on featured posts?

    Thread Starter Rui Freitas

    (@rui-freitas)

    Ok.

    The question is that I only want to display one featured post at a time and need the featured images on the posts eligible to the recent posts plugin.

    Thread Starter Rui Freitas

    (@rui-freitas)

    Hi photocurio.

    Did you gave up on me?

    I did look at Twenty Fourteen, and I don’t think it is possible to do what you want with just the default functions of the theme.

    It would be possible to do if you made a child theme, and modified the home page template. It requires some knowledge of php to change the code that displays the posts. Its not that simple.

    Thread Starter Rui Freitas

    (@rui-freitas)

    But I really have a child theme…

    Could you tell me that code so I can enter it in there?

    On the other hand, I removed from the child-theme the line which I suposed is responsible to exclude the featured image from the posts,

    .single .header-image { display: none; }

    but it did not change anything.

    I don’t think its the header image. This is how it works:

    1. The featured image is displayed with the function twentyfourteen_post_thumbnail();.
    2. The template that shows the regular posts (not the featured posts) is called content.php.

    To remove the featured images from posts that are not featured posts, you need to copy the content.php file into your child theme folder. Then delete or comment out line 14, which calls twentyfourteen_post_thumbnail.

    Thread Starter Rui Freitas

    (@rui-freitas)

    Finally I understand and I noticed that this line was already commented.
    So I activated it and now I have the featured images on the regular posts, but not on the featured post.

    Thats strange. I did test it on my machine.. but I don’t have much direct experience with twenty fourteen. Maybe I’m missing something.

    Do you see that any template you copy to your child theme folder will override the same template in the parent? That’s the key.

    You know that you can see what template is being called up. For example, in index.php there is a conditional:

    if ( is_front_page() && twentyfourteen_has_featured_posts() ) {
    	// Include the featured content template.
    	get_template_part( 'featured-content' );
    }

    That is how I know that featured-content.php shows the featured posts. Lower down you can see that the default content template (content.php) is displaying the normal posts. If you need to confirm that you are working on the correct template, you can add something like <p>here I am</p> to some spot in a template and see where that paragraph shows up. I do this often.

    Hopefully you have enough info at this point to debug your theme. And maybe post a link?

    Thread Starter Rui Freitas

    (@rui-freitas)

    I am sorry but the information that you are giving me is too much for my level of knowledge.

    For example, I think I don’t understand what you mean with: “Do you see that any template you copy to your child theme folder will override the same template in the parent?”

    No file on the parent directory was overridden by any other child-theme directory.

    My site is artesecontextos.com coul you take a look

    I was concerned that I was getting too technical. But that part really is essential to modifying a theme with a child theme. Maybe there is a Portuguese tutorial on child themes for wordpress?

    Nice site BTW. You do some good work there!

    Thread Starter Rui Freitas

    (@rui-freitas)

    Thank you for your opinion, It’s very kind.
    And thank you for your concern, it is really too technical but I have a child-theme and I undestand how it works. I also know handling files and enter code in them, which thanks to my experience of digging, I understand a little (little) bit.
    If you could tell me the code to enter and where to enter I can do it.

    I did give you the code that I would expect to work. that it doesn’t work correctly on your site indicates:

    • My reasoning is faulty
    • your implementation of my code is faulty
    • something else is going on that we don’t know about (conflict with a plugin perhaps)

    This sort of thing happens all the time when working with code. Its called de-bugging. I would encourage you to learn more about how your site works, especially since you have a child theme, which is a good first step. There might be some good online tutorials in Portuguese. I know there are plenty in english. I’ve studied a lot at teamtreehouse.com.

    Thread Starter Rui Freitas

    (@rui-freitas)

    Ok thank you very much for your patience.
    I beleive is “something else”.
    I will continue to try by myself, studying and digging.
    Best regards,
    Rui

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

The topic ‘Featured Image’ is closed to new replies.