Search This Blog

Friday, November 18, 2016

Getting FB to Show the Right Photo in WordPress

Sharing a drinkFacebook used to allow one to cycle through photos from a shared link, giving the poster control over which imaged showed, or allowed one to not show a photo at all but keep the graphic link. For some unexplained reason, this feature was lost in an update some time ago. Now a poster has absolutely no control over the selection of  a site's photo in their link, usually pulling one from an unrelated article. Very frustrating.

Today I finally did some research and found one way to re-activate that feature. Figuring others would want this information, I decided to post it here and share it on Facebook.

This works on my WordPress site, this blog (version 3.0.3--yes, I need to update). The concept should work on other sites if you can add to the webpage's meta data. What needs to be added is the following metadata link in the webpage's <head> area: <meta property="og:image" content="image weblink here" /> For WordPress there is an easy way to do this for an individual post.

Once logged in to your admin page on the blog, and on the "add new post" or "edit a post" page, you'll see under the post entry window a section labeled "Custom Fields." Click the "Enter new" link. In the "name field," enter: og:image. In the content field, enter the full web-link to your image. You can find that address if you have inserted it into your post by right-clicking the image in the post entry field and select "Copy image address" from the menu. Then paste it into the content field of your new entry.

Once published, share on Facebook as usual. You should now see the old arrows allowing you to cycle through available images, one which should be your post photo.

You're welcome!

Update #1:


Apparently Facebook's photo memory is limited when it allows you to choose a photo. This method does allow the option (currently, they could change that at any time) to select multiple photos from the referenced site, but there is no guarantee that the post's photo will be included among them. In the case of this post, the photo above wasn't in the choices I had, so I selected my mug shot. Better than a totally unrelated photo like the covers of one of my books, but not what I had hoped. We'll see how it goes with future posts.

Update #2:


After some more research, I've discovered that Facebook has a sub-site that handles this, and though the above custom fields seems to indicate it will add that text into the metadata, apparently it doesn't upon reviewing the source code, even though it seems to force Facebook to allow a choice of images instead of forcing you to take what it gives you. No, the real solution is to install a plug-in that makes it easy to output that data automatically, or add in the needed code in the theme's function.php file to automatically set the featured image to be output as the image Facebook picks up.

Being geeky, I fiddled with the code of the file, and after some failed attempts, got it to work. You, however, may want to take the simpler route by installing one of two plug-ins that will do the job. I've not tried either of those so I can't tell you how well or easy they are to work with.

Rather than regurgitating that article with the information on how to do that here, I'll point you to the site that I found to be the most help on this topic: How to Add Facebook Open Graph Meta Data in WordPress Themes

The only note on this is to make sure your original file is bigger than 200px x 200px, but not more than 8 MB. Otherwise you'll get errors from Facebook.

There you go! Now I should have the right image post to Facebook each time.

Thursday, November 17, 2016

The Unlikely Angel

I think this may be my first Thanksgiving story. And also my first non-fiction story. Yes, this is a true story that happened to me. I wrote it in an omniscient first person point of view, mainly because that's my view of the story. If you're not sure what an omniscient first person point of view is, ask me in the comments and I'll 'splain it to you,

Now, onto the story!

-------------------------------


A Likely Angel

I encountered an angel in the wee hours of the morning in 1994. A very unlikely angel, but an angel nonetheless.

I pastored a church in Weslaco, Texas at the time—about mid-way between McAllen and Harlingen in the Texas “Valley.” I put valley in quotes because there really is no physical valley. The land there is as flat as the plains in east Colorado, west Kansas, and north-west Oklahoma. First time I drove there, I kept waiting for the drop into a valley that never came.

In this instance, however, I was driving out of the Valley on my way to Wichita Falls, Texas. My mom’s aunt had passed away, and I wanted to be there for my mom and grandmother, which meant driving all night to arrive on time after taking care of pastoral tasks I had that day. By the time I turned off US 281 onto IH 37 and headed north toward San Antonio, it was past three o’clock in the morning, and I still had a long way to go.

But I was at least glad I had fixed the car before I left on this trip. The car’s battery had died. First I replaced the battery, but it died again after some driving. As it turned out, the alternator wasn’t charging the battery, so I paid the auto shop to replace the alternator. With that problem solved, or so I thought, I felt confident I could drive the car to Wichita Falls.

However, it was nearing four in the morning when my dash lights began flickering and my headlights dimmed. I barely had time to pull off onto the shoulder before the car lost all electrical power and turned into an expensive, oversized paperweight. Turning the key failed to get so much as a grunt from the engine, much less any flash of light on the dashboard.

I couldn’t understand it. The battery was new, the alternator was new; what else could it be? Whatever the problem was, I was stranded on IH 37 in the middle of the night. This was long before I had a cell phone I could call for help on, and the closest city was miles away.

“Okay, Lord, now what am I going to do?” I had no clue. Even if someone traveled this lonely stretch of road, who would dare stop to help someone like me?

As I struggled to figure out how to deal with this development, lights crested a rise behind me. The first vehicle to approach my location. I watched, fully expecting the driver to fly right on by me. Instead, he slowed until he stopped beside my car. I couldn’t believe it. God had so quickly answered my prayer!

I exited my car. An old, well-used pickup truck greeted me. Inside the truck sat a grungy-looking, rough rancher of some kind. Dirty overalls, scraggly beard, and a tattoo on his arm, along with a pack of cigarettes resting on the dash. “Lord,” I said to myself, “couldn’t you’ve sent someone a little less scary?”

He nodded toward me. “Need some help?”

I nodded back and proceeded to tell him my story in abbreviated form.

“Hop in. I’ll take you to San Antonio so you can get a new battery.”

I hesitated. I could see my mug shot on a milk carton after I’d mysteriously gone missing. This man didn’t engender any good vibes. Yet what other options did I have? Who else might drive by and stop to help? I didn’t have much choice. How could I look this gift-horse in the mouth?

“If you’re sure, Lord,” I confessed to God. I accepted his offer, locked up the car, slid onto his passenger seat, and off we headed for San Antonio. I kept waiting for the turn onto a side-road that never came.

He wasn’t much of a talker, but I did find out a little about him, and told him something about myself as well. But he seemed in a different world than I was, so a good part of the time we sat in silence, watching the miles roll under the truck.

True to his word, he pulled into a Walmart once we arrived in San Antonio. I bought a battery, and he drove me back to my car, an hour each way. Then he helped me install the new battery. When I offered him some money for his time, he refused it. By this time the dawn had arrived. He returned to his truck and rode off into the sunrise.

I marveled that someone like him was willing to take two plus hours out of his day to help some stranger on the road in the middle of the night. Despite his appearance and apparent lifestyle, he literally was an angel to me. An unlikely one, but an angel nonetheless.

With the dawning of the day I no longer needed my headlights, so I took to the road once more, knowing I’d arrive, if all went well, less than thirty minutes before the funeral was to begin. I kept expecting the battery to lose power again, but it didn’t happen. I arrived in time to attend the funeral.

That evening, I followed my mom and aunt to my aunt’s house in Granbury. On the way there, with my lights on, my car began to show signs it was about to run out of power again. I cut the lights and pulled over. The engine kept running. Obviously the headlight were pulling more power than the alternator could keep up with. So I drove behind my aunt and mom with my lights off and hoped we wouldn’t be stopped by a patrol officer.

The next day, we had a mechanic check out the car. Come to find out the shop that installed the alternator failed to pull the pin that allowed the brushes to rest against the armature. The arcing from the armature to the brushes was enough energy to power the car with the headlights off but not on. Another alternator installed, I returned safely to my family in Weslaco.

But I’ll never forget the unexpected angel God sent my way, and the lesson I learned not to prejudge people. The most unlikely person could be an angel to you as well. It is sad that so many will be judgmental instead of grateful for those God has sent to help us in our trials and struggle for spiritual growth.

For the former rejects God’s help, but the latter emboldens us to be an unlikely angel to someone else in need.