WordPress.org

Ready to get started?Download WordPress

Forums

Download Monitor
[resolved] Unable to get top 10 list displaying in sidebar widget (4 posts)

  1. pinkbeats
    Member
    Posted 3 years ago #

    I'm using the Exec-PHP plugin so I can insert php code into the sidebar widgets. I've been replacing the legacy tags throughout my blog, I was using the code <?php wp_dlm_show_downloads(1,10); ?> to output a list the top ten downloads (which needed an additional tweak to the code in legacy_shortcodes.php for it to display exactly how I wanted it) but replaced it with <?php do_shortcode('[downloads query="limit=10&orderby=hits" format="3"]'); ?> which I hoped would do the same thing but now no list appears.

    Any pointers as to what I'm doing wrong appreciated, should the php code I'm inserting be more along the lines as suggested in this thread?

    The custom output format I'm using is {hits} - <a href="{url}" title="Downloaded an incredible {hits} times">{title}</a> to emulate how the links appeared using the previous code. Thanks in advance for any assistance.

  2. Mike
    Member
    Posted 3 years ago #

    echo do_shortcode()

    without the echo it won't output :)

  3. pinkbeats
    Member
    Posted 3 years ago #

    Thanks sorted - had to tweak the code slightly as it was showing the least downloaded files instead the most downloaded ones:
    <?php echo do_shortcode('[downloads query="limit=10&orderby=hits&order=desc" format="3"]'); ?>

  4. paulmunford
    Member
    Posted 3 years ago #

    Cool - it works for me to. Thanks!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic