• Resolved elsonponte

    (@elsonponte)


    Hi there,

    I am currently outputting popular posts in a custom HTML structure:

    $args = array(
    				'post_type' => 'post',
    				'range' => 'weekly',
    				'limit' => 8,
    				'stats_category' => 1,
    				'post_html' => '<li><span>{category}</span>&nbsp;&nbsp;<a href="{url}" title="{text_title}"><h3>{text_title}</h3></a></li>'
    			);
    
    			wpp_get_mostpopular( $args );

    The issue appears when the {category} lists more than one category. Each category entry is separated by a coma, but white space is added before the coma.

    Is there a way for this to be removed
    Screenshot: https://drive.google.com/file/d/1jn55Uzk5_D4qJAR7gflLBk1WqD0effO3/view

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

    (@hcabrera)

    Hola @elsonponte,

    Not sure where those empty spaces are coming from to be honest. I’ll have a look and get back to you as soon as I can.

    Plugin Author Hector Cabrera

    (@hcabrera)

    Hey @elsonponte,

    So I found the issue and it’s an embarrassingly dumb mistake:

    1. Go to Plugins > Plugin File Editor and select WordPress Popular Posts using the dropdown at the right of your screen.
    2. Click on src > Output.php to edit this file.
    3. Around line 700, change " . esc_html($term->name) . " </a>" into " . esc_html($term->name) . "</a>"

    If you followed these instructions correctly you should be seeing something like this:

    $post_tax .= "<a href=\"{$term_link}\" class=\"wpp-taxonomy {$taxonomy} {$taxonomy}-{$term->term_id}\">" . esc_html($term->name) . "</a>" . $taxonomy_separator;

    Click on the Update file button to save changes and that’s it.

    Thread Starter elsonponte

    (@elsonponte)

    Hi Héctor,

    Thank you for taking the time and looking into it. I updated the code as mentioned and it is working as it should.

    Are you planning to update the plugin in the next release to address this?

    Thanks,
    Elson

    Plugin Author Hector Cabrera

    (@hcabrera)

    Thanks for reporting back, and yes, of course. Next version of the plugin will 100% include this change.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘White space after category’ is closed to new replies.