If it is a category page, you can get the id of the current category by using get_category:
$category = get_category( get_query_var( 'cat' ) );
$cat_id = $category->cat_ID;
EDIT: You could use the variable $cat_id
inside your query instead of ‘Bristol’ and it would pull the correct category for each page.
Related Posts:
- Posts in Multiple Columns and Rows with one single loop
- Custom post type loops with different page templates
- How to get current post id of a custom post type in a loop using template singel-{custom type}.php?
- Custom Post Type Taxonomies -Posts not showing in Category or Tag pages
- Main query not querying any posts in custom taxonomy template
- assign different templates to custom post type with homepage loop
- Assign a template to a custom post type when displayed by the main loop on the home page
- Create a custom taxonomy template that loops through child categories in term order?
- On click some element i want to use some template
- Accessing download link from the loop with WP Download Manager Pro
- Custom taxonomy template for custom fields loop [closed]
- get_permalink() of page the enclosing page not posts
- Load different template for CPT (in loop) in my plugin?
- How can I pull information from my loop and divide them seperately?
- How to create custom page templates with default page layout framework?
- Pagination not working with custom loop
- Is it possible to define a template for a custom post type within a plugin independent of the active theme?
- How to pass URL parameters for advanced taxonomy queries with multiple terms for one custom taxonomy
- How to set a fall back template for a custom post type in a plugin?
- How to list/show all custom post types regardless of category?
- how do I group content in magazine-style ‘issues’?
- Create Pages from Database
- List events by month
- Show all custom post type posts sorted by custom taxonomy then by another custom taxonomy
- Group search results by post type, but hide post types with no results
- How to create posts (not post template) to be displayed on projects page?
- Custom Post Loop in Archive returns same the_permalink
- WP_Query post at custom position
- Include different loop templates in search query
- Pagination with custom post types results in 404 issues
- How do you output custom code between posts in the loop?
- How do I Use Nested Loops of Custom Post Types for MultiSite Blogs using WP_Query()
- Impossible to get Attachments Outside WordPress?
- List posts AND custom post type by category
- Help Structuring Query for Archive Pages
- wp_query to find posts by year and month
- Loop of custom post type names
- get_template_part for each level of taxonomy term
- Query custom post type in the loop
- Very Slow Page – How to Optimize # of Queries?
- WordPress Genesis custom taxonomy archive shows 3 repeats of each post
- How do i calculate the total of values of custom fields in custom post types?
- Custom post type not displaying content from single-{custom post type} page
- Display all taxonomy terms, add class if term applies to current post
- A to Z List of Custom Post Type in three columns
- WP Query with categories only shows one post and ignores the category
- Post ID randomly printing on page
- How do I know the ‘meta_key’ for ordering my custom post type
- How to specify a template for a path like http://example.com/something?
- Sort posts in loop by the WooCommerce Membership of the author
- WordPress 3.9 not using custom template
- How to include custom post type posts on a page?
- 4 column-loop ordered alphabetically with entries grouped (and labeled) by their first letter
- How to Create Template File for Parent Page of Custom Post Type
- Custom post_type search pages
- how to remove pages loading with the archive templates
- Custom post type showing same Post on all Pages
- get parent content inside child posts
- Custom post types with categories in template
- Get data from PHP to JavaScript to set position of each post on front page
- display posts of custom post type with custom taxonomy
- Custom Post Type and Taxonomy Loop Output Is Wrong
- foreach loop inside the loop creating duplicates in output
- How to fetch posts that are stored in the different table than (default) wp_posts?
- Cant’ Display Custom Post Type Title Base on Tax Terms
- How do i display post from a taxonomy term?
- Calling a div and content in php?
- Custom loop request based on custom field
- Tag template not returning posts [closed]
- If/Else child list for Custom Post Type single template within loop?
- Insert a Custom Post type into my Loop
- Custom Post Types Not Showing Up In query_posts Result
- Do I need a loop to display an object that attached to posts?
- “Order” doesn’t work in custom loop?
- Shortcode with loop stacks output
- Show custom post type event if current day using ACF
- Custom Post Taxonomy Template Not Loading Properly
- Wrapping an unknown amount of posts inside separate HTML Containers during WP_Query loop
- Templating advice sub posts of a CTP
- sorting in wp query based on custom field value
- Custom post type loop without children
- Can I organise my custom post types by page?
- How to display user-defined / custom post in wordpress?
- I want to create an archive and single page for a custom taxonomy for a custom post type
- WordPress loop add heading before first of type
- Only show current category post
- Looping through custom taxonomy in one template
- get_post_meta for Custom Post Type ( CPT )
- How to keep a CPT stick to specific position?
- custom post type plugin – single template
- WordPress loop for multiple custom post types
- Pagination not working with custom loop
- Fallback if statement based on the number filtered from it
- Create custom post order (with custom post type meta)
- Pagination not working with custom loop
- Noob Loop Question
- Custom Post Types and 404 Pages
- WP_Query is getting the post but the_post() not rendering any Post
- show custom post’s post in two different divs [duplicate]
- Limit wordpress posts loop to continue onto another page