{"id":1097548,"date":"2016-04-03T09:34:58","date_gmt":"2016-04-03T16:34:58","guid":{"rendered":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/stop-certain-elements-appearing-on-all-views\/"},"modified":"2016-04-22T09:35:04","modified_gmt":"2016-04-22T16:35:04","slug":"stop-certain-elements-appearing-on-all-views","status":"closed","type":"topic","link":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/stop-certain-elements-appearing-on-all-views\/","title":{"rendered":"Stop certain elements appearing on all views"},"content":{"rendered":"<p>I have been given the task of sorting out styling and functionality issues with a big upgrade from v2 to v4.<br \/>\nI am trying to add a 100% browser full width banner on the main calendar page which works great if I add it to the default-page template in my theme folder but the previous developers were using a version of TEC pro that had two template files for the main page (ecp-page-template.php) and the single events-page (ecp-single-template.php). They had custom banners for the single events and a main banner for the main calendar page (Whats On). I guess this must be something to do with conditional wrappers but I am fairly amateur when it comes to code so could do with some help please. If I add any of the banner code below to the single-event.php page it doesn&#8217;t stretch to the full browser width. It just sits within the wrapper. Again if I add the banner code to the photo.php or month.php the banners sit within the fixed width of the wrappers.<\/p>\n<p>CODE THAT WAS ORIGINALLY IN ecp-page-template.php<br \/>\n&lt;?php<br \/>\n\/**<br \/>\n * Default Events Template<br \/>\n * This file is the basic wrapper template for all the views if &#8216;Default Events Template&#8217;<br \/>\n * is selected in Events -&gt; Settings -&gt; Template -&gt; Events Template.<br \/>\n *<br \/>\n * Override this template in your own theme by creating a file at [your-theme]\/tribe-events\/default-template.php<br \/>\n *<br \/>\n * @package TribeEventsCalendar<br \/>\n *<br \/>\n *\/<\/p>\n<p>if ( ! defined( &#8216;ABSPATH&#8217; ) ) {<br \/>\n\tdie( &#8216;-1&#8217; );<br \/>\n}<\/p>\n<p>get_header();<br \/>\n?&gt;<\/p>\n<p>&lt;section role=&#8221;main&#8221;&gt;<\/p>\n<p>\t&lt;div class=&#8221;heading-panel-full bg-memberblue&#8221;&gt;<br \/>\n\t\t&lt;div class=&#8221;inner&#8221;&gt;<br \/>\n\t\t\t&lt;div class=&#8221;heading-panel-text&#8221;&gt;<\/p>\n<h1>What&#8217;s on at the Guildford Institute<\/h1>\n<h2>Delve into our calendar to find something to spark your imagination<\/h2>\n<p>\t\t\t&lt;\/div&gt;<br \/>\n\t\t&lt;\/div&gt;<br \/>\n\t&lt;\/div&gt;&lt;?php \/\/.heading-panel-full ?&gt;<\/p>\n<p>&lt;div id=&#8221;tribe-events-pg-template&#8221;&gt;<br \/>\n\t&lt;?php tribe_events_before_html(); ?&gt;<br \/>\n\t&lt;?php tribe_get_view(); ?&gt;<br \/>\n\t&lt;?php tribe_events_after_html(); ?&gt;<br \/>\n&lt;\/div&gt; &lt;!&#8211; #tribe-events-pg-template &#8211;&gt;<br \/>\n&lt;?php<br \/>\nget_footer();<\/p>\n<p>CODE FOR CUSTOM BANNERS THAT WAS IN ecp-single-template.php.<\/p>\n<p>&lt;?php<br \/>\n\/**<br \/>\n*  If &#8216;Default Events Template&#8217; is selected in Settings -&gt; The Events Calendar -&gt; Theme Settings -&gt; Events Template,<br \/>\n*  then this file loads the page template for all for the individual<br \/>\n*  event view.  Generally, this setting should only be used if you want to manually<br \/>\n*  specify all the shell HTML of your ECP pages in this template file.  Use one of the other Theme<br \/>\n*  Settings -&gt; Events Template to automatically integrate views into your<br \/>\n*  theme.<br \/>\n*<br \/>\n* You can customize this view by putting a replacement file of the same name (ecp-single-template.php) in the events\/ directory of your theme.<br \/>\n*\/<\/p>\n<p>\/\/ Don&#8217;t load directly<br \/>\nif ( !defined(&#8216;ABSPATH&#8217;) ) { die(&#8216;-1&#8217;); }<br \/>\n?&gt;<br \/>\n&lt;?php get_header(); ?&gt;<br \/>\n&lt;?php the_post(); global $post; ?&gt;<\/p>\n<p>&lt;?php<br \/>\n\/\/Get Event Category to decide what colour banner to use<br \/>\n$terms = get_the_terms(get_the_ID(), TribeEvents::TAXONOMY);<\/p>\n<p>if ($terms) {<br \/>\n\tif (count($terms) &gt; 0) {<br \/>\n\t\t$category = array_shift($terms);<br \/>\n\t\t$thisCat = $category-&gt;name;<br \/>\n\t}<br \/>\n\t\/\/echo &#8216;<\/p>\n<h1>&#8216;.$thisCat.&#8217;<\/h1>\n<p>&#8216;;<br \/>\n\tif( $thisCat == &#8216;Talks&#8217; ){ $colorClass = &#8216;talk-event&#8217;; }<br \/>\n\telseif( $thisCat == &#8216;Visits&#8217; ){ $colorClass = &#8216;visit-event&#8217;; }<br \/>\n\telseif( $thisCat == &#8216;Clubs &amp; Societies&#8217; ){ $colorClass = &#8216;club-event&#8217;; }<br \/>\n\telseif( $thisCat == &#8216;Exhibitions&#8217; ){ $colorClass = &#8216;exhibit-event&#8217;; }<br \/>\n\telseif( $thisCat == &#8216;Special Events&#8217; ){ $colorClass = &#8216;special-event&#8217;; }<br \/>\n\telseif( $thisCat == &#8216;Music Recitals&#8217; ){ $colorClass = &#8216;musicrec-event&#8217;; }<br \/>\n\telse{ $colorClass = &#8216;libraryblue&#8217;; }<br \/>\n}else{<br \/>\n\t$colorClass = &#8216;libraryblue&#8217;;<br \/>\n}<br \/>\n?&gt;<\/p>\n<p>&lt;section role=&#8221;main&#8221; id=&#8221;post-&lt;?php the_ID(); ?&gt;&#8221; &lt;?php post_class(); ?&gt;&gt;<br \/>\n\t&lt;div class=&#8221;heading-panel bg-&lt;?php echo $colorClass; ?&gt;&#8221;&gt;<br \/>\n\t\t&lt;div class=&#8221;inner&#8221;&gt;<br \/>\n\t\t\t&lt;div class=&#8221;heading-panel-text&#8221;&gt;<\/p>\n<h1>&lt;?php the_title(); ?&gt;<\/h1>\n<h2>&lt;?php the_field(&#8216;sub_heading&#8217;); ?&gt;<\/h2>\n<p>\t\t\t&lt;\/div&gt;<br \/>\n\t\t&lt;\/div&gt;<br \/>\n\t\t&lt;?php<br \/>\n\t\t\/\/if this banner has an image<br \/>\n\t\tif( get_field(&#8216;banner_image&#8217;) ) {<br \/>\n\t\t?&gt;<br \/>\n\t\t\t&lt;div class=&#8221;overlay bg-&lt;?php echo $colorClass; ?&gt;-opaque&#8221;&gt;&lt;\/div&gt;<br \/>\n\t\t\t&lt;?php<br \/>\n\t\t\t\t\/\/Get banner image as a full size for background<br \/>\n\t\t\t\t$attachment_id = get_field(&#8216;banner_image&#8217;);<br \/>\n\t\t\t\t$size = &#8220;full&#8221;;<br \/>\n\t\t\t\t$image = wp_get_attachment_image_src( $attachment_id, $size );<br \/>\n\t\t\t?&gt;<br \/>\n\t\t\t&lt;div class=&#8221;heading-bg-img&#8221; style=&#8221;background-image: url(&#8216;&lt;?php echo $image[0] ; ?&gt;&#8217;)&#8221;&gt;&lt;\/div&gt;<br \/>\n\t\t&lt;?php } ?&gt;<br \/>\n\t&lt;\/div&gt;<\/p>\n<p>\t&lt;div class=&#8221;wrapper&#8221;&gt;<br \/>\n\t\t&lt;?php include(tribe_get_current_template()); ?&gt;<br \/>\n\t&lt;\/div&gt;&lt;?php \/\/.wrapper ?&gt;<\/p>\n<p>&lt;\/section&gt;<br \/>\n&lt;?php get_footer(); ?&gt;<\/p>\n","protected":false},"template":"","class_list":["post-1097548","topic","type-topic","status-closed","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.2 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Stop certain elements appearing on all views -<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/stop-certain-elements-appearing-on-all-views\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Stop certain elements appearing on all views -\" \/>\n<meta property=\"og:description\" content=\"I have been given the task of sorting out styling and functionality issues with a big upgrade from v2 to v4. I am trying to add a 100% browser full width banner on the main calendar page which works great if I add it to the default-page template in my theme folder but the previous [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/stop-certain-elements-appearing-on-all-views\/\" \/>\n<meta property=\"article:modified_time\" content=\"2016-04-22T16:35:04+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/stop-certain-elements-appearing-on-all-views\/\",\"url\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/stop-certain-elements-appearing-on-all-views\/\",\"name\":\"Stop certain elements appearing on all views -\",\"isPartOf\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/#website\"},\"datePublished\":\"2016-04-03T16:34:58+00:00\",\"dateModified\":\"2016-04-22T16:35:04+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/stop-certain-elements-appearing-on-all-views\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/stop-certain-elements-appearing-on-all-views\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/stop-certain-elements-appearing-on-all-views\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/theeventscalendar.com\/support\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Topics\",\"item\":\"https:\/\/theeventscalendar.com\/support\/topics\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Calendar Products\",\"item\":\"https:\/\/theeventscalendar.com\/support\/forums\/forum\/events\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Events Calendar PRO\",\"item\":\"https:\/\/theeventscalendar.com\/support\/forums\/forum\/events\/events-calendar-pro\/\"},{\"@type\":\"ListItem\",\"position\":5,\"name\":\"Stop certain elements appearing on all views\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/#website\",\"url\":\"https:\/\/theeventscalendar.com\/support\/\",\"name\":\"\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/theeventscalendar.com\/support\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Stop certain elements appearing on all views -","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/stop-certain-elements-appearing-on-all-views\/","og_locale":"en_US","og_type":"article","og_title":"Stop certain elements appearing on all views -","og_description":"I have been given the task of sorting out styling and functionality issues with a big upgrade from v2 to v4. I am trying to add a 100% browser full width banner on the main calendar page which works great if I add it to the default-page template in my theme folder but the previous [&hellip;]","og_url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/stop-certain-elements-appearing-on-all-views\/","article_modified_time":"2016-04-22T16:35:04+00:00","twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/stop-certain-elements-appearing-on-all-views\/","url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/stop-certain-elements-appearing-on-all-views\/","name":"Stop certain elements appearing on all views -","isPartOf":{"@id":"https:\/\/theeventscalendar.com\/support\/#website"},"datePublished":"2016-04-03T16:34:58+00:00","dateModified":"2016-04-22T16:35:04+00:00","breadcrumb":{"@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/stop-certain-elements-appearing-on-all-views\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/theeventscalendar.com\/support\/forums\/topic\/stop-certain-elements-appearing-on-all-views\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/stop-certain-elements-appearing-on-all-views\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/theeventscalendar.com\/support\/"},{"@type":"ListItem","position":2,"name":"Topics","item":"https:\/\/theeventscalendar.com\/support\/topics\/"},{"@type":"ListItem","position":3,"name":"Calendar Products","item":"https:\/\/theeventscalendar.com\/support\/forums\/forum\/events\/"},{"@type":"ListItem","position":4,"name":"Events Calendar PRO","item":"https:\/\/theeventscalendar.com\/support\/forums\/forum\/events\/events-calendar-pro\/"},{"@type":"ListItem","position":5,"name":"Stop certain elements appearing on all views"}]},{"@type":"WebSite","@id":"https:\/\/theeventscalendar.com\/support\/#website","url":"https:\/\/theeventscalendar.com\/support\/","name":"","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/theeventscalendar.com\/support\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"}]}},"_links":{"self":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic\/1097548","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":2,"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic\/1097548\/revisions"}],"predecessor-version":[{"id":1099767,"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic\/1097548\/revisions\/1099767"}],"wp:attachment":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/media?parent=1097548"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}