Forum Replies Created
-
AuthorPosts
-
Tony
ParticipantThis does not work. I get this error –
Tony
ParticipantTrue this is NOT a template override file. This is a custom template that I have made based of my page.php.
True this file only loads for pages using this as its template.
False, there is no sidebar, it just comes through as part of the content.
I have tried has_term(); and it still does not work.I simply started an events loop like this –
<?php $events = tribe_get_events( array( 'posts_per_page' => 6, 'start_date' => date( 'F j, Y' ), )); if ( empty( $events ) ) { echo 'Sorry, there are no upcoming events at this time.'; } else foreach( $events as $event ) { ?>And then I threw in a simple conditional using your recommendation like this.
<?php $tecmain = Tribe__Events__Main::instance(); ?> <?php if(is_tax($tecmain::TAXONOMY, 22)) { ?> <p>C&P</p> <?php } elseif(is_tax($tecmain::TAXONOMY, 23)) { ?> <p>Fundraising</p> <?php } elseif(is_tax($tecmain::TAXONOMY, 24)) { ?> <p>Educational</p> <?php } else { ?> <img class="cat-icon" src="/wp-content/uploads/2017/11/Heart.png" /> <?php } ?>This loop clearly works on my end because directly below this I display the title and event start time like this which comes through just fine –
<?php $title = get_the_title($event); ?> <?php if (strlen($title) > 30) { ?> <?php echo mb_strimwidth($title, 0, 30, '...'); ?> <?php } else { ?> <?php echo $title ?> <?php }?>Any ideas as to why this isn’t working?
Tony
ParticipantCould it not be coming through because these events have two categories associated with them?
Tony
ParticipantThis reply is private.
Tony
ParticipantAnd just to be clear I tried the slug and nicename as well.
Tony
ParticipantThis still does not work for me. Is this the implementation you would use here?
<?php $tecmain = Tribe__Events__Main::instance(); ?> <?php if(is_tax($tecmain::TAXONOMY, 22)) { ?> <p>C&P</p> <?php } elseif(is_tax($tecmain::TAXONOMY, 23)) { ?> <p>Fundraising</p> <?php } elseif(is_tax($tecmain::TAXONOMY, 24)) { ?> <p>Educational</p> <?php } else { ?> <img class="cat-icon" src="/wp-content/uploads/2017/11/Heart.png" /> <?php } ?>Tony
ParticipantAnyone there? Trying to push this site live ASAP. Thanks.
-
AuthorPosts
