Peter

Forum Replies Created

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • Peter
    Participant

    Hi Courtney,

    I found the problem – No anchor tag around the relevant $website variable in details.php in my custom theme folder.

    I had asked my developer a while back to move the event details and registration to underneath the featured image of any event post. He had created copies of the relevant tribe files in my theme folder. I troubleshot whether it was these custom files by renaming the custom tribe-event folder and refreshing the page. I found out that the website links now worked. I renamed the folder back, and I searched this [custom-theme-name]/tribe-event folder for
    <dd class="tribe-events-url"
    And I found it inside of tribe-event/modules/meta/details.php

    Originally, it was written as <dd class="tribe-events-event-url"><?php echo $website; ?></dd>so it echoed the website variable, but didn’t wrap it in a tag.

    So, I added an anchor tag (and set the href argument to echo the $website variable again) around the <?php echo $website; ?> so it looks like this.
    <dd class="tribe-events-event-url"><a href="<?php echo $website?>">><?php echo $website?></a></dd>;

    Added this info in case any other beginners have a similar problem.

    • This reply was modified 6 years, 7 months ago by Peter. Reason: Formatting was off
    Peter
    Participant

    Hi Courtney,
    Now that the demo page is working today, I see that “website” should provide a link. I will investigate, thank you.

    in reply to: Mark a "featured event" at the top of the List view? #995914
    Peter
    Participant

    Hi guys (George),

    Haha! I did it. It works. But, man oh MAN is it a hack. For others seeking a solution, I have posted below the main file that I used, list/loop.php. I have documented in the code what I did. Thank you for helping write the array to pull the featured category posts. That was very helpful.

    But I would like to figure out how to push the array into the list/single-event.php template. Because, at this point, I am just copying and pasting the code from single-event.php into list/loop.php. Which seems very redundant, right?

    For others (as well as to help you guys out), these were my steps.

    1. copied the view files list.php, list/loop.php, list/single-event.php, and list/content.php to my theme folder
    2. I started under the line “<div class=”tribe-events-loop vcalendar”>” (currently line 21)
    3. added a h2 “Featured Events” and added the right classes for styling purposes.
    4. setup the array that contains all events with the category “Featured”
    5. created a ul
    6. added the foreach loop so that it would post each of these featured events
    7. added a li with inline style none (which is very important for separating the events
    8. nearly copied and pasted the template of list/single-event.php, including title, metadata, venue, cost, thumbnail, excerpt, and content if there is no thumbnail.
    9. closed off the li
    10. closed off the for loop.
    11. fawlty04’s post on this board suggested using a wp_reset_query in his code. I started using his last bit of code for this project. I don’t know if the wp_reset_query is totally needed, but I haven’t had the guts to delete it yet.
    12. I closed off the ul
    13. The real magic: to move the title “Upcoming Events” below the “Featured Events” section that we have created, you have to remove three lines of code from list/content.php and paste it below my code in list/loop.php.
    14. and that is it. Not pretty. but it works. I have tried to do the following to jam the array into the list/single-event template this way:

      	  $events = tribe_get_events( array(
      	  'posts_per_page'   => 5,
      	  'start_date'       => new DateTime(),
      	  'tribe_events_cat' => 'featured'
      	) );
      
      	//The FOR LOOP to go through each item in teh array. , takes your $events variable and runs it as a $post
      	foreach($events as $post) {
      	setup_postdata($post);
      	?>
      		<!-- Month / Year Headers -->
      		<?php tribe_events_list_the_date_headers(); ?>
      
      		<!-- Event  -->
      		<?php
      		$post_parent = '';
      		if ( $post->post_parent ) {
      			$post_parent = ' data-parent-post-id="' . absint( $post->post_parent ) . '"';
      		}
      		?>
      		<div id="post-<?php the_ID() ?>" class="<?php tribe_events_event_classes() ?>" <?php echo $post_parent; ?>>
      			<?php tribe_get_template_part( 'list/single', 'event' ) ?>
      		</div><!-- .hentry .vevent -->
      
      } //end for loop.
      		<?php do_action( 'tribe_events_inside_after_loop' ); ?>

      But that OBVIOUSLY doesn’t work. My brain is fried, and my eyes are criss-crossing. So, any additional guidance you can give me for that would be lovely.

      Thanks a million!

      Here is my list/loop.php file:

      `<?php
      /**
      * List View Loop
      * This file sets up the structure for the list loop
      *
      * Override this template in your own theme by creating a file at [your-theme]/tribe-events/list/loop.php
      *
      * @package TribeEventsCalendar
      *
      */

      if ( ! defined( ‘ABSPATH’ ) ) {
      die( ‘-1’ );
      } ?>

      <?php
      global $post;
      global $more;
      $more = false;
      ?>
      <div class=”tribe-events-loop vcalendar”>
      <?php
      //FEATURED EVENT Section, this is always above the list of events in LIST VIEW. If you add the category “Featured” to an event, it will show up in the following list.
      // These are the parts to look out for:
      // 1) the h2,
      // 2) Setting up the featured events array
      // 3) Setting up the foreach loop.
      // 4) Pretty much stealing all of the code from the “list/single-event.php” template. Okay, so this is really just a hack.
      // 5) Take the “List-title” code from list/content.php (line18) and place it underneath the hack code so that “Upcoming Events” is still listed.–>
      ?>
      <h2 class=”tribe-events-page-title”>Featured events</h2>

        <?php
        //SETS UP FEATURED EVENTS ARRAY
        $events = tribe_get_events( array(
        ‘posts_per_page’ => 5,
        ‘start_date’ => new DateTime(),
        ‘tribe_events_cat’ => ‘featured’
        ) );

        //The FOR LOOP to go through each item in the array. , takes your $events variable and runs it as a $post
        foreach($events as $post) {
        setup_postdata($post);
        ?>
        <li style=”list-style-type: none”;>
        <div id=”post-<?php the_ID() ?>” class=”<?php tribe_events_event_classes() ?>”>
        <!– Featured Event Cost –>
        <?php if ( tribe_get_cost() ) : ?>
        <div class=”tribe-events-event-cost”>
        <span><?php echo tribe_get_cost( null, true ); ?></span>
        </div>
        <?php endif; ?>

        <!– Featured Event Title –>
        <?php do_action( ‘tribe_events_before_the_event_title’ ) ?>
        <h2 class=”tribe-events-list-event-title entry-title summary”>
        ” title=”<?php the_title() ?>” rel=”bookmark”>
        <?php the_title() ?>

        </h2>

        <div class=”tribe-events-event-meta vcard”>
        <div class=”author <?php echo esc_attr( $has_venue_address ); ?>”>

        <!– Schedule & Recurrence Details –>
        <div class=”updated published time-details”>
        <?php echo tribe_events_event_schedule_details() ?>
        </div>

        <?php if ( $venue_details ) : ?>
        <!– Featured Venue Display Info –>
        <div class=”tribe-events-venue-details”>
        <?php echo implode( ‘, ‘, $venue_details ); ?>
        </div> <!– .tribe-events-venue-details –>
        <?php endif; ?>

        </div>
        </div>
        <?php if ( has_post_thumbnail() ) { ?>

        <?php do_action( ‘tribe_events_after_the_meta’ ) ?>

        <!– Featured Event Image –>
        <?php echo tribe_event_featured_image( null, ‘medium’ ) ?>

        <!– Featured Event Content –>
        <?php do_action( ‘tribe_events_before_the_content’ ) ?>
        <div class=”tribe-events-list-event-description tribe-events-content description entry-summary”>
        <?php the_excerpt() ?>
        ” class=”tribe-events-read-more” rel=”bookmark”><?php esc_html_e( ‘Find out more’, ‘tribe-events-calendar’ ) ?> »
        </div><!– .tribe-events-list-event-description –>

        <?php } else { ?>

        <div class=”event-content”>
        <?php the_content(); ?>
        </div>

        <?php } ?>
        </div>

        <?php } //endforeach ?>
        <?php wp_reset_query(); ?>

      <br>
      <br>
      <?php
      //The title for “Upcoming Events”. The following three lines were removed from list/content.php, line 18.
      do_action( ‘tribe_events_before_the_title’ ); ?>
      <h2 class=”tribe-events-page-title”><?php echo tribe_get_events_title() ?></h2>
      <?php do_action( ‘tribe_events_after_the_title’ ); ?>
      <!–We are done. Back to the normal loop.php file.–>

      <?php while ( have_posts() ) : the_post(); ?>
      <?php do_action( ‘tribe_events_inside_before_loop’ ); ?>

      <!– Month / Year Headers –>
      <?php tribe_events_list_the_date_headers(); ?>

      <!– Event –>
      <?php
      $post_parent = ”;
      if ( $post->post_parent ) {
      $post_parent = ‘ data-parent-post-id=”‘ . absint( $post->post_parent ) . ‘”‘;
      }
      ?>
      <div id=”post-<?php the_ID() ?>” class=”<?php tribe_events_event_classes() ?>” <?php echo $post_parent; ?>>
      <?php tribe_get_template_part( ‘list/single’, ‘event’ ) ?>
      </div><!– .hentry .vevent –>

      <?php do_action( ‘tribe_events_inside_after_loop’ ); ?>
      <?php endwhile; ?>

      </div><!– .tribe-events-loop –>’

    in reply to: Mark a "featured event" at the top of the List view? #994345
    Peter
    Participant

    Hi George,

    Yes, I would like an opportunity to try my fledgling skills on this. I would need to know such things as:
    1) What do I use (Tags, category, etc?) to mark that the event is “featured”
    2) Which filters do I use to find the featured event post, and which action gets it sorted to the top of the list view?
    3) Which plugin files need to be made custom (by dragging a copy into my “wp-content/themes/my-custom-theme” folder) in case I need to modify them (rather than just the custom theme’s functions.php file).

    But that would be exciting, please shoot me whatever documents and tutorials that you can think of to help me achieve this. Thank you.

    in reply to: Two Cart Totals underneath main cart table in 3.11? #990300
    Peter
    Participant

    Hi George,

    I do have a healthy sized functions.php file in my child theme folder. Plus a set of other plugins.

    Your idea did fix the problem, so a huge thank you. I will check to see what is causing these problems. Thanks.

    Peter
    Participant

    Hi Geoff,

    Yes, I see that it is resolved on my end as well. This was just really strange. I saw that the other case was closed when this same issue resolved itself, so I assumed it was an issue with my browser cache. So I closed the tabs and cleared it out in Chrome “until the beginning of time”. It was still not showing. I then tried it on 3 different browsers (Firefox, Safari, and mobile Safari), and none of them showed the tickets section under the map. I am pretty sure that I exhausted this being a “cache” issue.

    Although, this morning, after I got your emails and rechecked the website, all my images were gone. Geoff, I don’t know if you noticed broken image links when you checked, but I immediately found a new .htaccess file in my uploads folder. Renaming that fixed the image issues. Is there ANY possibility that the automagick resolution of the tickets section and the new .htaccess file being generated as being related?

    And sorry, Torsten, that I can’t be of more help. I have always been able to view and change all of the ticket options in the admin panel. Good luck though.

Viewing 6 posts - 1 through 6 (of 6 total)