WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] [Plugin: WordPress Popular Posts] Template does not work in v2.0 (72 posts)

  1. Héctor Cabrera
    Member
    Posted 4 years ago #

    Can you please copy your theme's code here (where you're inserting the template tag) so I can examinate it? It's hard to tell what's happening without watching any code :(

  2. mpiftex
    Member
    Posted 4 years ago #

    Hey Ikki, timmos...
    I gave it another look and I think that Timmos is right about the order thing! I didn't noticed before because coincidentally my most viewed posts are the most commented. I've tried views, avg, comments, and in all three the list is the same, ordered by the number of comments.

    Timmoss, about the bullets thing. You might want to check if the some ul styling in the css removes the bullets. This is very likely if you reset the CSS or if the theme you're using removes all the bullets in the lists in the sidebar. You should try this:
    In the code above, replace wpp_start='<ul>' with this wpp_start='<ul class=\"pop_posts\">'. This will assign the class "pop_posts" to the list. Go to your css file and add:

    ul.pop_posts {list-style-type: disc;
    	margin-left:15px;}

    and see what happens. Alternatively you can add the whole function into a div. Something like:

    <div id="popular_posts">
    <?php if (function_exists("get_mostpopular")) get_mostpopular("range=all&......?>
    </div>

    and in the css file add:

    #popular_posts ul{list-style-type: disc;
    	margin-left:15px;}

    I hope this helps.

    Truth, if you read this, can you please let us know if your list is sorted by comments or views? Thanks.

  3. Héctor Cabrera
    Member
    Posted 4 years ago #

    Hey guys,

    Sadly, it is a bug. I'm already working on it, should be releasing a new version within the next hour or so!

    Can you please check the rest of the attributes to check if they work as expected?

    Thanks!

    Timmos, what's your site's URL? I'd like to check what is being printed by my plugin.

  4. mpiftex
    Member
    Posted 4 years ago #

    Hey Ikki, I checked all the attributes except from rating since I don't use WP-PostRatings.
    You might want to have another look at:
    title_length=n -> the number of characters printed is actually n+3
    Also I couldn't get to do the pattern to work. The code I used:
    do_pattern=1&pattern_form='{title}: {summary} {stats}' and in the output it was just ignored, getting a simple list formatted as if these atrributes didn't exist.
    Everything else seems to be working fine.

  5. Héctor Cabrera
    Member
    Posted 4 years ago #

    Alright, thanks mpiftex! Need to play a little bit more with the excerpt function.

    The order_by thing has been fixed already, it was a minor thing! Will try and fix title_length and do_pattern. Once I'm done with that, I'll release 2.0.2!! (hopefully this should be the last upgrade for now hehe).

  6. mpiftex
    Member
    Posted 4 years ago #

    Just updated to v2.0.2 and the sorting problem has been fixed! The title_length is also fixed but I still can't figure out the pattern attribute. Maybe it's just me doing something wrong but since I'm not using it this feature I'm not gonna sweat about it.
    Good job Ikki, thanks for all the support.

    ps. I will switch this post to resolved now.

  7. Héctor Cabrera
    Member
    Posted 4 years ago #

    You gotta set do_pattern to true (do_pattern=1) and also specify the order of the tags (eg. pattern_form="{title} {stats}"). However, I might change that since the attribute do_pattern seems to be unnecesary and might confuse some people about its use.

    Thank you for your patience and suggestions!

  8. AutoKwame
    Member
    Posted 4 years ago #

    What do I do to add thumbnails in the shortcode extension, and how do I size them?

    Thanks a lot,Ikki24.

  9. Héctor Cabrera
    Member
    Posted 4 years ago #

    Try this:

    [wpp thumbnail_width=15 thumbnail_height=15]

    By setting the width and height of thumbnails, WPP will automatically activate this feature (but only if your current server has what's required for it to work).

  10. Tim Moss
    Member
    Posted 4 years ago #

    Hey Ikki

    Thanks for your swift updates. The ordering is now working perfectly on my site.

    I still can't get the bullet points to show but it's not the end of the world. I'll keep checking back here in case anyone figures it out.

    However, my 'Monthly' category still says 'Sorry, No data so far'. I read your post about it creating a new file that would take a while to populate but I've had it up for about a week now.

    Is this normal is there something I should do?

    Thanks again for your time,
    Tim.
    http://www.thenextchallenge.org

  11. Héctor Cabrera
    Member
    Posted 4 years ago #

    Hey timmoss,

    The bullet thingy is probably more a css styling issue not related to my plugin but to your theme. Might stop by your site later today to check it out.

    About the monthly range issue, are you using the shortcode, the widget or the template tag?

  12. Tim Moss
    Member
    Posted 4 years ago #

    Hey Ikki

    I'm not sure which one of those it's called by I type the code into the sidebar.php in the WordPress editor. Something like this one...

    <div id="popular_posts">
    <?php if (function_exists("get_mostpopular")) get_mostpopular("range=all&......?>
    </div>

    Thank you!
    Tim.

  13. Héctor Cabrera
    Member
    Posted 4 years ago #

    Timmos,

    You're running WordPress Popular Posts v2.0.2, right? I tested that code snippet on my local blog and it worked fine for me.

    This is the code I used on my theme:

    <?php if (function_exists("get_mostpopular")) get_mostpopular("range=monthly"); ?>

  14. Tim Moss
    Member
    Posted 4 years ago #

    Thanks again Ikki. I am indeed using WPP 2.02 and the latest version of WordPress.

    I tried copying your code and still get 'Sorry. No data so far'

    If anything comes to mind then let me know otherwise I will just have to live with it for now!

    Thanks for all of your help.

    Tim.

  15. Héctor Cabrera
    Member
    Posted 4 years ago #

    Mmmm how odd. Have you checked phpmyadmin yet? Is the table "wp_popularpostsdatacache" filled with entries? Have your tried setting "range" to something different like "daily" or "weekly" to see if it works?

  16. iancube
    Member
    Posted 4 years ago #

    Hi Ikki,

    Using WordPress 2.9.2 and WordPress Popular Posts 2.0.2.

    Checking phpmyadmin, its not writing anything to the table "wp_popularpostsdatacache" or "wp_popularpostsdata". 0 entries although there has been traffic clicking on articles.

    PHP 5.2.10 installed on the server.

    Any thoughts? Would appreciate any help you can provide!

  17. Héctor Cabrera
    Member
    Posted 4 years ago #

    Hi iancube,

    Is your site live now? How do your visitors access your site? Do they have to login?

  18. iancube
    Member
    Posted 4 years ago #

    The page is currently in development, and password protected via htaccess. I tried taking it off but it still wasn't writing any data to the cache tables.

  19. Héctor Cabrera
    Member
    Posted 4 years ago #

    I see. You're testing WordPress Popular Posts while logged in into wp-admin, right? If so, my plugin won't count your views since you're the site administrator (as stated at the FAQs section).

  20. iancube
    Member
    Posted 4 years ago #

    I did read that, and have had other users, not logged into WP-Admin, try. However it still does not register anything in the tables.

    Thanks for your continued help to figure this out!

  21. Héctor Cabrera
    Member
    Posted 4 years ago #

    Ian, please read this thread: http://wordpress.org/support/topic/366651

    Summary: when the wp-admin folder is password protected, my plugin cannot access a file called ajax-update.php because of the password restriction. That file is required for my plugin in order to update to the database. I posted a workaround in that thread. You might wanna try it!

  22. iancube
    Member
    Posted 4 years ago #

    Disabled the password completely and still no luck. :(

    Any other ideas? Could it have anything to do with htaccess?

  23. Héctor Cabrera
    Member
    Posted 4 years ago #

    Well, it's a bit difficult to do remote debugging :P

    Anyways, find this line:

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

    ...and change it to:

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

    Once you're done, load your blog on a different browser in case you're logged in wp-admin. Let me know what happens.

  24. iancube
    Member
    Posted 4 years ago #

    Unfortunately, nothing changed. Still no data being collected.

  25. Héctor Cabrera
    Member
    Posted 4 years ago #

    Mmm, the update function isn't being called by my plugin. Is there any way I can check your site? Need to see what code is being printed to your theme.

  26. iancube
    Member
    Posted 4 years ago #

    I think so, what type of access would you need?

  27. Héctor Cabrera
    Member
    Posted 4 years ago #

    Well, I need to see the site and probably edit the files to find out what's not working. You could also let me know via email how you have configured your site (htaccess, for example) so I can try to reproduce the bug locally and fix it. Either way, I need to see what's going on otherwise there's not much I can do from here my friend.

  28. Héctor Cabrera
    Member
    Posted 4 years ago #

    Hey iancube,

    Does your theme's <head> section has the wp_head() tag in it?

  29. Tim Moss
    Member
    Posted 4 years ago #

    Hi Ikki

    You helped me some time ago and I've got a new burst of enthusiasm for fixing my problem if you have any patience left...?

    I think it is probably a known issue but I can't quite work out how to solve it.

    - Weekly/monthly tags bring back 'Sorry. No data so far.'.
    - I have wp_head() in my header.php
    - wp_popularpostsdata has lots of entries but wp_popularpostsdatacache is EMPTY
    - I think my wp-admin folder is password protected (but this is a bit beyond me!)

    Very sorry if this is a basic question or been addresses elsewhere but any tips would be greatly appreciated.

    Thank you,
    Tim.
    http://www.thenextchallenge.org

    (The entries under 'Recent Popular Posts' aren't using the plugin)

  30. Héctor Cabrera
    Member
    Posted 4 years ago #

    Hey timmoss,

    Yup, I've got plenty of patience left so don't worry ;) I've checked your site and it seems to me that this is a theme issue. For some reason, WPP's javascript code (needed to update your popular cache) isn't being printed into your theme's head section.

    If you don't mind, I'd like to check your theme's code. You can either email it to me to yo [at] soyunduro [dot] com (don't worry, I won't keep it!) or gramt me admin access to your site so I can edit your theme directly from wp-admin.

Topic Closed

This topic has been closed to new replies.

About this Topic