WordPress.org

Ready to get started?Download WordPress

Forums

Article List Manager (arlima)
[resolved] Show number of comments (7 posts)

  1. febrer
    Member
    Posted 1 year ago #

    Hi,

    first, congratulations for your plugin. It's awesome.

    My question is how can I display the number of comments of a post? (I use Disqus comment system). Apparently, arlima doesn't show it by default.

    Thank you.

    http://wordpress.org/extend/plugins/arlima/

  2. victor_jonsson
    Member
    Plugin Author

    Posted 1 year ago #

    Hello!

    That is correct, the number of comments is not displayed by default. You will have to write code if you want it that way. There's a lot of information about how to modify the behavior of arlima in the wiki. This issue has an answer in the FAQ as well.

    / vic

  3. febrer
    Member
    Posted 1 year ago #

    Thanks Victor,

    I write the code that appaers in the wiki in functions.php, but it does nothing.

    Can you help me?

  4. victor_jonsson
    Member
    Plugin Author

    Posted 1 year ago #

    Well... Are disqus posting the comments back to your site?

    What happens if you use this code instead:

    function arlima_comment_count($data) {
        $data['content'] = 'Changing stuff...';
        return $data;
    }
    add_filter('arlima_article_content', 'arlima_comment_count');
  5. febrer
    Member
    Posted 1 year ago #

    Sorry, but It does nothing...

    In 'changing stuff' I write anything in special?

    Another way, this is my article.tmpl in arlima/templates (this is the default file by arlima). I see that only appaers a function to write comments in related posts, not posts in general:

    <div id="${container.id}" class="${container.class} tmpl-article">
    <article>
    
        {{if streamer}}
            <div style="${streamer.style}" class="streamer ${streamer.type}">
                <span>{{html streamer.content}}</span>
            </div>
        {{/if}}
    
        {{html article_begin}}
    
        {{include parts/top-image.tmpl}}
    
        {{html article.html_title}}
    
        {{html article.html_text}}
    
        {{if related}}
            <div class="teaser-related-posts">
                <aside>
                    {{if related.single}}
                    {{else}}
                    {{/if}}
                    <ul>
                        {{each related.posts}}
                            <li>
                                <a href="${this.url}" class="related">${this.post_title}</a>
                                {{if this.html_comment_stats}}
                                    <span title="Number of comments" class="num-comments">
                                        {{html this.html_comment_stats}}
                                    </span>
                                {{/if}}
                            </li>
                        {{/each}}
                    </ul>
                </aside>
            </div>
        {{/if}}
    
    </article>
    
    {{if sub_articles}}
        <div class="teaser-children">
            {{html sub_articles}}
        </div>
    {{/if}}
    
    </div>
    
    {{html article_end}}
  6. febrer
    Member
    Posted 1 year ago #

    Hello, Victor & others,

    can you reply me? This issue is not resolved .

  7. victor_jonsson
    Member
    Plugin Author

    Posted 1 year ago #

    I'm having problems helping you since the filter example is successfully tested and used in several production websites. What theme are you using? Are you using any caching plugin? Are you inserting the list using a short code and in that case have you set any filter_suffix?

    (the comment stats variable in the template is used with another filter, it will be used by the plugin Microkids related post plugin, in case you install that plugin)

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags