Support » Plugin: Top 10 - Popular posts plugin for WordPress » 3.1.0 update messes up output

  • I just updated the plugin and in the dashboard it switches from ‘daily popular posts’ to popular posts (which are really old and I don’t track on my site).

    Additionally, the formatting I use for my Top 20 is messed up. Thumbnails are not properly aligned, short descriptions are misaligned. It’s kind of a mess.

    I rolled back the plugin and everything works as it should.

    The page I need help with: [log in to see the link]

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

    (@ajay)

    On the formatting, you’ll need to delete any caches both from the plugin and other plugins as there are new classes and updated CSS in preparation for the next version.

    In terms of Dashboard is the /wp-admin/ page that you’re referring to? There are two widgets there and these counts should match with what you see in the Top 10 page / Popular posts.

    Deleting the cache won’t resolve the problem but changing the class will. That’s something I can do in my CSS code.

    As for the dashboard (admin), I was only displaying the Daily Popular Post but it switched it to Overall Popular Posts and I couldn’t get the other to be displayed. Maybe that is a caching issue because I do use an agressive caching plugin even though it doesn’t cache the admin. I’ll play around with it when I have more time.

    Thanks for the quick response.

    Plugin Author Ajay

    (@ajay)

    Thanks. Please let me know. I have this running on all my sites and can’t see any anomalies but conscious that our setups are different.

    I’ve also got a mix of caching plugins on my various sites.

    I can confirm the “mess” on the daily popular widget on the admin page.

    Since the latest two updates it displays pages there, too. Although I have not included the pages to be counted (not selected as “Post types to include” in settings-page/post list).

    Plugin Author Ajay

    (@ajay)

    @gerobe

    The dashboard widget reflects the counts and list as displayed in Top 10 / Popular Post – you should notice these match each other now and is meant as a quick view for an admin before they navigate to the full table.

    If you’re looking for the actual list in line with your settings, then that’s where the widgets on the front end site become relevant.

    Hello Ajay,
    but I need to see the values in the backend, that reflect the output in the frontend (as it used to be before the update). In the frontend I don‘t display the count and the daily counter does not reset at midnight. I need a backend-widget, that reflects (and shows) the frontend list. Please bring it back (maybe as a third widget).

    Plugin Author Ajay

    (@ajay)

    @gerobe

    You can use this code in your theme’s functions.php or in a mu-plugins file or using the Code Snippets plugin.

    /**
     * Display old Dashboard widget for Top 10.
     *
     * @param string $output Original HTML.
     * @param bool   $daily  Switch for Daily or Overall popular posts.
     * @return string Updated HTML.
     */
    function wporg_tptn_frontend_dashboard_widget( $output, $daily ) {
    
    	$args = array(
    		'daily'           => $daily,
    		'show_excerpt'    => 0,
    		'show_author'     => 0,
    		'show_date'       => 0,
    		'disp_list_count' => 1,
    		'heading'         => 0,
    	);
    
    	$output = tptn_pop_posts( $args );
    
    	$output .= '<p style="text-align:center">';
    
    	if ( $daily ) {
    		$output .= '<a href="' . admin_url( 'admin.php?page=tptn_popular_posts&orderby=daily_count&order=desc' ) . '">' . __( 'View all daily popular posts', 'top-10' ) . '</a>';
    	} else {
    		$output .= '<a href="' . admin_url( 'admin.php?page=tptn_popular_posts&orderby=total_count&order=desc' ) . '">' . __( 'View all popular posts', 'top-10' ) . '</a>';
    	}
    
    	$output .= '</p>';
    
    	return $output;
    }
    add_filter( 'tptn_pop_display', 'wporg_tptn_frontend_dashboard_widget', 11, 2 );

    This will display the front end widget but with just the counts. You can pass other arguments by modifying the $args array above.

    Wow! Great! Thank you! Works perfectly.
    What’s the $args to disable the thumbnail in the backend view?

    Plugin Author Ajay

    (@ajay)

    $args['post_thumb_op'] = 'text_only';
    

    Hey Ajay,

    I’ve been really busy and just left the plugin rolled back but that now no longer works.

    I looked at the classes and nothing seemed to change other than .tptn_posts which I’ve changed to .tptn_posts_daily in my code. I’m self-taught so I don’t know exactly what I’m looking at but all the other classes appear to be the same.

    I made the change, which fixed the alignment issue but now the numbers have been pushed to the right of the thumbnail just above the description. Previously, they were on the left and much larger.

    Here’s the code I’ve been using with the only change being tptn_posts to tptn_posts_daily

    `.sek-module .sek-module-inner .tptn_posts_daily ul>li, .sek-module .sek-module-inner ul>li {
    counter-increment: my-awesome-counter;
    display: inline-block !important;
    width: 100%;
    font-size: 2rem;
    }

    .sek-module .sek-module-inner .tptn_posts_daily ul>li, .sek-module .sek-module-inner ul>li::before {
    content: “” counter(my-awesome-counter);;
    font-weight: bold;
    font-size: 2rem;
    margin-right: 0.5rem;
    font-family: ‘Abril Fatface’, serif;
    line-height: 1;
    }

    .tptn_posts_daily .tptn_title, .tptn_posts .tptn_title {
    display: none !important;
    }
    img.tptn_thumb {
    margin-bottom: 5px;
    }

    @media only screen and (max-width: 768px) {
    .sek-module .sek-module-inner .tptn_excerpt {
    display: none;
    }
    }

    Plugin Author Ajay

    (@ajay)

    @kjam
    The main change was getting rid of the .tptn_posts (although I need to bring this back in the next version) and using the .tptn-left-thumbs directly for the left thumbs style.

    Are you able to show me the output of what it should be for the previous version.

    One option could be to choose to No styles option in the Settings page and try the old code from here: https://github.com/WebberZone/top-10/blob/v3.0.0/css/left-thumbs.css

    This is what it looks like without the ‘daily’ added onto the class, which was the original code:

    This is what it looks like when I change the ‘tptn_posts’ to ‘tptn_posts_daily’ which is not the way it was but at least it’s aligned.
    As you can see the numbers are incorrectly aligned above the excerpt.

    Previously, the font for the number was larger and fatter, the thumbnails were perfectly aligned to the left and the excerpts had a reasonable margin to the left of the thumbnail. Now, the excerpt runs up next to the thumbnail and the thumbnail has massive amounts of space on the left and nothing is evenly laid out.

    For the record, the daily post list in the admin is not the same as the output. It’s pulling really old random posts. This isn’t the most pressing issue but it was nice to get a quick glance of the accurate output on the frontend when I’m in the admin.

    Never mind, I fixed everything with CSS. I then had to go into my builder to adjust the margins for desktop, tablet and mobile and everything is working as it should now except the admin daily post I mentioned above but that’s not pressing and I don’t want to add anything else to my functions.php file.

    Thanks!

    Plugin Author Ajay

    (@ajay)

    @kjam

    Thank you for confirming!

    Next time I’ll just use image links but frankly, I don’t see the difference.

    Thanks.

Viewing 15 replies - 1 through 15 (of 15 total)
  • The topic ‘3.1.0 update messes up output’ is closed to new replies.