Support community for TTG plugins and products.
NOTICE
The Turning Gate's Community has moved to a new home, at https://discourse.theturninggate.net.
This forum is now closed, and exists here as a read-only archive.
You are not logged in.
Pages: 1
Hi Guys,
Forgive me if I have missed a previous discussion and if so kindly point me to the previous..
How can I populate the Meta Description for Home, About, Blog, and Contact Pages? I know that the Album Description in the LR plugin does it for my Photo Albums, but struggling to get the set-up correct using php. I see the meta description line in the head using the Inspector, but the content is blank
Any help much appreciated
Jon
Offline
There’s one about description for album sets, but I don’t recall one having to do with descriptions on pages.
http://community.theturninggate.net/vie … hp?id=8276
Rod
Just a user with way too much time on his hands.
www.rodbarbee.com
ttg-tips.com, Backlight 2/3 test site
Offline
Hi Rod,
Yep, that's the one that prompted me to look. The guy has meta descriptions on all the headers on his pages, mine are just blank, must be php I guess. Haven't cracked it yet.
Last edited by lofty (2017-12-04 02:08:27)
Offline
Jim's site? Could be because he's using WordPress for his pages and not Backlight pages.(Backlight WP theme)
Rod
Just a user with way too much time on his hands.
www.rodbarbee.com
ttg-tips.com, Backlight 2/3 test site
Offline
Could be Rod, just a bit frustrating to have the meta description field there in the head without being able to put anything in it.....
Offline
I just tried using phplugins to add the meta description and keywords to pages using the ttg_head hook at it seems to work but I won't be able to see how it affects search results for a while.
Charlie
www.stalkinglight.com
Offline
I just tried using phplugins to add the meta description and keywords to pages using the ttg_head hook at it seems to work but I won't be able to see how it affects search results for a while.
But then it would be nice to have the twitter and open graph fields set as well.
Maybe the easiest might be to have a ttg_meta hook that can replace the default settings. This way one can target specific pages from phplugins and add whatever one desires.
Maybe even easier, if Backlight would not set empty fields, they could then be easily added with the existing ttg_head hook. I don't know what's happening if the same metadata field is set twice, first without content and then a second time with content.
Daniel Leu | Photography
DanielLeu.com
My digital playground (eg, Backlight tips&tricks): lab.DanielLeu.com
Offline
Exactly Daniel, I thought that I had missed something. We should be able to set page specific meta description and keywords. SEO does not like the same description for all pages.
Offline
You can do page specific using conditional logic in phplugins based on URL which you can get from"https://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]"; but I agree it would be nice to have the option to set the variables in Backlight.
Charlie
www.stalkinglight.com
Offline
Easy for you to say Charlie
Last edited by lofty (2017-12-04 05:05:53)
Offline
Here's what I added just for fun on my site:
function ttg_head( $style, $path ) {
$page_id = "$_SERVER[REQUEST_URI]";
if($page_id == '/')
{
echo '
<meta name="description" content="Stalking Light Photography - Fine Art Wilderness Photography by Charlie Choc">
<meta name="keywords" content="photography,fine art,wilderness,wildlife,landscape,prints,birds,mammals,reptiles,desert,seascapes,mountains,great plains,flowers,waterfalls,fall colors">
';
}
else if ($page_id == '/about/')
{
echo '
<meta name="description" content="About Stalking Light Photography">
<meta name="keywords" content="photographer,nikon,lumix,mavic pro">
';
}
return false;
} // END
Kind of clumsy but it shows the jist of what you can do to add meta data to the home page and the about page. There is also a 'switch' 'case' construct that would be more elegant but 'if' 'else' is easier to explain to a non programmer. ;-)
Last edited by charlie.choc (2017-12-04 05:21:51)
Charlie
www.stalkinglight.com
Offline
Another thing you can do to add at least descriptions (keywords don't seem to matter much for SEO any more) is to embed an album in any page and add the description in the album description in Lightroom.
For example, the Contact page on my Pangolin test site: http://pangolin.barbeephoto.com/contact/
I just created an empty album with the description field filled out and hid it from the album set and search. Then embedded the album in the contact page.
Rod
Just a user with way too much time on his hands.
www.rodbarbee.com
ttg-tips.com, Backlight 2/3 test site
Offline
Yes that would work Rod, I thought I could do that with my home page Theatre embed. Didn't think of an empty album though, that is smart! I might have a play with Charlies php but yours is fun too.
Offline
OK Rod, you are officially a genius!
The php method described by Charlie does get the meta tags into the header but.... It does leave the empty descriptions behind as well.
By inserting an empty gallery with a description into the page not only is the meta description populated but the open graph description is populated too.
Excellent solution Rod.
Offline
Just lucky. I noticed my home page had the description metadata, and the only place that appears is in the description of the album I'm using on the home page.
Rod
Just a user with way too much time on his hands.
www.rodbarbee.com
ttg-tips.com, Backlight 2/3 test site
Offline
I agree, Rod's solution is a much better way.
Charlie
www.stalkinglight.com
Offline
Pages: 1