title: How to add Wagtail blog categories as links in header and footer
body: <p>I am building simple blog with posts and posts categories.
  I would like to add links to posts categories to header and footer, so they appear on every page, not just home page (as routable pages).
  How do I go about it?</p>
  <p>Category class as below:</p>
  <pre><code>class BlogCategory(models.Model):
  
      title = models.CharField( # field name has to be 'title'
      verbose_name='Name', max_length=30, unique=True)
      slug = AutoSlugField( populate_from='title', editable=True)
  
      panels = [
          MultiFieldPanel([
              FieldPanel(&quot;title&quot;),
              FieldPanel(&quot;slug&quot;),
          ], heading=&quot;New Category&quot;),]
  
      def __str__(self):
         return self.title
  </code></pre>
  <p>Code for routable page:</p>
  <pre><code>class BlogIndexPage(RoutablePageMixin, Page):
    class Meta:
          verbose_name = &quot;Blog Index Page&quot;
  
    template = &quot;blog/blog_index_page.html&quot;
    parent_page_types = [&quot;wagtailcore.Page&quot;]
    subpage_types = [&quot;blog.PostArticlePage&quot;]
    max_count = 1
  
    # context ------------------------------
    def get_context(self, request, *args, **kwargs):
      context = super().get_context(request, *args, **kwargs)
  
      all_posts = (
          BlogDetailPage.objects.live().public().order_by(&quot;-first_published_at&quot;)
      )
  
      context[&quot;posts&quot;] = all_posts
  
    @route(r&quot;^category/(?P&lt;cat_slug&gt;[-\w]*)/$&quot;, name=&quot;category_view&quot;)
    def category_view(self, request, cat_slug):
      context = self.get_context(request)
      try:
          category = BlogCategory.objects.get(slug=cat_slug)
      except Exception:
          return redirect(self.url)
  
      if category is None:
          return redirect('/')
  
      context[&quot;posts&quot;] = (BlogDetailPage.objects.live().public().filter(categories__in=[category]))
      return render(request, &quot;blog/blog_view_page.html&quot;, context)
  </code></pre>