Community Forums › Forums › Archived Forums › General Discussion › I think a gremlin stole my custom field video display
Tagged: Custom fields, display video, post category page, video embed
- This topic has 7 replies, 2 voices, and was last updated 11 years, 3 months ago by
Summer.
-
AuthorPosts
-
December 20, 2013 at 6:21 pm #80533
tanyaslogos
MemberI have a website that I built eons ago - I put the below code in the functions.php file to display a smaller video box on the post category page but for some reason the video no longer displays. (perhaps it is just tired - like me)
What's weird is that It isn't completely broken. The lovely "class=postvideo" shows up where the video should be as if to say NEENER which I find to be completely RUDE!
If it was REALLY broken I would probably just ditch it all together but it's working just enough to make me CRAZY and now I kinda NEED to know why it isn't working properly. Or I need to be committed - the jury is still out.
CODE:
// Add video to post category page
add_action('genesis_before_post_content', 'child_video_field');
function child_video_field() {
if( is_category(array(81,113,114,131)) && genesis_get_custom_field('postvideo') )
genesis_custom_field('postvideo','class=postvideo');
}I have searched the web over to find a solution and have come to the conclusion that I am the only one affected by this affliction. Any help anyone could offer would be greatly appreciated.
Sincerely,
https://guatemalanhuipils.com/category/videos/
TanyaDecember 20, 2013 at 10:10 pm #80563Summer
MemberThe videos show up in the actual individual posts, so I'm guessing that maybe a recent updated to something broke concerning how those videos were displayed in excerpts.
Did you update a plugin, or Genesis or something? If all else fails, you could put the video in the excerpt using the iframe embed instead of the oembed (if that's what you're using in the post)
WordPress / Genesis Site Design & Troubleshooting: A Touch of Summer | @SummerWebDesign
Slice of SciFi | Writers, After DarkDecember 21, 2013 at 1:25 pm #80651tanyaslogos
MemberHello Summer and thank you so much for taking the time to reply. I really appreciate it. I upgraded pretty much everything so not really sure what broke it.
I am using the embed in each post and I have my settings set to show post content in genesis theme options with a 400 character count limit. I really don't want to have a HUGE video on that page so I set it up to show a tiny video through the magic of custom fields.
I think that either wordpress or genesis tinkered with the way the custom fields function - I guess I just have to figure out what part they tinkered with - Or I could just ask someone to hit me over the head with a wooden mallet until I am unconscious. I think both will achieve the same results. lol
Thanks again! I really do appreciate you taking a peek!
December 21, 2013 at 2:22 pm #80655Summer
MemberThat's the beauty of the embed iframes... you can use a different size in the excerpt than there is in the main post entry.
That's what I'm doing with some of the videos on Zombie Channel -- there's a normal embed in the post, but using the manual excerpt I use one with a smaller video size. You can even see one in the category archives. So you should be able to do the same thing by switching to the manual excerpts.
There's also a plugin called Featured Video Plus that's supposed to replace your featured image with a featured video... it worked for me on one site, but didn't work 100% the same on another. It wasn't a big deal so I didn't track down why since it was working where I needed it to 🙂
WordPress / Genesis Site Design & Troubleshooting: A Touch of Summer | @SummerWebDesign
Slice of SciFi | Writers, After DarkDecember 21, 2013 at 11:04 pm #80700tanyaslogos
MemberHello Summer,
Thank you so much for the additional information - I am all about the work around when something doesn't work so I appreciate the heads up on the excerpt route.
Unfortunately I am like a dog with a bone when it comes to failed code. It will gnaw at me until I figure out why it failed. It is a serious flaw in my character and one that I am very much aware of. Sadly there is no cure for my stuborness. lol
I guess I will just keep plugging away at it until I sort it out or the internet implodes.
Thanks again!
TanyaDecember 21, 2013 at 11:51 pm #80708Summer
MemberYou didn't by chance add the HTML5 support, did you? That would necessitate a change from using genesis_before_post_content to using genesis_before_entry_content instead. That is literally the only thing I can think of, since you said you did a ton of updates.
And I completely understand about having an unresolved issue gnawing at the back of your brain and the unrelenting drive to just freaking fix it 🙂
WordPress / Genesis Site Design & Troubleshooting: A Touch of Summer | @SummerWebDesign
Slice of SciFi | Writers, After DarkDecember 22, 2013 at 3:45 pm #80810tanyaslogos
MemberThank you Summer! You just might have hit the nail (or ME) on the head!
I have been out of the "code loop" for a few years as I became a full time caregiver for my Auntie M until she passed last November. Since then I have had the
painjoy of reacclimating myself to world of code and all of its MANY changes.:: fun :: /eyeroll/
The only way any HTML5 support would have been added is if Genesis or WordPress added it during the normal upgrades. I will go and bury my head in google and see what it has to say.
Thank you so much for this new direction - It should keep me busy for a few
hoursdaysmonths LOLIf I don't come back before Christmas I hope you have a great Holiday!
December 22, 2013 at 6:32 pm #80840Summer
MemberThis would have been something you would have had to add manually to your theme's functions.php after you updated to Genesis 2.0, if that was one of the updates you did, or if you also updated you theme to
If you didn't manually add that, then your theme is still xhtml, and the function call maybe should have still worked. I looked again at your page source, and let me know if I have this right:
Were you creating a separate div for the video as "<div class="postvideo">" wrapped around the embed code you used, so that it would display a smaller version of the video in the archives, or were you adding that class to the existing entry-content div?
Right now, It looks like the "class=postvideo" is not part of a div declaration, it's just hanging out, in between the post-info and entry-content divs, having a good time being all alone unassociated with anything 🙂
Also, it looks like from the docs that genesis_custom_field is only supposed to take an argument, and echo the value of that field. Not sure if that helps any, but it looks like it's doing what it's supposed to do.
The function still works in Genesis 2.0: http://docs.garyjones.co.uk/genesis/2.0.0/function-genesis_custom_field.html
Don't bury yourself in code for the holiday... take a breather! LOL
WordPress / Genesis Site Design & Troubleshooting: A Touch of Summer | @SummerWebDesign
Slice of SciFi | Writers, After Dark -
AuthorPosts
- The forum ‘General Discussion’ is closed to new topics and replies.