• Resolved greatercreators

    (@greatercreators)


    Hi,
    Awesome plugin, thanks.

    Can you help me figure out how to use multiple parameters in template tags?

    Here is my attempted code:

    wpp_get_mostpopular( 'post_html="<li class="mostPopularListItem"><div class="list_desc"><h4 class="list_title"><a class="post-title" href="{url}" rel="bookmark" title="{text_title}">{text_title}</a></h4></div><div class="clear"></div></li>"&cat="330"&limit=6&post_type="post"');

    but all i get is “Sorry. No data so far.”
    FYI: I get results if I only use one parameter.

    thanks a bundle

    https://www.ads-software.com/plugins/wordpress-popular-posts/

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

    (@hcabrera)

    Hi there!

    The problem is the double quotes in the post_html parameter:

    post_html="<li class="mostPopularListItem">...

    PHP doesn’t like that too much, and so the rest of the parameters are being ignored by it.

    Try escaping the double quotes from the HTML attributes, like this:

    wpp_get_mostpopular( 'post_html="<li class=\"mostPopularListItem\"><div class=\"list_desc\"><h4 class=\"list_title\"><a class=\"post-title\" href=\"{url}\" rel=\"bookmark\" title=\"{text_title}\">{text_title}</a></h4></div><div class=\"clear\"></div></li>"&cat="330"&limit=6&post_type="post"');

    Alternatively, you can also do this:

    $args = array(
        'post_html' => '<li class="mostPopularListItem"><div class="list_desc"><h4 class="list_title"><a class="post-title" href="{url}" rel="bookmark" title="{text_title}">{text_title}</a></h4></div><div class="clear"></div></li>',
        'cat' => 330,
        'limit' => 6,
        'post_type' => 'post'
    );
    
    wpp_get_mostpopular( $args );
    Thread Starter greatercreators

    (@greatercreators)

    you rock.
    thank you.
    I also discovered adding
    ‘range’=>’all’,

    to list of args helped.

    thanks again.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How to use mulitple parameters in template tags?’ is closed to new replies.