Forum Replies Created
-
AuthorPosts
-
ludvigMember
It no longer crashes my page when I changed it to:
add_action('genesis_post_content', 'remove_featured_image_specific_category');
function remove_featured_image_specific_category() {
if( is_single( array( 140, 145, 154, 91, 160, 161, 162, 173, 180, 206, 194, 213, 239, 291, 312, 323, 333, 382, 424, 493, 516, 562, 622, 659, 684, 717, 752, 791, 750, 816, 847, 862, 884, 889, 950, 969, 1030, 1015, 1057, 1086, 1105, 1159, 1185, 1228, 1246, 1257, 1263, 1295 ) ) ) {
remove_action( 'genesis_post_content', 'genesis_do_post_image' );}
}
But it produces no effect
ludvigMemberThanks for being persistent in helping me Brad, but I am a hardcase at this stuff 🙂
I am having trouble understanding how I am supposed to change the conditional tags appropriately.. I managed to do it the last time but this is proving a bit difficult.
Here is how the code looks for my previous PHP that was successful in removing the featured image from inside the posts:
/** Add post image above post title */
add_action( 'genesis_before_post', 'streamline_post_image' );
function streamline_post_image() {if ( is_single( array( 140, 145, 154, 91, 160, 161, 162, 173, 180, 206, 194, 213, 239, 291, 312, 323, 333, 382, 424, 493, 516, 562, 622, 659, 684, 717, 752, 791, 750, 816, 847, 862, 884, 889, 950, 969, 1030, 1015, 1057, 1086, 1105, 1159, 1185, 1228, 1246, 1257, 1263, 1295 ) ) ) return;
if ( is_page ( 28 ) ) return;if ( $image = genesis_get_image( 'format=url&size=post-image' ) ) {
printf( '', get_permalink(), $image, the_title_attribute( 'echo=0' ) );
}}
How would I go about adjusting the new code you suggested?
Here is how I have written it right now just under the section above , but it is obviously completely wrong as it crashes my page:add_action('genesis_post_content', 'remove_featured_image_single');
function remove_featured_image_single() {
if(is_single( 140, 145, 154, 91, 160, 161, 162, 173, 180, 206, 194, 213, 239, 291, 312, 323, 333, 382, 424, 493, 516, 562, 622, 659, 684, 717, 752, 791, 750, 816, 847, 862, 884, 889, 950, 969, 1030, 1015, 1057, 1086, 1105, 1159, 1185, 1228, 1246, 1257, 1263, 1295 ) ) {
remove_action( 'genesis_post_content', 'genesis_do_post_image' );}
}
I basically just replaced where you had category to what had worked in the code above for me seeing as how there are many posts that need to be adjusted and the issue is non-category specific,. But it didn't work. I am messing up the code because I don't really understand how to write it properly yet.
ludvigMemberYES, now it is beginning to come out well!
Thanks a bunch Ryan!
ludvigMemberHm.. That's weird.
It WORKS now... I wonder why it didn't work before. I am doing nothing new.
However, I have a new question. I would like to know if it is possible to make the bottom of the quote BOX become smaller, I feel it is disproportionally large. I would like it to end right after - like this:
top line
"...............................xyz.......
...................."- Jack McDonald
bottom line immediately ending after the nameRight now there is a gap under the name, and that is what i would like to remove or diminish.
ludvigMemberI thought I put that it...
NVM. Here it is, sorry about that:
- http://www.startgainingmomentum.com/
I'll switch from my "orange border" quote - which works - into the incorrect one to see if you can find out what is wrong.
Thanks!
ludvigMemberI've been trying to use the CSS code (and checked out your post on it on your blog) and yeah it works, but it effectively eliminates ALL the featured images in the posts shown on my home page/ blog template.
And I do not want to completely eliminate it, I only want it to be hidden from the "ugly", old images, that I have in my previous blog posts. I want to keep the featured pictures showing in the home page/blog template for all the new posts I make.
Thus far I have been able to eliminate the featured images inside the posts by using the ".single (array( post id)" command that you showed me.
But those ugly featured images are still showing on the home page/blog template.
Is there no way to customize it on the home page/blog template in the exact same manner that I've been able to do with the posts?
Perhaps I am misunderstanding this, I am very new to PHP/CSS.
ludvigMemberActually I was wrong, the issue is not entirely resolved.
I only fixed it INSIDE the posts by doing that. So now I got 50 % of the problem solved.
http://www.startgainingmomentum.com/
If you take a look at my blog you'll note that on the home/front page it looks bad with the featured pictures. But inside the posts it looks as it should.I already got the correct array and combinations of IDs, I just need to understand which code to use so that I can remove the same combination of featured images from my front page.
I've tried a bunch of different variations, including is_home and is_front_page but I am coming up short for the moment.
Any thoughts of what I can do?
ludvigMemberThe issue has now been resolved, though it took some time to manually look up and write all the IDs.
I want to note for future readers that in my case it had to be is single not is page, because all of my old blog posts that look horrible with the Streamline featured image function were single posts.
Thanks a lot Brad,
I will likely post a few more questions in the coming days and weeks seeing as how I have so much to learn and so much to do until I am content with the appearance of my blog. I hope they too will be answered as quickly and skillfully!🙂
ludvigMemberHey again,
I've been trying to get it working, but I'm having some trouble. I've only been toying with CSS & PHP files for two weeks and barely understand how to structure it.
Question:
1.Do I need to collect every PageID and insert manually into the code? (Because none of my old posts fit the format for the featured above picture and would therefore not look well with it)
2. Once having collected these PageIDs (not the hard part), WHERE and HOW do I put them into the PHP, could you post an example? When I say how, what I'm really asking is how to separate the IDs and how to "finish" the code.
Would it be like this?/** Add post image above post title */
add_action( 'genesis_before_post', 'streamline_post_image' );
function streamline_post_image() {if ( pageID1, pageID2, PageID3, etc...() ) return;
if ( $image = genesis_get_image( 'format=url&size=post-image' ) ) {
printf( '', get_permalink(), $image, the_title_attribute( 'echo=0' ) );
}}
ludvigMemberWow, thanks a lot for the quick answer Brad!
I'll post again if I get a problem.
-
AuthorPosts