WordPress.org

Support

Support » Plugins and Hacks » [Resolved] [Plugin: WordPress Popular Posts] Template Tags NOT Working, But Widgets ARE

[Resolved] [Plugin: WordPress Popular Posts] Template Tags NOT Working, But Widgets ARE

  • Clyde

    @clydesanchez32gmailcom

    Hello Héctor,

    I love the features of this plugin. You’ve done a great job providing multiple options for configuring Most Popular posts, but I do have a problem.

    I am trying to add the template tags into my theme, but I keep getting, “Sorry. No data so far.”

    An example of code that I am using is:

    <?php if (function_exists('wpp_get_mostpopular')) wpp_get_mostpopular("header=Crafts&limit=5&range=monthly&order_by=views&post_type=craft&thumbnail_width=30&thumbnail_height=30"); ?>

    Most Popular posts are rendering correctly via the widget, but I require the use of template tags.

    Am I using the wrong code? I checked, checked and re-checked, but I don’t notice any errors in the above template tag.

    Site: Crafts by Courtney

    Please help,

    Clyde

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

    @hcabrera

    Hi Clyde,

    Just tested your exact same code and it seems to be working fine here. Please open wordpress-popular-posts.php and change this line of code:

    jQuery.post('<?php echo admin_url('admin-ajax.php'); ?>', {action: 'wpp_update', token: '<?php echo $nonce; ?>', id: <?php echo $id; ?>}, function(data){/*alert(data);*/});

    … into:

    jQuery.post('<?php echo admin_url('admin-ajax.php'); ?>', {action: 'wpp_update', token: '<?php echo $nonce; ?>', id: <?php echo $id; ?>}, function(data){ alert(data); });

    … and save changes.

    Let me know what happens, then undo the change.

    Clyde

    @clydesanchez32gmailcom

    Wow, thanks for the quick response Héctor. I made the change, but I am still receiving the, “Sorry. No data so far.” error.

    Thank you again for help with this,

    Clyde

    Plugin Author Hector Cabrera

    @hcabrera

    That code I posted it’s supposed to show an alert, did it show? If so, what did it say?

    Clyde

    @clydesanchez32gmailcom

    Hello Héctor,

    I added the code you’ve provide, but I didn’t see any errors.

    Clyde

    @clydesanchez32gmailcom

    Héctor,

    I think I may have resolved my issue. I have been using a PHP code widget (Linkable Title Html and Php Widget by PepLamb) and added the template tags there.

    They did not render properly, but when I added the template tags directly to the sidebar.php file, I saw content being rendered.

    It may take a bit more work on my part to work as I require, so I think it may be an issue with how the PHP code widget renders PHP template tags.

    Thank you for you help and quick responses Héctor.

    Regards,

    Clyde

    Plugin Author Hector Cabrera

    @hcabrera

    Oh, I see. I forgot about that one. Long ago, other people reported this issue as well. I need to put this warning on the FAQ section.

    Thanks for letting me know!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘[Resolved] [Plugin: WordPress Popular Posts] Template Tags NOT Working, But Widgets ARE’ is closed to new replies.