WordPress.org

Ready to get started?Download WordPress

Forums

Last Viewed Posts
[resolved] exclude specific page (2 posts)

  1. sjoco
    Member
    Posted 1 year ago #

    Hi, thnx for writing this plugin!

    Is it possible to exclude a specific page in the list of last viewed?

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

  2. Noumaan Yaqoob
    Member
    Plugin Author

    Posted 1 year ago #

    yes if you are comfortable editing plugin files. Change function zg_lwp_header() on line 46 like this:

    function zg_lwp_header() { // Main function is called every time a page/post is being generated
    	if (is_single()) {
    		zg_lw_setcookie();
    	} else if (is_page()) {
    		global $zg_recognize_pages;
    		if ($zg_recognize_pages === true) {
    		// Use the page ID you want to exclude
    			if(is_page(10)) {
    			// do nothing
    			} else {
    			zg_lw_setcookie();
    			}
    		}
    	}
    }

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic