thomas

Forum Replies Created

Viewing 15 posts - 1 through 15 (of 25 total)
  • Author
    Posts
  • in reply to: highlight current categories in sidebar #1008154
    thomas
    Participant

    he geoff,

    i checked some links and now i have this:

    if( here has to be the right code snippet ) {$termclass = "current-cat";}
    echo '<li class="'. $termclass .'"><a href="'. get_term_link($term->slug, 'tribe_events_cat') .'" >' . $term->name . '</a></li>';

    i just need to check if the current category is viewed to put a “current-cat” class to the li.
    but i don’t know how? anyway the class works …
    thomas

    • This reply was modified 8 years, 7 months ago by thomas.
    • This reply was modified 8 years, 7 months ago by thomas.
    in reply to: use dates of events as dropdown in contactform7 #970866
    thomas
    Participant

    hey brook,

    i found out that you can activate shortcodes in contactform7 with this in your function.php
    add_filter( 'wpcf7_form_elements', 'do_shortcode' );

    all i need is to write a shortcode that does the following things:
    – get the dates (i allready achieved this part)
    – wrap them in the form of the select field (this is where i need help)

    in reply to: use dates of events as dropdown in contactform7 #969806
    thomas
    Participant

    hey brook,

    yes of course! as you can read in the first post i’d like to have those dates included in a contactform7 form as a select dropdown menu. how can i send the dates from the query to the contactform.

    [select menu-dropdown "date1" "date2" "date3"]

    regards
    thomas

    thomas
    Participant

    okay i was thinking this is more easy. well i won’t do it then i allready ran far off from the original scope and my client will never understand to pay extra for little more comfort.
    all my best
    thomas

    in reply to: display event categories in sidebar #969680
    thomas
    Participant

    this is working fine and lets me sort the categories with the simple custom post type plugin:

    <?php  $terms = get_terms( TribeEvents::TAXONOMY, array( 'orderby' => 'menu_order' ) );
    foreach ( $terms as $term ) {
    echo '<li><a href="'. get_term_link($term->slug, 'tribe_events_cat') .'" >' . $term->name . '</a></li>';
    }?>
    in reply to: use dates of events as dropdown in contactform7 #969656
    thomas
    Participant

    hey brook,

    so far i got:

    <?php query_posts(array(
    'post_type' => 'tribe_events',
    'order'     => 'ASC',
    'tag'       => basename( get_permalink() )
    ));
    while (have_posts()) : the_post(); $event = get_post();
    echo "<br>";
    echo tribe_get_start_date( $event, $displayTime = false, $dateFormat = "l, j. F Y" );
    if ( -1 == $event->menu_order ) { echo " - bereits ausgebucht"; };
    endwhile; wp_reset_query(); ?>

    which checks if the tag of an event post is the same like the slug of the blog post.
    i tried some stuff with the post title but i got no success at all…

    thomas
    Participant

    my try is to use the search function in the query, because i read that by default the post title gets searched as well. somehow this is not working at all:

    <?php query_posts(array(
    'post_type' => 'tribe_events',
    'order'     => 'ASC',
    's'         => 'Das kleine Wein ABC'
    ));

    maybe you got something that solves the last issue here…

    thomas
    Participant

    hey george, i googled around and come up with this:

    <?php query_posts(array(
    'post_type' => 'tribe_events',
    'order'     => 'ASC',
    'tag'       => basename( get_permalink() )
    ));
    while (have_posts()) : the_post(); $event = get_post();
    echo "<br>";
    echo tribe_get_start_date( $event, $displayTime = false, $dateFormat = "l, j. F Y" );
    if ( -1 == $event->menu_order ) { echo " - bereits ausgebucht"; };
    endwhile; wp_reset_query(); ?>

    works quite well. only thing is i cannot search the post title – this seems to be a huge lack in wordpress itself. is there a workaround or solution for this?

    thomas
    Participant

    hey nico, i am very sorry.
    i just found out that this is conflicting with the nsp post types order plugin.
    i switched to the simple custom post order plugin which also lets me sort events categories.
    i exclude the event posts and everything is working well.

    the stickyness does not effect the query any longer.
    thanks

    thomas
    Participant

    hey george,

    since the exclusion of the event tribes order in the plugin is only available in advanced version i switched to another plugin.

    simple post types order
    there i can include and excludes posts, categories…
    everything is working fine!

    thomas
    Participant

    george, i just found out that the “post types order” plugin from nsp code interfeared with the events query.
    i unchecked “admin sort” and “automatic sort” and the dates are shown in ascending order no matter what i checked.
    the thing is i need to order the posts and will see if there is a way to exclude event tribe posts from the plugin.
    maybe you know it and allready have a solution…

    thomas
    Participant

    excactly!

    thomas
    Participant

    hey george, okay i understand your point.
    is there a way i can read the tag of an event.

    this would be working too:
    get all events that have the tag “wein-tante”
    thanks and regards

    thomas
    Participant

    hey george,

    thanks for this great hint, the functions.php entry didn’t work, however i ended up with this snippet in my dates.php which is working quite good:

    <?php
    $event = get_post( $event_id );
    echo "<br>";
    echo tribe_get_start_date( $event, $displayTime = false, $dateFormat = "l, j. F Y" );
    if ( -1 == $event->menu_order ) { echo " - fully booked"; }
    ?>

    only the issue with the menu_order is still there. once checked the date will stay on top no matter how many times i uncheck the “sticky in calendar view” option of an event. actually i don’t need the stickyness at all (i like to have an ascending order for the dates all the time).
    best regards
    thomas

    thomas
    Participant

    hi right now i hitting into the right direction, i guess.

    i use a custom template to display events now: tribe-events/dates.php

    <?php
    echo "<br>";
    echo tribe_get_start_date( $event = null, $displayTime = false );
    if ( $EventShowInCalendar=="yes" ) echo 'fully booked';
    ?>

    somehow this is not working
    regards

Viewing 15 posts - 1 through 15 (of 25 total)