Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Contributor iSaumya

    (@isaumya)

    Hi,
    The home page paginations are not considered by the plugin but as you stated you can use the swcfpc_post_related_url_init filter to add extra URLs that will be considered under the list of related URLs.

    For example you can add the following code in your functions.php file:

    add_filter( 'swcfpc_post_related_url_init', function($listofurls) {
    	return array_merge(
    		$listofurls,
    		[
    			'https://example.com/page/2/',
    			'https://example.com/page/3/',
    			'https://example.com/page/4/',
    			'https://example.com/page/5/',
    			'https://example.com/page/6/',
    			'https://example.com/page/7/',
    			'https://example.com/page/8/',
    			'https://example.com/page/9/',
    			'https://example.com/page/10/'
    		]
    	);
    } );

    Make sure you replace the URLs with actual URLs.
    Hope this helps.

    Thread Starter ricola771

    (@ricola771)

    Thank you so much for your help Saumya! Issue has been solved.

    Can this code be future proofed? For instance, adding 50 pages to the code even though I currently have 20? Will this create a problem with the plugin?

    I ask this because once my page is full (12 posts) I will have to add a non existing page to the code before creating a new post.

    Cheers

    Plugin Contributor iSaumya

    (@isaumya)

    Well, I honestly don’t think you will need to add more than 10 pages for pagination. As no real user will go that deep on the pagination. So, if you old pagination pages are not updated, it’s fine.

    Thread Starter ricola771

    (@ricola771)

    Makes sense. Thanks!

    Thread Starter ricola771

    (@ricola771)

    Saumuya, I just noticed that the categories URLS autoupdate but not the tags URLS.

    Is there a way to fix this without adding each tag page to the code above?

    Thanks,

    Plugin Contributor iSaumya

    (@isaumya)

    From what I see in the code, all post taxonomies i.e. both catory and tags should get auto purges as it is considered under related items.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Pagination cache problem’ is closed to new replies.