{"id":1952450,"date":"2022-03-31T04:16:57","date_gmt":"2022-03-31T08:16:57","guid":{"rendered":"https:\/\/theeventscalendar.com\/knowledgebase\/?post_type=tribe-knowledgebase&#038;p=1952450"},"modified":"2026-04-02T16:53:27","modified_gmt":"2026-04-02T20:53:27","slug":"removing-the-cost-range","status":"publish","type":"post","link":"https:\/\/theeventscalendar.com\/knowledgebase\/removing-the-cost-range\/","title":{"rendered":"Adjusting the Cost Range Display on Event Pages"},"content":{"rendered":"\n<p>When using multiple tickets with <a href=\"https:\/\/theeventscalendar.com\/products\/wordpress-event-tickets\/\" target=\"_blank\" rel=\"noreferrer noopener\">Event Tickets and Event Tickets Plus<\/a>, the price will display as a range. However, there may be instances in which you&#8217;d like to show only one of the prices.<\/p>\n\n\n\n<p>This may come up with early bird pricing or a hidden ticket, where you&#8217;d only like to show one of the prices at a time. The good news is that we&#8217;ve got a snippet to help you out with this customization.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-remove-the-cost-range\">Remove the cost range<\/h2>\n\n\n\n<p>Add the following snippet to your theme&#8217;s <code>functions.php<\/code> file or via <a href=\"https:\/\/wordpress.org\/plugins\/code-snippets\/\">Code Snippets<\/a> plugin.<\/p>\n\n\n\n<p>Choose whether you want to show the lowest price (maybe with some text) or the highest price only. Delete the unwanted block of code.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: php; title: ; notranslate\" title=\"\">\nfunction tec_remove_price_range( $cost, $post_id, $with_currency_symbol ) {\n \n    $pieces = explode( &#039; \u2013 &#039;, $cost );\n \t\n    \/\/ If ticket is free, just display it.\n    if ( $cost == &#039;Free&#039; ) {\n\t\treturn $cost;\t\n\t}\n \n\t\/\/ Remove the block you don&#039;t need!\n\t\n    \/\/ To show the lowest price with some text.\n    if ( ! empty( $pieces&#x5B;0] ) ) {\n        return &quot;Starting from &quot; . $pieces&#x5B;0];\n    }\n \n    \/\/ To show the highest price.\n    if ( ! empty( $pieces&#x5B;1] ) ) {\n        return &quot;Up to &quot; . $pieces&#x5B;1];\n    }\n \n    \/\/ If not a range then return the default value.\n    return $cost;\n}\n \nadd_filter( &#039;tribe_get_cost&#039;, &#039;tec_remove_price_range&#039;, 10, 3 );\n<\/pre><\/div>\n\n\n<p>The above code will display the following:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full has-custom-border\"><img loading=\"lazy\" decoding=\"async\" width=\"596\" height=\"279\" src=\"https:\/\/images.theeventscalendar.com\/kb\/uploads\/2024\/09\/Starting.jpg\" alt=\"\" class=\"wp-image-1962866\" style=\"border-width:1px\" srcset=\"https:\/\/images.theeventscalendar.com\/kb\/uploads\/2024\/09\/Starting.jpg 596w, https:\/\/images.theeventscalendar.com\/kb\/uploads\/2024\/09\/Starting-300x140.jpg 300w\" sizes=\"auto, (max-width: 596px) 100vw, 596px\" \/><\/figure>\n\n\n\n<p>To display only the highest price, you can remove lines 12 to 15. This change will result in the following:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full has-custom-border\"><img loading=\"lazy\" decoding=\"async\" width=\"596\" height=\"279\" src=\"https:\/\/images.theeventscalendar.com\/kb\/uploads\/2024\/09\/Up-to-Price-1.png\" alt=\"\" class=\"wp-image-1962864\" style=\"border-width:1px\" srcset=\"https:\/\/images.theeventscalendar.com\/kb\/uploads\/2024\/09\/Up-to-Price-1.png 596w, https:\/\/images.theeventscalendar.com\/kb\/uploads\/2024\/09\/Up-to-Price-1-300x140.png 300w\" sizes=\"auto, (max-width: 596px) 100vw, 596px\" \/><\/figure>\n\n\n\n<p><br><\/p>\n","protected":false},"excerpt":{"rendered":"<p>When using multiple tickets with Event Tickets and Event Tickets Plus, the price will display as a range. However, there may be instances in which you&#8217;d like to show only one of the prices. This may come up with early bird pricing or a hidden ticket, where you&#8217;d only like to show one of the&#8230;<\/p>\n","protected":false},"author":84,"featured_media":1955565,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_kad_blocks_custom_css":"","_kad_blocks_head_custom_js":"","_kad_blocks_body_custom_js":"","_kad_blocks_footer_custom_js":"","_swpsp_post_exclude":false,"_kad_post_transparent":"","_kad_post_title":"","_kad_post_layout":"","_kad_post_sidebar_id":"","_kad_post_content_style":"","_kad_post_vertical_padding":"","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"ep_exclude_from_search":false,"footnotes":""},"categories":[59],"tags":[25,58],"stellar-product-taxonomy":[155,156],"class_list":["post-1952450","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-php-function-snippets","tag-customizations","tag-php","stellar-product-taxonomy-event-tickets","stellar-product-taxonomy-event-tickets-plus"],"acf":[],"taxonomy_info":{"category":[{"value":59,"label":"PHP Functions &amp; Snippets"}],"post_tag":[{"value":25,"label":"Customizations"},{"value":58,"label":"PHP"}],"stellar-product-taxonomy":[{"value":155,"label":"Event Tickets"},{"value":156,"label":"Event Tickets Plus"}]},"featured_image_src_large":["https:\/\/images.theeventscalendar.com\/kb\/uploads\/2023\/02\/social-share-1024x538.png",1024,538,true],"author_info":{"display_name":"The Events Calendar Team","author_link":"https:\/\/theeventscalendar.com\/knowledgebase\/author\/the_events_calendar_team\/"},"comment_info":0,"category_info":[{"term_id":59,"name":"PHP Functions &amp; Snippets","slug":"php-function-snippets","term_group":0,"term_taxonomy_id":59,"taxonomy":"category","description":"","parent":24,"count":127,"filter":"raw","term_order":"0","cat_ID":59,"category_count":127,"category_description":"","cat_name":"PHP Functions &amp; Snippets","category_nicename":"php-function-snippets","category_parent":24}],"tag_info":[{"term_id":25,"name":"Customizations","slug":"customizations","term_group":0,"term_taxonomy_id":25,"taxonomy":"post_tag","description":"","parent":0,"count":102,"filter":"raw","term_order":"0"},{"term_id":58,"name":"PHP","slug":"php","term_group":0,"term_taxonomy_id":58,"taxonomy":"post_tag","description":"","parent":20,"count":78,"filter":"raw","term_order":"0"}],"_links":{"self":[{"href":"https:\/\/theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/posts\/1952450","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/users\/84"}],"replies":[{"embeddable":true,"href":"https:\/\/theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/comments?post=1952450"}],"version-history":[{"count":12,"href":"https:\/\/theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/posts\/1952450\/revisions"}],"predecessor-version":[{"id":1968390,"href":"https:\/\/theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/posts\/1952450\/revisions\/1968390"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/media\/1955565"}],"wp:attachment":[{"href":"https:\/\/theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/media?parent=1952450"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/categories?post=1952450"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/tags?post=1952450"},{"taxonomy":"stellar-product-taxonomy","embeddable":true,"href":"https:\/\/theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/stellar-product-taxonomy?post=1952450"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}