Member
Member
boo   2009-02-18, 17:33
#1
Hi,
We want to use the album and image descriptions for the page meta description.

ie:

<meta name="description" content="<?php echo printImageDesc(); ?>" />
<meta name="description" content="<?php echo printAlbumDesc(); ?>" />

Is this the correct method and do we need to format them to remove line breaks etc ?

Many thanks.
Administrator
Administrator
acrylian   2009-02-18, 17:59
#2
First, functions with a beginning "print" already echo themselves...Smile The ones starting with "get" need to be echoed.
For meta tags you better use the "getBare" functions (see the doc). These already strip html tags etc. from the content to be used in img alt or title tags.
Member
Member
boo   2009-02-18, 18:41
#3
Hi, ok great!

Have used: <meta name="description" content="<?php echo getBareAlbumDesc(); ?>" />

If I view source there is a line break as below,

<meta name="description" content="Photographing birds is not only a challenge but a real pleasure. Gives you a chance to study hehaviour, bird calls
and much more.
You just need lots of patience and a flask of coffee at the ready." />

Is that just whitespace in the text, sorry just need to check.

Pat
Administrator
Administrator
acrylian   2009-02-18, 18:59
#4
Actually it should strip all tags, it might be that a invisible linebreak got through. I don't think this harms.
Member
Member
boo   2009-02-18, 20:41
#5
Hi, ok will wait and see how it looks on the search engines.

Thankyou for your support!

Pat
  
Powered By MyBB, © 2002-2026 MyBB Group.
Made with by Curves UI.