Wordpress Themes - WP Forum at BFA
There will be no more development for Atahualpa (or any other theme), and no support. Also no new registrations. I turned off the donation system. I may turn the forum to read only if it gets abused for spam. Unfortunately I have no time for the forum or the themes. Thanks a lot to the people who helped in all these years, especially Larry and of course: Paul. Take care and stay healthy -- Flynn, Atahualpa developer, Sep 2021

Wordpress Themes - WP Forum at BFA » WordPress Themes » Atahualpa 3 Wordpress theme » Center area post/pages »

[SOLVED] Hiding the featured image from specific posts


  #1  
Old Jun 9, 2013, 05:11 PM
emanuel1969's Avatar
emanuel1969
 
133 posts · Apr 2010
California
Send a message via Skype™ to emanuel1969
Hi everyone,

I would like to hide the featured image on specific posts. My idea is to create a custom field (hide_featured_image") and set its value to "yes". Then use some php code like the following:

-----
$shouldHideFeaturedImage = get_post_meta($post->ID, 'hide_featured_image', true);

if ( $shouldHideFeaturedImage != 'yes' ) {
if ( has_post_thumbnail() ) {
the_post_thumbnail('medium');
}
}
-----
Am I on the right track here? And where would I put this code? People told me I should look for the single.php file but I can't find it.

Thanks!
Emanuel
__________________
Emanuel
http://www.sferios.com
  #2  
Old Jun 9, 2013, 07:13 PM
lmilesw's Avatar
lmilesw
 
10,176 posts · Jul 2009
Central New York State USA
How about just using CSS targeted to those specific pages and featured images?
__________________
~Larry (CNY Web Designs)
This site should be a membership site since it so full of good stuff.
Please consider donating which gives you access to even more good stuff.
  #3  
Old Jun 9, 2013, 08:15 PM
emanuel1969's Avatar
emanuel1969
 
133 posts · Apr 2010
California
Send a message via Skype™ to emanuel1969
The problem with that is that it is a daily news site, and there are many content contributors. I need them all to be able to choose whether the featured image displays inside the post or not.
__________________
Emanuel
http://www.sferios.com
  #4  
Old Jun 9, 2013, 08:35 PM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
You will need to make some changes in bfa_post_parts.php arond line 149 (v 3.7.12)
  #5  
Old Jun 9, 2013, 08:51 PM
emanuel1969's Avatar
emanuel1969
 
133 posts · Apr 2010
California
Send a message via Skype™ to emanuel1969
Actually Juggledad, that affects the display of the thumbnail on multi-post pages. What I am wanting to do is remove the featured image from select "single-post" pages.
__________________
Emanuel
http://www.sferios.com
  #6  
Old Jun 9, 2013, 09:03 PM
emanuel1969's Avatar
emanuel1969
 
133 posts · Apr 2010
California
Send a message via Skype™ to emanuel1969
OMG never mind! I'm the one who added a widget area to the single post pages then used a php-enabled text widget in order to display the featured image there to begin with!!!

It was just so long ago I forgot.

I thought the featured image was showing up on single post pages automatically.

Problem solved. Thanks!
__________________
Emanuel
http://www.sferios.com
  #7  
Old Jun 9, 2013, 09:19 PM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
Featured images are for multi post pages. And if you don't want the featured image why not remove it from the post edit page?
  #8  
Old Jun 9, 2013, 10:43 PM
emanuel1969's Avatar
emanuel1969
 
133 posts · Apr 2010
California
Send a message via Skype™ to emanuel1969
It's complicated. We use featured images everywhere in our multipost pages. But we also wanted the featured image to appear at the top of single-post pages too, in a large format. So I programmed some php to make this happen and put it in a text widget that I made appear at the top of each post using a plugin called "widgets in posts" (or something like that).

But they I discovered that there are some posts we do NOT want the featured image to appear at the top. These are essentially posts that are only embedded videos.

Why all this matters is hard to explain, but if you look at the site you can get an idea of how complex it is. This is a daily news site with a number of post contributors. To make all the news articles standardized, I made it so the featured image was also the main article image at the top of the single-post page. This means the contributor does not have to embed an image into the article if they do not know how to do that. It also automatically standardizes the size of the image so they don't have to adjust it.

It's working perfectly. Check it out. It's really my best site ever:

http://www.popularresistance.org

Emanuel
__________________
Emanuel
http://www.sferios.com
  #9  
Old Jun 9, 2013, 10:45 PM
emanuel1969's Avatar
emanuel1969
 
133 posts · Apr 2010
California
Send a message via Skype™ to emanuel1969
To make a long story short, there are a lot of people who add content to this site, and I had to make it stupid-simple for them to avoid constant mistakes happening.
__________________
Emanuel
http://www.sferios.com

Bookmarks



Similar Threads
Thread Thread Starter Forum Replies Last Post
Remove image from specific posts on home page feed. bangert Montezuma Theme 6 Oct 10, 2012 01:26 AM
[SOLVED] post-specific header image w/ css insert (page-specific ones work, but not o viewdesigninc Header configuration & styling 10 Oct 1, 2012 04:43 PM
[SOLVED] Featured Image Now Not Working On Any New Posts After Upgrade anpbaystate New Versions, & Updating 2 Jan 20, 2012 07:22 PM
Desperately looking for help with HIDING header image on one specific page Cristiacus Header configuration & styling 0 Jun 2, 2009 04:50 PM


All times are GMT -6. The time now is 12:06 PM.


Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.