• Resolved queso

    (@queso)


    Sorry I lied one more post lol…

    Completely forgot there’s one thing that I’ve been meaning to send in for a while…

    There is the option to unload on a page, site wide, or all pages of ___ type. When unloading site-wide, you can then whitelist the single page, but not the post type.

    So whats missing is ONLY loading it for pages of that type. For example, the Table of Contents plugin I only want to run on blog posts, but not any of the static pages. So to partially accomplish, I’d have to go into one of each of all the other post types and blacklist there. Or blacklist site-wide and then remember to whitelist every time I made a post.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Gabe Livan

    (@gabelivan)

    @queso thanks again for the suggestions! There is a way to do this in a more effective way then unloading site-wide and whitelisting every page. This situation is not as used as the other one (e.g. unload on all pages of “page” type) and thus, the development was focused on other areas.

    At this time, the feature you’re looking for is available in the Pro version of the plugin. It’s “Load it if the URL (its URI) is matched by a RegEx“. You can unload an asset site-wide and make an exception to load it on a group of pages such as the blog posts. However, if you don’t have a unique string within the URI to distinguish a “post” type from a “page” type, then this wouldn’t help you much. For instance, if you want to load the asset (as an exception from unloading it site-wide) on all WooCommerce product pages, the RegEx rule can be something like #/product/(.*?)/# where “/product/” is the slug for the custom post type. Same for “/download/” in Easy Digital Downloads or “/category/” for the default WordPress posts’ category (taxonomy).

    I will consider your suggestion and if anything like ‘Load it on all pages of “post” post type‘ (for easier management and highest accuracy) would come up, it will likely be implemented in the Pro version.

    Thread Starter queso

    (@queso)

    Ya unfortunately I’m using the “Post Name” permalink structure so there wouldn’t be anything that could match with Regex. Besides Post Type the only other thing that may be “reasonable” (in terms of not too many to include/exclude) are categories (on my site at least)… I think including that unclassified one (whatever #1 is called) I’m using 5.

    Definitely makes sense… just throwing the ideas out there ??

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Whitelist by Post Type’ is closed to new replies.