The problem lies with the get_the_term_list() function, which is defined with the following arguments:
get_the_term_list( $id = 0, $taxonomy, $before="", $sep = '', $after="" )
You’re defining the $before
argument as true which PHP prints as 1 so that’s why it’s printing a 1 before the list. You should either remove the argument altogether:
get_the_term_list( $p, 'mountains' );
or replace it with a string:
get_the_term_list( $p, 'mountains', '<ul><li>', '</li><li>', '</li></ul>' );
Related Posts:
- query multiple taxonomies
- Adding a term name from a custom taxonomy assigned to a post link displayed by a wp_query loop based on another taxonomy
- Sort the main query in subcategories/terms?
- List all custom post type posts from a given category?
- Filtering WP_Query Dynamically on the Front-End
- Custom post taxonomies as tax_query terms?
- WordPress loop: Show only a Custom Post Type Taxononmy TERM
- Print current post category during WP_Query
- Query for specific taxonomy that executes a particular loop depending on volume of posts?
- display post count in archive page that have relation with another taxonomy term
- Display Custom Post Type Based on Taxonomy With WP_Query()
- Display all Custom taxonomy terms and their relevant custom posts
- Get posts of an specific term of a custom taxonomy
- How to pass taxonomy terms to WP_Query along with $args?
- How to Get The Taxonomy Term in Custom Post Type Loop Inside a Wp Query
- Query by post title
- Get post with multiple meta keys and value
- Get posts for custom post type with WP_Query
- WP_Query() show posts that end later than today
- Sorting a query by custom field date
- Number of pages – multiple (custom) post types
- Custom Taxonomies Terms as Post Title for Custom Post Types upon Publishing
- How to get term link that crosses different custom post types?
- Enforcing canonical URLs with multiple custom post types
- WP_Query -> sort results by relevance (= most tags / taxonomy terms in common)
- Get latest 4 post on a custom post filtered by category
- how to group custom post type posts by custom taxonomy terms
- Separate Custom Post Type Taxonomy by Comma
- Get child terms of current term of the current post
- wp_query and comment_parent – select only posts with top level comments
- Comparing timestamps in meta query doesn’t work
- Include both default and Custom Post Type in query modified inside pre_get_posts
- Exclude current post when getting related post on custom post type and taxonomy
- Filter posts with meta_query NOT IN where value has multiple values
- How to query different post types in specific order?
- Loop on front-page.php
- Querying Term Posts in Loop
- is_main_query() not working for WP REST API
- Can’t get order_by meta_value_num to work properly
- orderby in custom WP Query does not work
- Unable to retrieve any posts of CPT in wp-admin
- Linking to the most recent post in a Custom Post Type
- How to make sure content doesn’t display if selection is empty
- Creating a navigation menu of all posts of a custom post type and their children posts?
- using $wpdb to get custom post type with term
- Wp_query: sort by PHP variable
- WP_Query most viewed posts, in multiple Post Types, last 30 days, excluding a specific taxonomy term
- Allow user to set custom order to a list of custom taxonomies?
- Crafting WP_Query array, sort by date
- Which post does a taxonomy term belongs to?
- Including metaboxes from custom post types in global search — continued
- Custom Widget WP_Query problem
- How do I require the specification of term in a custom post type and custom taxonomy?
- Order posts by 2 custom fields and if one custom field is zero orderby another custom field
- WP Query post__in not returning correct results
- Proper way to display latest 5 posts grouped by post type?
- Detect inside a custom query the kind of post type to assign custom classes
- Custon Content within WordPress Loop
- Category archive in with conjunction with custom post type is empty
- How to Display Posts From Category Within a Custom Taxonomy?
- get_pagination not working on a custom post type query (using WP_Query)
- WP_Query with custom post type ID
- Query all post and CPT from 2 specific taxonomies AND by ACF custom field
- postsperpage value not being applied
- Exclude latest post from WP_Query taxonomy term loop
- How can I get 3 different taxonomy type terms in a div class element?
- Get terms for a specfic post from multiple taxonomies in custom post type
- Getting titles from an array of IDs
- Display featured posts for a custom post type by taxonomy
- Get List of Terms based on a given term (different taxonomy)
- custom taxonomy pagination 404 error
- Get next and prev item from custom WP_Query and Custom Post Type
- After inserting new post with wp_insert_post() the post is not visble to WP_Query, but the same WP_Query works for post inserted from wp-admin panel
- Query to show post current day
- Using ACF values in nested WP queries for CPT with date values in the past
- WP_Query: how to search tags in addition to a custom post type?
- Pagination Not Working When Used With WP_Query() `offset` Property
- Excluded Custom Taxonomy Term Posts Displaying in loop
- Help understand and create a loop with WP_query
- WP_Query for custom taxonomies showing posts from non-specified terms?
- Make pagination work as a carousel (custom query)
- WP_Query with all posts in one custom post type and only posts in another custom post type with a specific category
- Search result based on URL
- Imported Content Doesnt Show Up On Frontend
- Loop carousel slider in wordpress
- New WP_Query not isolating custom post types on front-page template
- How to load more custom type posts through AJAX & LOAD MORE POSTS button
- Get a list of categories ids
- Pagination always adding “Next” link when results come from Custom Post Type WP_query
- 404 on Pages for Custom Post Type & Query_Posts
- Pagination not working on homepage
- How to query custom post then display sections by meta value
- Using tax_query to get single post per category
- Show Posts in Vertical Tabs with Scrollbar
- How to manage wordpress knowledge base/wiki/posts collections
- Is it possible to make is_category() recursive?
- Get X posts with the same terms as the current post (custom post type and custom taxonomy)
- How can I show posts with the same tag?
- Load posts via AJAX without draft status
- WP Query – Can’t get posts with specific taxonomy