Skip to content
victorjonsson edited this page Oct 14, 2014 · 19 revisions

How do I display an article list on my front page?

Go to Settings -> Reading in wp-admin and choose the page that you have related your article list to as a static front page. Here you can read more about how to create article lists and how to relate them to pages


### How do I remove the page title above the article list?

You need to modify the page template in your theme (this is usually the file named page.php). Here's an example code that won't display the title if there's an article list related to the page.

<?php if( !has_arlima_list() ): ?>
  <header>
    <h1><?php the_title(); ?></h1>
  </header>
<?php endif; ?>

Here you can read more about the template functions provided by Arlima


### Can I use actions or filters to modify the content in my articles?

Yes, of course! Click here to read more


### None of the filters is helping me. Is there a way to create my own article templates?

Yes, of course! Click here to read more


### My images does not fill up the article horizontally, what is wrong?

Arlima uses WordPress functions to resize images. These functions will not enlarge images that is too small.

If you know that the source image is wide enough you should make sure that the width of your article list is as wide as the content column. Open your page in wp-admin and increase the number in the input labeled "Width" in the Arlima meta box until the images gets wide enough.


### How do I display the categories that each post in my list belongs to?

You need to write code in that case. There are several different WordPress filters you can hook into if you want to modify the content of an article (Here you can read more about these filters).

Here's a piece of example code that displays all categories in the end of each article

<?php
function add_arlima_category_labels($data) {
    $data['content'] = arlima_link_entrywords(trim($data['article']['content']), $data['article']['url']);
    // Display the first category if the article is connected to a post
    if( $data['post'] ) {
        $categories = get_the_category();
        $data['content'] .= '<p><strong>Post category:</strong> '.$categories[0]->name.'</p>';
    }
    return $data;
}
add_filter('arlima_article_content', 'add_arlima_category_labels');

### Is it possible to display the number of comments for each post?

Yes, there are several different ways you can go about it. One solution is to hook in to "arlima_article_content" and add the number of comments to the end of the article content.

<?php
function arlima_comment_count($data) {
    $data['content'] = arlima_link_entrywords(trim($data['article']['content']), $data['article']['url']);
    if( $data['post'] && $comments = get_comment_count($data['post']->ID) ) {
        $comments_text = ' comment'.($comments['approved'] > 1 ? 's':'');
        $data['content'] .= '<p class="comment-count">'.$comments['approved'].$comments_text.'</p>';
    }
    return $data;
}
add_filter('arlima_article_content', 'arlima_comment_count');

This Wordpress plugin was created by Swedish newspaper Västerbottens-Kuriren to give its editorial staff an easy to use tool for customizing the front pages of their online magazines.

Installing Arlima

  1. Download the latest release from github and unzip the folder in your plugin directory.
  2. Open up wp-admin and activate the plugin.
  3. Go to "Article lists" -> "Edit lists" in wp-admin and create your first article list.
  4. Open up a page (or create it) in wp-admin. Down to the right you will see a meta box labeled "Arlima" where you choose the list that you created on step 2.
  5. Go to "Article lists" -> "Manage lists" and start stuffing your article list with interesting content.

Top links

Clone this wiki locally