nccrp

Forum Replies Created

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • in reply to: Hide category from filterbar #1007746
    nccrp
    Participant

    Hi George

    Thanks for your example about more than one category, I modified this with an additional array and this works for me! Here ist the code (with the same categories fom your example):

    add_filter( 'tribe_events_filter_values',  'demo_events_filter_values' );
     
    function demo_events_filter_values( $values ) {
    	foreach ( $values as $key => $value ) {
    		if ( isset( $value['data']['slug'] ) ) {
    			$categories = array('internal', 'private', 'administrative'); 
    			foreach ($categories as $category) {
    				if ( $category == $value['data']['slug'] ) {
    					unset( $values[ $key ] );
    					$values = array_values( $values );
    				}
    			}		
    		}
    	}
    return $values;
    }
     
    add_action( 'wp_footer', 'demo_wp_footer' );
     
    function demo_wp_footer() {
    ?>
        <script>jQuery( 'select[name="tribe_eventcategory"]' ).removeAttr( 'disabled' );</script>
    <?php
    }

    Many thanks for your spendet time in this, now i have a perfect solution.

    Best Regards, Ueli

    in reply to: Hide category from filterbar #1007387
    nccrp
    Participant

    Hi George

    Thanks! it works perfect! Great!

    One little question about this code, is it possible to modified it for more than one category to hide? I have try to customize your code, but with no success.

    Thanks for your phenomenal support!

    Regards, Ueli

    in reply to: Hide category from filterbar #1006935
    nccrp
    Participant

    Hi George

    Thanks for you help, but this works only in Firefox ans Chrome. In IE and Safari i can still see the “internal” category after insert your code in the style.css from the theme.

    Regards, Ueli

    in reply to: Hide category from filterbar #1005861
    nccrp
    Participant

    Hi George

    Yes, i have deactivated the filterbar on the website. Now i have temporaly activated and without my .css code, then you can see the category “Internal” on the Eventpage.

    Thanks for your help.
    Regards, Ueli

    in reply to: Hide category from filterbar #1005163
    nccrp
    Participant

    Hi George

    I would like to exclude the category named “Internal” from the filterbar, this category are only for registred (logged-in) members and i listed this separatly under internal page in the sidebar with the widget “Events List”. For your information, in the meantime I also find the code who list the categories (protected function get_values() in Category.php und src/Tribe/).

    Thanks for your support.
    Regards, Ulrich

    in reply to: Hide category from filterbar #1004742
    nccrp
    Participant

    Hi George

    I have already set the following .css code in my custom css from the theme:

    /* The Event Calandar – Hide Category from filter */
    option[data-slug=’internal’], option[value=’220′] {
    display: none;
    visibility: hidden;
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute; top: -9999px; left: -9999px;
    backface-visibility: hidden;
    }

    But he works not in every different browser:
    IE no
    Safari no
    Chrome yes
    Firefox yes

    I think, I must customization this directly in the .php file code, or have you an another great idea? I realy need this feature an i hope you can help me.

    Thanks for your support.
    Regards, Ulrich

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