Common Filters: Only show on blog posts

If your website is running on WordPress, by far the best way to do this is to install the Filament WordPress plugin.

If your website is not running on WordPress, there are several ways to add an app only to your Blog posts.

Method 1: Text Matching

The easiest way to deploy an app exclusively to your blog posts is to use Text Matching to identify a phrase that only exists on your posts – for example “Written by”, or “Posted on”. Once you’ve identified this phrase, you can use the following simple Filter to target only your blog posts:

http://assets-filament-io.s3.amazonaws.com/wp-content/uploads/2014/02/post-filter-1024x350.png

The nice thing about this is that as you write more posts, they’ll be automatically included by the Filter above –meaning you won’t have to redeploy your apps as your website grows.

Method 2: URL Matching

If you can’t find a phrase that’s unique to your posts, custom post types, or other kinds of recurring content, you can still use Filters to create custom rules that work with your URL structure. Visit one of your blog posts, and choose which example URL best matches it from the list below for a recommended Filter that uses URL Matching:
  • http://yoursite.com/post-title [See Filter]
  • http://yoursite.com/category/post-title [See Filter]
  • http://yoursite.com/blog/post-title [See Filter]
  • http://yoursite.com/2014/12/25/post-title [See Filter]
  • http://yoursite.com/?p=123 [See Filter]
Nothing above matches your URL structure? Contact us!

If your post URLs look like this: http://yoursite.com/post-title
Drag & drop your app instance to your homepage, select “Some Pages”, and configure your Filter as shown below:

https://s3.amazonaws.com/assets-filament-io/knowledge_base/screenshots/common-filters-only-show-on-blog-posts_2.png

This Filter applies your app to all pages under your homepage, and excludes each of your static pages, such as your About Page, Contact page, etc. – thereby leaving only your posts.


If your post URLs look like this: http://yoursite.com/category/post-title
Drag & drop your app instance to your homepage, select “Some Pages”, and configure your Filter as shown below:

https://s3.amazonaws.com/assets-filament-io/knowledge_base/screenshots/common-filters-only-show-on-blog-posts_3.png

Since your posts live under categories, you can simply include each category to target the posts underneath them. If you have lots of categories, you may want to consider using this Filter instead. Note that in this scenario, if you create a new category for your posts, you’ll need to update your Filter to include it.


If your post URLs look like this: http://yoursite.com/blog/post-title
Drag & drop your app instance to your blog index page, select “Some Pages”, and choose "Only after this URL". Easy!


If your post URLs look like this: http://yoursite.com/2014/12/25/post-title
Drag & drop your app instance to your homepage, select “Some Pages”, and configure your Filter as shown below:

https://s3.amazonaws.com/assets-filament-io/knowledge_base/screenshots/common-filters-only-show-on-blog-posts_4.png

By targeting any pages below the homepage that start with “201″, you’re including all posts from 2010 through 2019. Of course, you’ll need to update your Filter once 2020 rolls around… Sorry about that, hopefully we can figure out how to fix this before then ;)


If your post URLs look like this: http://yoursite.com/?p=123
Under this URL structure, every page in your website gets a number, so unless you know the specific ID numbers of your pages and blog posts, it’s difficult to use URL matching to target specific groups of pages effectively. You’re better off trying to create a Text-Matching Filter, or using jQuery selectors to target the pages you want.










Feedback and Knowledge Base