WordPress.org

Ready to get started?Download WordPress

Forums

[Plugin: Last Viewed Posts] Make it work with localhost (1 post)

  1. jaggsr
    Member
    Posted 4 years ago #

    To make it work on localhost:

    We will need to add few lines in the function zg_lw_setcookie()

    Replace the below line :

    setcookie("WP-LastViewedPosts", serialize($zg_cookiearray), (time()+($zg_cookie_expire*86400)), $zg_path_url, $zg_blog_url_dot, 0);

    with:

    if($_SERVER['HTTP_HOST'] == 'localhost'):
    	setcookie("WP-LastViewedPosts", serialize($zg_cookiearray), false, "/", false, 0);
    	else:
    	setcookie("WP-LastViewedPosts", serialize($zg_cookiearray), (time()+($zg_cookie_expire*86400)), $zg_path_url, $zg_blog_url_dot, 0);
    	endif;

    http://wordpress.org/extend/plugins/last-viewed-posts/

Topic Closed

This topic has been closed to new replies.

About this Topic