WordPress.org

Ready to get started?Download WordPress

Forums

WordPress Popular Posts
[resolved] Can we NOT use POST (to admin-ajax.php) for static homepage!! (4 posts)

  1. Jerome
    Member
    Posted 2 years ago #

    Hi. I'd like to know, if we're using a static page created in the Pages menu in wp-admin as our blog's homepage, can we NOT post that pageview to the database every time the homepage is called? The POST to and reply from admin-ajax.php is taking over 4 seconds on my server, which is highly delaying my pageloads. So, is there a way that I can immediately stop this POST from happening on my homepage only? That's going to be the deciding factor of whether I keep using this plugin or not, and after all the work I put into trying to figure the code out for it, I would REALLY hate to have to find another plugin. Please help. Thanks!

    http://wordpress.org/extend/plugins/wordpress-popular-posts/

  2. Jerome
    Member
    Posted 2 years ago #

    Hey Dev, can ya answer me?

  3. H├ęctor Cabrera
    Member
    Plugin Author

    Posted 2 years ago #

    Hi Jerome,

    That's something I didn't think of before. Try this:

    # Open wordpress-popular-posts.php using an editor such as Notepad or Dreamweaver.
    # Find this:

    // if we're on a page or post, load the script
    if ( (is_single() || is_page()) && !is_user_logged_in() ) {

    # ... and change it to:

    // if we're on a page or post, load the script
    if ( (is_single() || is_page()) && !is_user_logged_in() && !is_front_page() ) {

    # Save changes.

  4. Jerome
    Member
    Posted 2 years ago #

    Thanks! this removed 2 seconds off each home-pageload!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic