Mark

Forum Replies Created

Viewing 15 posts - 1 through 15 (of 15 total)
  • Author
    Posts
  • in reply to: Disabling plugin – trouble turning Calendar Pro off #1299535
    Mark
    Participant

    OK thanks I will look at this suggestion.

    Re your first point what I did was add something to functions.php which
    added regular categories to events – that was so the events would show up
    in my regular category pages. As mentioned that has all been working fine
    with the plugin turned on.

    I will take another look at this again and let you know if I have any
    other problems. Thanks for your time in thinking about this one. You can
    close this thread.

    Thanks again,

    PS – is there a way to change my user name on the support forum?

    in reply to: New domain #1296970
    Mark
    Participant

    Yes sure – sorry I forgot

    in reply to: New domain #1295973
    Mark
    Participant

    Actually it’s all looking good my end too now. I am not sure what the issue was. Maybe browser caching immediately after I tried to change the licence over? It’s all looking fine now thanks.

    Actually I am having a problem turning the plugin off. We are not using it at the moment because our public course programme has finished.

    When I had the plugin running what I did was add categories to events so that they all showed up e.g. on a category pages like his one https://www.financialmodellingtraining.co.uk/category/valuation/. That all seemed to work well.
    You can see the links to the old events there although I have set up a redirect which works fine. Here is an example event on that page https://www.financialmodellingtraining.co.uk/course/valuation-modelling-masterclass-sep-5-days/ which redirects just fine.

    The problem happens when I turn the plugin off. The old events still stay listed e.g. at https://www.financialmodellingtraining.co.uk/category/valuation/. That’s fine, I don’t mind that. I guess they’re there because they still exist as custom posts in the system. But the problem is, after you’ve turned the plugin off, something like https://www.financialmodellingtraining.co.uk/course/valuation-modelling-masterclass-sep-5-days/ stops redirecting which is really strange. This is the problem and it means I can’t turn the plugin off.

    Do you have any idea what might be causing this? Should I just fiddle with my redirects? It seems bizarre that they would work with the plugin turned on but not with the plugin turned off. Is it all to do with the slug I use for events (which disappears with the plugin off)? I really have no idea about this.

    Is it worth asking you to have a quick look at my child theme functions file because I’m no expert and I added a few things there on the internet’s advice and I am no expert.

    Thanks for thinking about this! I just want to be able to turn the plugin off when we are not using it and right now I’m kind of stuck with it forever.

    Thanks,

    in reply to: Disabling the plugin brings down my site #1287180
    Mark
    Participant

    Thanks Cliff,

    I thought I had marked this as “solved” because it is now!

    As soon as I took that code out of my functions.php I could disable the
    plugin.

    So all is good thanks!

    Thanks for your help on this…

    in reply to: Disabling the plugin brings down my site #1286313
    Mark
    Participant

    Here is the code that needed to be removed from my child functions.php. Once I took this out I could disable the Calendar plugin safely (it no longer brought down my site)

    /* Below here added 15Dec16 as per code at https://theeventscalendar.com/knowledgebase/fast-forward-list-widget-to-next-upcoming-event/ */
    /**
     * Plugin name: The Events Calendar: Advance Mini Calendar Widget
     * Description: Tries to force the minicalendar widget to show the month of the next upcoming event by default, rather than simply showing the current month (which might be empty).
     * Author:      Modern Tribe, Inc
     * Author URI:  http://theeventscalendar.com
     * Version:     1.0
     * License:     GPL v3 - see http://www.gnu.org/licenses/gpl.html
     *
     * The Events Calendar: Advance Mini Calendar Widget
     * Copyright (C) 2016 Modern Tribe, Inc
     *
     * This program is free software: you can redistribute it and/or modify
     * it under the terms of the GNU General Public License as published by
     * the Free Software Foundation, either version 3 of the License, or
     * (at your option) any later version.
     *
     * This program is distributed in the hope that it will be useful,
     * but WITHOUT ANY WARRANTY; without even the implied warranty of
     * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     * GNU General Public License for more details.
     *
     * You should have received a copy of the GNU General Public License
     * along with this program.  If not, see <http://www.gnu.org/licenses/>.
     */
    
    class Tribe_Advance_Minical {
    
    	protected $target_date = false;
    
    	/**
    	 * Sets up auto advance for minicalendar widgets. If an optional target date is provided that will be used to
    	 * set the month.
    	 *
    	 * @param bool $target_date
    	 */
    	public function __construct( $target_date = false ) {
    		
    		if ( is_admin() )
    			return;
    		
    		$this->target_date = $target_date;
    		
    		add_action( 'wp_loaded', array( $this, 'set_target_date' ) );
    		add_filter( 'widget_display_callback', array( $this, 'advance_minical' ), 20, 2 );
    	}
    
    	/**
    	 * Basic check to help filter out spurious date formats or automatically determine
    	 * the next most appropriate date to use.
    	 */
    	public function set_target_date() {
    
    		if ( ! is_string($this->target_date) || 1 !== preg_match( '#^\d{4}-\d{2}(-\d{2})?$# ', $this->target_date ) )
    			$this->target_date = $this->next_upcoming_date();
    	}
    
    	public function advance_minical( $instance, $widget ) {
    		
    		if ( 'tribe-mini-calendar' !== $widget->id_base || isset( $instance['eventDate'] ) )
    			return $instance;
    		
    		if ( date( 'Y-m' ) === $this->target_date )
    			return;
    		
    		add_action( 'tribe_before_get_template_part', array( $this, 'modify_list_query' ), 5 );
    		
    		$instance['eventDate'] = $this->target_date;
    		
    		return $instance;
    	}
    
    	public function modify_list_query( $template ) {
    
    		if ( false === strpos( $template, 'mini-calendar/list.php' ) )
    			return;
    		
    		add_action( 'parse_query', array( $this, 'amend_list_query' ) );
    	}
    
    	public function amend_list_query( $query ) {
    
    		// Run this once only.
    		remove_action( 'parse_query', array( $this, 'amend_list_query' ) );
    		
    		$the_query = $query->query_vars;
    
    		$the_query['start_date'] = $this->target_date . '-01';
    		$last_day = Tribe__Date_Utils::get_last_day_of_month( strtotime( $the_query['start_date'] ) );
    		$the_query['end_date'] = substr_replace( $the_query['start_date'], $last_day, -2 );
    		$the_query['end_date'] = tribe_end_of_day( $the_query['end_date'] );
    
    		$query->query_vars = $the_query;
    	}
    
    	protected function next_upcoming_date() {
    		$next_event = tribe_get_events( array(
    			'eventDisplay'   => 'list',
    			'posts_per_page' => 1,
    			'start_date'     => date( 'Y-m-d' )
    		));
    
    		$start_date = date( 'Y-m' );
    
    		if ( !empty( $next_event ) || isset( $next_event[0] ) ) {
    			$next_event_date = tribe_get_start_date( $next_event[0]->ID, false, 'Y-m' );
    
    			// Prevent calendar from rewinding to the start of a currently ongoing event
    			$start_date = ( $next_event_date > $start_date ) ? $next_event_date : $start_date;
    		}
    
    		return $start_date;
    	}
    }
    
    // Brings the mini calendar to the next month with events.
    new Tribe_Advance_Minical();
    /* Above here added 15Dec16 as per code at https://theeventscalendar.com/knowledgebase/fast-forward-list-widget-to-next-upcoming-event/ */
    
    /* Below here added 15Dec16 as per https://theeventscalendar.com/knowledgebase/make-links-event-go-straight-event-website/ */
    /*
     * This changes the event link to the event website URL if that is set.
     * NOTE: Comment out the add_filter() line to disable this function.
     */
    /*function tribe_set_link_website ( $link, $postId ) {
     * 	$website_url = tribe_get_event_website_url( $postId );
     * 	// Only swaps link if set
     * 	if ( !empty( $website_url ) ) {
     * 		$link = $website_url;
     * 	}
     * 	return $link;
     * }
     * add_filter( 'tribe_get_event_link', 'tribe_set_link_website', 100, 2 );
     */
    /* Above here added 15Dec16 as per https://theeventscalendar.com/knowledgebase/make-links-event-go-straight-event-website/ */
    
    // Adds regular categories to tribe events
    function mytribecalendar_settings() {   
    // Add category metabox to page
    register_taxonomy_for_object_type('category', 'tribe_events');  
    }
    
    //-------------------------------------------------
    //
    // GOOGLE AMP FOR TRIBE CALENDAR
    //
    //-------------------------------------------------
    //Added 10Mar17 as per https://github.com/Automattic/amp-wp/blob/master/readme.md#custom-post-type-support
    // And also https://theeventscalendar.com/support/forums/topic/will-you-support-amp-accelerated-mobile-pages/
    
    add_action( 'amp_init', 'amp_add_tribe_events_cpt' );
    function amp_add_tribe_events_cpt() {
        add_post_type_support( 'tribe_events', AMP_QUERY_VAR );
    }
    
    
    in reply to: Disabling the plugin brings down my site #1285352
    Mark
    Participant

    Thank you thank you thank you! You solved my problem: you mentioned the word “functions”. I totally forgot that I had modded my functions.php to add some extra functionality to the calendar. When I took out those pieces of code the world fell back into order.

    For the record, these were the instructions I followed/ code I used. It seems that you need to take these out of functions.php if you want to disable the calendar. Otherwise, as I found, your site will fall over. This was the code involved. It needed to be removed from functions.php ahead of disabling the calendar:
    https://theeventscalendar.com/knowledgebase/fast-forward-list-widget-to-next-upcoming-event/
    https://theeventscalendar.com/knowledgebase/make-links-event-go-straight-event-website/
    https://github.com/Automattic/amp-wp/blob/master/readme.md#custom-post-type-support
    https://theeventscalendar.com/support/forums/topic/will-you-support-amp-accelerated-mobile-pages/

    Thanks once more – you are a genius!

    • This reply was modified 6 years, 11 months ago by Mark.
    in reply to: Hover CSS #1248445
    Mark
    Participant

    OK

    Thanks for the ideas…

    …and for confirming that it’s not as easy as it should be (and I am not as
    bad at CSS as I thought)!

    You can close this one for now.

    Thanks for coming back to me – I appreciate it.

    M

    By the way, when I said “header” I meant my theme/ page header, not the
    calendar header

    in reply to: Hover not working in Chrome #1242835
    Mark
    Participant

    OK thanks for looking at this for me.

    I will take some time and review the code – thanks for the ideas.

    Please close this thread for now and I will get back in touch once I’ve done
    what you suggested.

    Thanks for your help.

    in reply to: 404 from category slug #1242671
    Mark
    Participant

    Ok – thanks for the confirmation!

    in reply to: Hover not working in Chrome #1242374
    Mark
    Participant

    OK I’ve gotten rid of the funny </head> tag at the top. Well done for spotting this. It turns out that this was a stray piece of code placed there by a couple of custom plugins I had built for me. The code is gone now. Thanks a lot – the website is behaving quite differently all of a sudden.

    BUT, in my version of Chrome, I still can’t get the courses to hover on https://www.financialtrainingassociates.com/course/

    In Explorer the hover works fine.

    Any other ideas? How does it look in Chrome your end?

    Thanks for trying to debug this for me…

    in reply to: Hover not working in Chrome #1242143
    Mark
    Participant

    Wow – good spot!

    Do you have any idea about what could cause something like this?

    I have tried disabling all plugins but, weirdly, that crashes my site (so my site is only running if plugins are enabled) – so I am sensing some instability…

    Do you have any idea about the sort of thing that could result in that extra tag…

    in reply to: Remove extra category slug from single event #1239847
    Mark
    Participant

    Stop press!

    I think I got it working. NavXT breadcrumbs are as I want them to appear. No errors in Google data testing. it took a lot of fiddling with the NavXT settings.

    At step (6) there was a mistake in my code. I’ll post it here in case anyone else is struggling with the same issue. Here is the code that worked in the NavXT settings for me:

    `<span property=”itemListElement” typeof=”ListItem”><span property=”name”>Course</span><meta property=”position” content=”2″></span> >
    <span property=”itemListElement” typeof=”ListItem”><span property=”name”>Category</span><meta property=”position” content=”3″></span> >
    <span property=”itemListElement” typeof=”ListItem”><span property=”name”>%ftitle%</span><meta property=”position” content=”4″></span>

    Thanks for your thinking time!

    in reply to: Remove extra category slug from single event #1239823
    Mark
    Participant

    Thanks for the offer to look at this further! I’ve got a funny feeling that where it’s going to go next is you telling me that you don’t provide support to get NavXT or Yoast breadcrumbs working with the Tribe Calendar! I think I’ve got most of the way there now by fiddling extensively with the settings in NavXT.

    But I still have a residual error in Google data testing for the Tribe Calendar breadcrumbs which I am confused about because I don’t get the same error when I run this regular category URL through data testing https://www.financialtrainingassociates.com/category/modelling-course/. That one goes through data testing just fine.

    For the record, and for someone else who’s trying to do this, I have:
    1) copied my index.php and put it in my child theme, renaming it to archive.php
    2) inserted NavXT breadrcumbs code at the top of the archive.php page
    3) used the attached (see screenshot1) in NavXT settings. It’s a manual ‘fiddle’ but it worked
    4) an example of the result is at https://www.financialtrainingassociates.com/category/modelling-course/ – NavXT works for regular archive pages and is error free in Google data testing
    5) used the NavXT settings in screenshot2 in the “Post Types” tab for “Event”
    6) used the similar settings in screenshot3 in the NavXT “Taxonomies” tab for “Event Categories” – see screenshot3. These settings are similar to what I did at step (3) which worked for my regular category pages.

    The result is the breadcrumb at
    https://www.financialtrainingassociates.com/course/category/financial-modelling/ looks fine (like the one at https://www.financialtrainingassociates.com/category/modelling-course/) but, unfortunately, the first URL gives me a bit of an error in Google data testing. I can’t work out why but I’m a lot further on with this than I was yesterday!

    Thanks for your thought time…

    in reply to: Remove extra category slug from single event #1235405
    Mark
    Participant

    Thanks for coming back Andras,

    I tried a bunch of things including x3 plugins and including the one you
    mentioned there. None of them take out the category slug. Let’s not worry
    about it. I was just hoping this might have been answered before and I had
    missed a ready solution. Thanks.

    The main thing I am wrestling with is getting my regular navxt breadcrumbs
    plugin to match the tribe calendar URL. Again I have experimented with
    about x3 breadcrumb plugins. Navxt does the best job and copes with my
    other custom posts (course-reviews and testimonials) plis regular standard
    posts (stories) just fine. No stray ‘category’ slug there!

    I notice from the forums that other people have had trouble getting a
    popular plugin like navxt to work with the tribe calendar URLs. I am not
    technical enough to understand this but it seems to me to be something to
    do with how the posts are created with tribe calendar and perhaps not
    providing the information in a form that the breadcrumb plugins can pick up
    on. This is a strange one because, as mentioned, I can get navxt working
    fine with my all my other custom posts.

    Is there some existing guidance on getting tribe events working with the
    (ever popular) navxt breadcrumb plugin? Have I missed something on this
    one?

    in reply to: Order events by publish date #1208119
    Mark
    Participant

    Thanks for confirming the options.

    In the end I decided to make use of the category tags to eliminate the
    events I didn’t want to show straight away – so that solved it.

    Thanks for the support.

    Your plugin seems awesome!

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