victorjonsson / Arlima

Article List Manager - Wordpress plugin suitable for online newspapers that's in need of a fully customizable front page
28 stars 16 forks source link

No link in teaser introword #54

Closed djansson closed 10 years ago

djansson commented 10 years ago

Hi,

I have some problems with the teaser-introword-function in Arlima. As it is described, the function is supposed to generate a link and a CSS-class for the introword.

In my installation of Arlima, this function only generates the CSS-class but no link. Is this function changed in recent releases of Arlima or have I done something wrong in my WordPress? My site: http://veckansnyheter.se

victorjonsson commented 10 years ago

It has not changed. Do you have any actions on arlima_article_content? If so you must call the function arlima_link_entrywords() yourself. Example https://github.com/victorjonsson/Arlima/wiki/Filters-and-actions#-arlima_article_content

victorjonsson commented 10 years ago

Have you called the function as described in the example above?

djansson commented 10 years ago

I've tried to call the function, as you described above. I've tried adding following to my functions.php:

function add_full_story_link( $data ) {
  $article_url = $data['article']['url'];
  $data['content'] = arlima_link_entrywords(trim($data['article']['text']), $article_url);
  $data['content'] .= '<p><a href="'.$article_url.'" class="teaser-entryword">Read the full story</a>';
  return $data;
}
add_filter('arlima_article_content', 'add_full_story_link');

but that only resulted in errors caused by some of the code on row three ($data['content'] = arlima_link_entrywo).

I looked through my functions.php, and I haven't any actions on arlima_article_content, but still it doesn't work. The intro-word only generates a CSS-class but no link.

victorjonsson commented 10 years ago

$data['article']['text']should be $data['article']['content']

Here you can read the specification of what the article contains https://github.com/victorjonsson/Arlima/wiki/Filters-and-actions#article-array

djansson commented 10 years ago

I saw that just after I wrote the comment here. Thank you for your help! :)