Support » Plugin: Download Monitor » [Plugin: WordPress Download Monitor] [download_page] Only Shows 1 Tag on Main Page (Bug)

  • Resolved wfunderberg


    The other day I noticed that only 1 tag would show on the main page when using the [download_page] shortcode.

    After a bit of code researching I have found the problem and have corrected it. For those experiencing the same issue the fix is:

    1. Open the download-monitor-page.addon.php in any editor.

    2. Go to line 769 or search for:

    $sized_tags = array_slice($sized_tags, 0, $show_tags);

    3. Remove the “$show_tags” variable so it should read:

    $sized_tags = array_slice($sized_tags, 0);

    4. Save and refresh the page.

    I believe the $show_tags variable was put in place accidentally as that variable will either contain a 0 or 1. With that variable being placed in the array_slice function it is telling the function to only display 1. Ref:

Viewing 1 replies (of 1 total)
  • colingreig


    Thanks for the fix, it worked for me.

    Unfortunately it started listing every single tag (400+ for me) so I added in some basic code to only show tags that were utilized more than 3 times.

    foreach ($sized_tags as $tag=>$count) {
    							// only show tags used more than twice
    							if($count > 3) {
    								$size = 80 + (($max-($max-($count-$min)))*$multiplier);
    								$page .= '<li style="font-size:'.$size.'%"><a href="'.wp_dlmp_append_url('dltag='.urlencode(strtolower($tag))).'">'.$tag.'</a>';
Viewing 1 replies (of 1 total)
  • The topic ‘[Plugin: WordPress Download Monitor] [download_page] Only Shows 1 Tag on Main Page (Bug)’ is closed to new replies.