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
- Crafting WP_Query array, sort by date
- Custom loop with multiple taxonomy queries
- Return one unique custom post type result when it shares a custom taxonomy in WP_QUERY?
- Displaying custom taxonomy in the admin list of a custom post type
- Converting the_content string to an array?
- forming WP_Query for posts of all post types but from specific categories
- Get latest 3 posts from multiple CPT in one query
- Loop to fetch 3 post_thumbnail instances from 3 most recent custom post types named “portfolio”
- Which post does a taxonomy term belongs to?
- Display upcoming Events for next 7 Days
- Isotope Filtering with Bootstrap Tabs – Custom Post Type Query Loop in each Tab (Have to click twice to filter)
- Custom post ui plugin & WP_Query – Polylang
- How can I get the number of custom post type posts that have a specific attachment image set?
- Display post as term id
- How to use load more custom post type data normal or according to on click category tab In WP
- orderby rand is not working for a custom post types
- Problem querying Custom post type by custom fields
- Orderby CPT custom fields not working
- Custom taxonomy rewrite give pagination 404
- WP_Query order by custom field, then randomly order some of results
- How do I display the taxonomy term alongside the post type post title?
- WP_Query inside foreach loop returning same value for all options when filtered using ajax
- Mixing 2 custom post types with posts output in specific pattern
- Issue on Creating Custom Tax Term Dynamically From Another CPT Meta-box On Publish
- creat filter with wp_query
- Troubles with acf/save_post and WP_Query
- A method for ordering mixed dates in search result loop (theory only, no actual code)
- Post count by month of taxonmy term
- Query custom post type with ACF Date
- How to do WP_Query with two meta fields with orderby clause
- Stuck in Order by more then one
- Display featured image from one CPT within another CPT query
- Custom WP Query on custom meta and sort by multiple meta keys value
- Show only one post on custom post type archive
- Woocommerce search pagination not working
- How to order WP_Query by parent for hierarchical Custom Post Type?
- Including metaboxes from custom post types in global search — continued
- How can I made custom taxonomies relationship?
- Query Multiple Custom Posts by Custom Fields
- What’s the WP way to load remaining custom posts?
- Why is this query not working? (Standard posts + custom post type)
- How do you paginate a query grouped by month?
- Custom taxonomies relationship
- Get Posts by multiple custom fields is not working
- Custom post type ‘articles’ ignores posts_per_page, reserved post_type?
- Several post types on WP Query by tag and taxonomy
- WP Query with categories only shows one post and ignores the category
- Polylang non-default language ignores tags in WP_Query
- WordPress request fiter order by related post’s post_title
- How do I display the taxonomy for a custom post type in an array
- Custom Widget WP_Query problem
- Custom query at top of archive search page, arguments are overridden
- Order Custom Post Type by Custom Field Value
- WP_Query custom post type query not showing the exact post type
- How to display post list inside post
- Display Custom Taxonomy Alphabetically
- Pagination issue on category.php using custom post type query
- How to have this permalink structure: post_type/postname/custom_inner_page
- Problem: wp_query outputs all images on site
- How do I require the specification of term in a custom post type and custom taxonomy?
- Custom Post, set object Taxonomy terms in plugin
- Query Custom Post Type Taxonomy term with multiple parameters
- How to include term custom meta into the custom taxonomy term permalink structure
- Setup template_redirect using has_term when NO term assigned
- Sort entries by date mixing two post types
- Get terms that contain posts that in turn belong to other terms?
- Why is my category template ignoring post type?
- First custom field value (out of several) displayed twice after query
- How to get custom posts sub category link
- wp_reset_postdata() and wp_reset_query() inside shortcode are not working to reset original page query
- Custom while loop for hierarchical display of a taxonomy
- Prioritize posts in query by meta keys?
- Lists custom taxonomy terms that has specific custom field value assigned to the term (not post)
- Change sort order when using ‘orderby’ => ‘type’
- Display latest x posts from all categories in Custom Post Type/Taxonomy
- Add Custom Post Type of specific Custom Taxonomy to regularly blog loop
- Display taxonomy terms, child terms and posts in a template
- How to get all tags of a custom post type by id
- Foreach inside shortcode not working as planned
- Use custom walker to add taxonomy terms to main nav menu
- Filter Posts from the Main Query
- WP_Query orderby and tax_query
- Configuring a meta query with multiple post types that have the same relationship on a single page
- Different Ways to Query Custom Post Types?
- Conditional statement for if archive page has posts which contain certain taxonomies/categories/tags, show those terms