• Please add a container element in your Overall count widget output, maybe like the standard WordPress Text widget and/or similar to your Popular Posts widget.

    Also maybe check if $title is empty when adding before/after_title, see example in WordPress Text widget.

    Current code:

    $output  = $args['before_widget'];
    $output .= $args['before_title'] . $title . $args['after_title'];

    $output .= \WebberZone\Top_Ten\Counter::get_post_count_only( 1, 'overall', 0 );

    $output .= $args['after_widget'];

    Suggested fix:

    $output  = $args['before_widget'];
    if ( ! empty( $title ) ) {
    $output .= $args['before_title'] . $title . $args['after_title'];
    }

    $output .= '<div class="textwidget tptn-text-only">';
    $output .= \WebberZone\Top_Ten\Counter::get_post_count_only( 1, 'overall', 0 );
    $output .= '</div>';

    $output .= $args['after_widget'];

    Top 10 4.1.1, WordPress 6.8.2

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Ajay

    (@ajay)

    Hi @ov3rfly

    I’ve filed an issue in GitHub for this.

    https://github.com/WebberZone/top-10/issues/178

    Please can you monitor that and I’ll mark this closed.

    Thread Starter Ov3rfly

    (@ov3rfly)

    Thanks for quick response and action.

    Found the issue at a client, who uses theme HitMag which uses inline-block for the widget headline for their underline effect and other layout reasons, see also theme demo website.

    I do not use GitHub, I only monitor reported issues at ww.wp.xz.cn.

    Feel free to mark this issue as ‘resolved’ after a plugin update with a fix has been released, not before, thanks.

    Plugin Author Ajay

    (@ajay)

    I’m not sure when I’m going to get to a new version that fixes this. As you can appreciate this isn’t a bug but an enhancement to make the compatibility better. It’s filed there and I’ll definitely do in the next release.

    The reason I mark this as resolved, because the algorithm on dot org penalises open support requests. But, I’m not fussed if you’d like to keep it open.

    In the meantime, if you’ve not already done so, please make the edit you suggested above to your copy of the plugin.

    Thread Starter Ov3rfly

    (@ov3rfly)

    Actually I consider it as two bugs.

    All standard WordPress widgets have some sort of container elements for widget content and do not output empty before/after_title headline elements if $title is left empty, have provided links to Text widget example above.

    Client uses the plugin on several sites, editing plugin files is not an option. The count number is printed directly in headline there, you can see the effect by trying with the above linked theme demo. Client uses some dots in headline now for at least some little distance, because empty title causes empty h4 with SEO and layout issues.

    Thanks for the plugin, guess they have to wait for your fix.

    Plugin Author Ajay

    (@ajay)

    Just to let you know, I’ve updated the Top 10’s codebase on GitHub – same URL as above. It will be part of the new release in the next few weeks.

Viewing 5 replies - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.