• Resolved kathleens

    (@kathleens)


    Hello-

    For some reason, only some of the Content tags seem to be working for me. They work in the widget, but not with the shortcode or php. I’d use the widget, but I want my first popular post to have different html than the following ones, and it doesn’t seem like that can be done without using offset.

    I’m currently just trying this simple code to get things up and running

    
    public function widget( $args, $instance ) {
                            $args = array(
                                'range' => 'last7days',
                                'post_html' => '<li>{thumb} <a href="{url}">{text_title}</a></li>'
                            );
    
                            echo "<h3>Most Popular</h3>";
                            wpp_get_mostpopular( $args );
                    }
    

    I can tell that it’s working, because if I put ‘test’ next to the text_title tag, that shows us. I’ve tried a few other content tags, such as {thumb_img} and {date}, and those weren’t showing up either.

    Thank you!

    The page I need help with: [log in to see the link]

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

    (@hcabrera)

    Hi @kathleens!

    Some Content Tags also require passing additional parameters to the wpp_get_mostpopular() template tag.

    For example, {thumb_img} needs you to define the width & height of the image via thumbnail_width and thumbnail_height, respectively. Similarly, to display the date you need to provide stats_date.

    Check Settings > WordPress Popular Posts > Parameters for more details.

    If you have any other questions, don’t hesitate to ask 🙂

Viewing 1 replies (of 1 total)

The topic ‘Only some content tags are working in [wpp] shortcode and wpp_get_mostpopular()’ is closed to new replies.