I am trying to extract excerpts to display in meta description on each page of elgg 1.8.8. Something like that.
<meta name="description" content="<?php echo $excepts; ?>" />
<meta name="keywords" content="<?php echo $tags; ?>" />
I found this article to this but it is for 1.7
I asked same question in community but nobody reply.
I really appriciate if you give me some right directions on this.
Below is a link to community discussion. I also mention some more code there.
Thanks
info@elgg.org
Security issues should be reported to security@elgg.org!
©2014 the Elgg Foundation
Elgg is a registered trademark of Thematic Networks.
Cover image by RaĆ¼l Utrera is used under Creative Commons license.
Icons by Flaticon and FontAwesome.
This a dirty solution (tested on Elgg 1.7.15)
Now you need to re-work it with the $excepts and $tags ;)
RVR thanks, For title every thing is working. Please some one from core team help me why below codes are not displaying any contents?
I am trying to display discription by following codes.
or
elgg_get_excerpt($vars['entity']->description, 20); is wrong code - check some live examples in plugins...
For blogs:-
$excerpt = $blog->excerpt;
if (!$excerpt) {
$excerpt = elgg_get_excerpt($blog->description);
}
Do I need to set for each case or I can change code like below:-
$excerpt = $vars['entity']->excerpt;
if (!$excerpt) {
$excerpt = elgg_get_excerpt($vars['entity']->description);
}
I also tried below code but it only display </ b>
$description = autop($vars['entity']->description);
Please experts help me and this will be useful for everyone!
Many thanks in advance
Regards
BING is very clear about Meta discription but nobody is paying attention on these things, after 6 days no reply.
What's not working? Are you sure your entity has a description? Not all of them do. Also, not all pages have an entity passed in $vars
Hi Matt,
I tried upper codes but always get a blank discription.
As tidypics,albums,media plugin and blog plugin has discription entity. So I was checking with that. I am very confused with this.
Please help me. Bing send me message saying your contents don't have discription tag. and I heard duplicate meta discription is also bad for seo.
$excerpt = $vars['entity']->excerpt;
if (!$excerpt) {
$excerpt = elgg_get_excerpt($vars['entity']->description);
}
should woiky oki-doki..
as long as there's the source data available (as Matt points out;)
'always get a blank description...' => always got no excerpt or no entity !;-oO
what de heck r u doin` w/ autop in there ?
seems like u r trying odd snippets of 5/8 random code...
wrng approach ! try and mnake sure that you have got the correct entity and
it's description loaded -- that is the first step - the rest will follow naturally.
- Previous
- 1
- 2
- Next
You must log in to post replies.