• Resolved chathurika0526

    (@chathurika0526)


    Hi.

    using below code I get popular posts.

        $amadeus_pp = array (
                            'range' => 'last30days',
                            'order_by' => 'views',
                            'post_type' => 'post',
                            'limit' => 5,
                            'title_length' => 70,
                            'cat' => $blog_category_id,
                            'thumbnail_width' => 50,
                            'thumbnail_height' => 50,
                            'stats_views' => 0,  
                            'post_html' => '<li style="margin-left: 0;">
                                                <div class="ba-pop-post">
                                                    <div class="ba-pop-post-title">{author}</div>
                                                    <div class="ba-pop-post-image">{thumb}</div>
                                                    <div class="ba-pop-post-title">{title}</div>
                                                </div>
                                            </li>',
                            );
    
                        if (function_exists('wpp_get_mostpopular'))
                            wpp_get_mostpopular($amadeus_pp);

    Now under popular post section display post thumbnail image, post title.But now I want to display post author,create date, part of description also.

    Please help me…

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Hector Cabrera

    (@hcabrera)

    Hi @chathurika0526,

    To display the author, you also need to use the stats_author parameter:

    $amadeus_pp = array (
        // Code removed for brevity
        'stats_views' => 0,
        'stats_author' => 1,
        // Code removed for brevity
    );

    Likewise, to display the date you also need to use the stats_date parameter:

    $amadeus_pp = array (
        // Code removed for brevity
        'stats_views' => 0,
        'stats_author' => 1,
        'stats_date' => 1,
        // Code removed for brevity
    );

    … and also include it in your code using the {date} content tag:

    $amadeus_pp = array (
        // Code removed for brevity
        'stats_views' => 0,
        'stats_author' => 1,
        'stats_date' => 1,
        'post_html' => '<li style="margin-left: 0;">
                            <div class="ba-pop-post">
                                <div class="ba-pop-post-title">{author}</div>
                                <div class="ba-pop-post-image">{thumb}</div>
                                <div class="ba-pop-post-title">{title}</div>
                                <div>Posted on {date}</div>
                            </div>
                        </li>',
    );

    For the description I’m guessing you mean the post excerpt. If so, then the {summary} content tag is what you’re looking for:

    $amadeus_pp = array (
        // Code removed for brevity
        'stats_views' => 0,
        'stats_author' => 1,
        'stats_date' => 1,
        'post_html' => '<li style="margin-left: 0;">
                            <div class="ba-pop-post">
                                <div class="ba-pop-post-title">{author}</div>
                                <div class="ba-pop-post-image">{thumb}</div>
                                <div class="ba-pop-post-title">{title}</div>
                                <div>Posted on {date}</div>
                                <div>{summary}</div>
                            </div>
                        </li>',
    );

    Hope that helps.

    Thread Starter chathurika0526

    (@chathurika0526)

    Hi Hector

    Thank You for quick reply.

    Yes your reply is really helped.Summary thing is not working but it’s ok.display the author, display the date thing is working perfectly.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Want to Display Post Author, Part of Description’ is closed to new replies.