• Resolved marcorroma

    (@marcorroma)


    Hello,
    I have activated the preload.
    How can I exclude only tags?
    I have a site with many tags. I wish only the homepage and categories were preloaded.
    Thank you

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Mustafa Uysal

    (@m_uysl)

    Hi @marcorroma,

    You can use powered_cache_preload_taxonomies filter to control which terms are being preloaded.

    https://github.com/skopco/powered-cache/blob/master/extensions/preload/inc/class-powered-cache-preload-process.php#L157

    something like:

    
    add_filter( 'powered_cache_preload_taxonomies', function ( $taxonomies ) {
    	unset( $taxonomies['post_tag'] );
    
    	return $taxonomies;
    } );
    

    Should work

    Thread Starter marcorroma

    (@marcorroma)

    I can do this for categories (on line 157):
    $taxonomies = apply_filters( ‘powered_cache_preload_taxonomies’, array(‘category’ => ‘category’ ) );

    How can I add the homepage and pages?

    Ps. do I add the code you suggested to the functions.php of my theme, or modify the /preload/inc/class-powered-cache-preload-process.php file?

    • This reply was modified 4 years, 12 months ago by marcorroma.
    Plugin Author Mustafa Uysal

    (@m_uysl)

    Hi @marcorroma ,

    Please don’t edit the plugin files, try with functions.php or create a PHP file inside the mu-plugins directory.

    How can I add the homepage and pages?

    All publicly queryable post types should be preloaded by default. Doesn’t it work?

    Thread Starter marcorroma

    (@marcorroma)

    What should I create in that folder? I have never used mu-plugin. Is it like a theme child?
    Can you give me an example?

    Thread Starter marcorroma

    (@marcorroma)

    Sorry if I come back with the topic.
    So with the code you wrote me, if inserted in my theme’s functions.php, does it exclude the tags from the preload?
    Is there a way to check if only categories are preloaded?

    It would be good for me if you could also preload the last 15 posts published. Do you think it’s possible?

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Preload question’ is closed to new replies.