Forum Replies Created

Viewing 12 replies - 1 through 12 (of 12 total)
  • Thread Starter skyfox2k

    (@skyfox2k)

    Gotcha.

    Using your (really gracious) help didn’t solve the issue entirely, but I discovered the problem:

    TAGS are only showing for PAGES that are *not* CHILDREN of another PAGE. As soon as you add a PARENT PAGE, the CHILD PAGE no longer is displayed by your plugin.

    Perhaps it’s an issue outside of you plugin, I don’t know.

    Thread Starter skyfox2k

    (@skyfox2k)

    The original issue extends to categories too, as with a PAGE category set to: “name”, when I have
    category="name" post_type="post"
    it will only show POSTS with the category “name”.

    Thoughts?

    Thread Starter skyfox2k

    (@skyfox2k)

    Actually, it was updating to your latest code that worked!

    BUT!

    It’s introduced a new bug in that tags are no longer working!

    I’m using tags on pages with this code:

    // add tag and category support to pages
    function tags_categories_support_all() {
      register_taxonomy_for_object_type('post_tag', 'page');
      register_taxonomy_for_object_type('category', 'page');
    }
    
    // ensure all tags and categories are included in queries
    function tags_categories_support_query($wp_query) {
      if ($wp_query->get('tag')) $wp_query->set('post_type', 'any');
      if ($wp_query->get('category_name')) $wp_query->set('post_type', 'any');
    }
    
    // tag and category hooks
    add_action('init', 'tags_categories_support_all');
    add_action('pre_get_posts', 'tags_categories_support_query');

    This was working fine with version 2.9 of the code, but your 2.9.1 that fixes the pages issue, introduces this problem…

    • This reply was modified 7 years, 4 months ago by skyfox2k.
    Thread Starter skyfox2k

    (@skyfox2k)

    It also reckon you could minify the Javascript further, but I think thats a pretty petty thing google wants as it would only save a whole 1kb!

    Thread Starter skyfox2k

    (@skyfox2k)

    Well if you run my site in google page speed insights, you’ll see!

    I get:

    Eliminate render-blocking JavaScript and CSS in above-the-fold content
    Your page has 1 blocking CSS resources. This causes a delay in rendering your page.
    Approximately 5% of the above-the-fold content on your page could be rendered without waiting for the following resources to load. Try to defer or asynchronously load blocking resources, or inline the critical portions of those resources directly in the HTML.
    Optimize CSS Delivery of the following:
    http://www.skyfoxdesign.com/wp/wp-content/cache/autoptimize/css/autoptimize_bee43246710581674b255a9850fd77ee.css

    Thread Starter skyfox2k

    (@skyfox2k)

    Yes, activated, latest versions of everything, no alert messages, but I do get the clean up utilities if I deactivate TEC. Latest wordpress 3.9.1

    Tried with default theme. I am running locally.

    I have the same trouble, I have TEC Pro, and can’t make the shortcode display on the homepage at all, I just get the [event_embed event=”test-1″] text.

    Infuriating!!

    Thread Starter skyfox2k

    (@skyfox2k)

    Yes this is set to only show when a category is selected already. otherwise you are already looking at all the results!

    Could you show me an example of your problem?- I cant replicate it :/

    Thread Starter skyfox2k

    (@skyfox2k)

    This should fix any issues with empty searches losing the selected view.

    <div id="legend_box" class="tribe-events-calendar">
    
        <ul id="legend">
            <?php foreach ( $teccc->terms as $id => $attributes ): ?>
                <?php
    				$slug = esc_attr($attributes[Tribe_Events_Category_Colors::SLUG]);
    				$name = esc_attr($attributes[Tribe_Events_Category_Colors::NAME]);
    				$link = get_term_link($id, TribeEvents::TAXONOMY);
                ?>
                <li class="tribe-events-category-<?php echo $slug ?> tribe-events-category-<?php esc_attr_e($id) ?>">
                    <a href="
    					<?php
    						$prevPageView = $_SERVER['HTTP_REFERER'];
    						preg_match("/(map|month|upcoming|week|day|photo|week)/", $prevPageView, $matches);
    						if( tribe_is_map()) {
    							echo $link, "map";}
    						else if( tribe_is_month()) {
    							echo $link, "month";}
    						else if( tribe_is_upcoming()) {
    							echo $link, "upcoming";}
    						else if( tribe_is_week()) {
    							echo $link, "week";}
    						else if( tribe_is_day()) {
    							echo $link, "day";}
    						else if( tribe_is_photo()) {
    							echo $link, "photo";}
    						else if( tribe_is_venue()) {
    							echo $link, "venue";}
    						else
    							echo $link .$matches[0];
    					?>
    				">
                    	<?php echo $name ?>
                    </a>
                    <input type="hidden" value="<?php echo $slug ?>" />
                </li>
    
            <?php endforeach;?>
    
        </ul>
    
    </div>
    Thread Starter skyfox2k

    (@skyfox2k)

    Ah, it might if your categories are one word with no special symbols…

    Thread Starter skyfox2k

    (@skyfox2k)

    Just a quick update, have now made it check for other strings in the map view (for pro users).

    This works perfectly with the map view now:

    teccc_add_legend_view( 'upcoming' );
    teccc_add_legend_view( 'map' );
    teccc_add_legend_view( 'past' );
    teccc_reposition_legend('tribe_events_before_the_title');
    
    add_filter('teccc_legend_html', 'add_legend_explanation');
    
    function add_legend_explanation($html) {
        echo $html;
    ?>
    <script type="text/javascript">
    	function removeCategory(clicked){
    		var str = window.location.href;
    		var re = /(category\/\w+\/)|(\&tribe_event_category=\w+)/g;
    		var newstr = str.replace(re, "");
    		window.location.assign(newstr);
    	};
    	function moveLink(){
    		var d = $.Deferred();
    		setTimeout(function() {
    		$( "#legend" ).prepend( $( "#showAll" ) );
    		d.resolve();
      		});
    		return d.promise();
    	};
    
    	moveLink();
    </script>
    
    <?php
    	if (is_tax()) {
    		echo
    		'<a id="showAll" title="Click to show all training" onclick="removeCategory();">Show All</a>';
    	};
    ?>
    <?php
    }
    Thread Starter skyfox2k

    (@skyfox2k)

    Just made it a little better:

    Now the ‘show all’ button gets appended to the start of the legend.

    add_filter('teccc_legend_html', 'add_legend_explanation');
    
    function add_legend_explanation($html) {
        echo $html;
    ?>
    <script type="text/javascript">
    	function removeCategory(clicked){
    		var str = window.location.href;
    		var re = /category\/\w+/gi;
    		var newstr = str.replace(re, "");
    		window.location.assign(newstr);
    	};
    	function moveLink(){
    		var d = $.Deferred();
    		setTimeout(function() {
    		$( "#legend" ).prepend( $( "#showAll" ) );
    		d.resolve();
      		});
    		return d.promise();
    	};
    	moveLink();
    </script>
    
    <?php
    	if (is_tax()) {
    		echo
    		'<a id="showAll" title="Click to show all training" onclick="removeCategory();" style="background-color: #d9e2ea; padding: 7px; cursor:"pointer";">Show All</a>';
    	};
    ?>
    <?php
    }
Viewing 12 replies - 1 through 12 (of 12 total)