Forum Replies Created

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter jafannonwp

    (@jafannonwp)

    Thanks – I will try the approach suggested by @jtmarcot which sounds like a simple work-around.

    I had a similar issue, even after flushing permalinks. For me it only occurs when there are multiple events on one day in a calendar view. Clicking on the date in the calendar takes you through to a page listing the events. If the events are in the future (i.e. scheduled) the hyperlink for each event on this page is in the format:

    https://<domain>/?post_type=sp_event&p=<post id>

    This link works when I am logged in as admin, but gives the ‘Oops! That page can’t be found’ error when not logged in.

    In the calendar list view, the link to the same event is in the format:

    https://<domain>/event/<post id>/

    This link works whether logged in or not.

    I looked in more detail at the content-page.php from the rookie theme and this uses get_permalink() to generate the link, whilst in the event-list.php from the SportsPress plugin uses get_post_permalink( $event->ID, false, true).

    So I changed content-page.php for the rookie theme to the following:

    	<!-- If it is not a page - use get_post_permalink with sample option set to true -->
    	<?php if ( ! is_single() && ! is_page()) { ?>
    		<a href="<?php echo esc_url(get_post_permalink(0,false,true)); ?>">
    	<?php } ?>
    
    	<header class="entry-header">
    		<?php if ( has_post_thumbnail() ) { ?>
    			<div class="entry-thumbnail">
    				<?php the_post_thumbnail( 'large' ); ?>
    			</div>
    		<?php } ?>
    			
    		<?php the_title( '<h1 class="entry-title">', '</h1>' ); ?>
    		
    	</header><!-- .entry-header -->
    
    	<?php if ( ! is_single() && ! is_page()) { ?></a><?php } ?>

    Now this seems to return the correctly formatted permalink.

    Regards

    John

    Thread Starter jafannonwp

    (@jafannonwp)

    I’ve spent some time looking at this today and had to make the following changes to fix this:

    1) Change the rookie theme content-page.php to include the following above the title, to show the time of the post, where there are multiple:

    		
    <!-- Post time -->
    <?php if ( ! is_single() && ! is_page()) { ?><div class="entry-time"><?php the_time(); ?></div><?php } ?>
    
    <?php the_title( '<h1 class="entry-title">', '</h1>' ); ?>
    

    2) Change the event-calendar.php to add two additional query parameters to the calendar links to control the ordering of results:

    
    	if ( array_key_exists($day, $daywithpost) ) // any posts today?
    		$calendar_output .= '<a data-tooltip data-options="disable_for_touch:true" class="has-tip" href="' . ( sizeof( $daywithpost[ $day ] ) > 1 ? add_query_arg( array( 'post_type' => 'sp_event', 'orderby' => 'date','order' => 'asc'), get_day_link( $thisyear, $thismonth, $day ) ) . '" title="' . sprintf( '%s events', ( sizeof( $daywithpost[ $day ] ) ) ) : get_post_permalink( $daywithpost[ $day ][0], false, true ) . '" title="' . esc_attr( $ak_titles_for_day[ $day ] ) ) . "\">$day</a>";
    	else
    		$calendar_output .= $day;
    

    If there is a better way, please let me know. It would be great if these changes can be included in a future release.

    John

    Thread Starter jafannonwp

    (@jafannonwp)

    Turns out the “missed schedule” was happening for all scheduled posts in our WP site. I contacted the host and found that they have disabled http loopbacks, which is the cause in this case.

    For now we have added the following to the wp-config.php to work around the issue:

    define(‘ALTERNATE_WP_CRON’, true );

    I’m hoping that the host will enable http loopbacks as the above is not the recommended approach.

    Thread Starter jafannonwp

    (@jafannonwp)

    As an update – I’ve just looked at the events list and found that the old event was showing as “Missed Schedule”. I’ve manually published the event and the countdown is now showing the correct event.

    Any ideas what is causing the “Missed Schedule”?

Viewing 5 replies - 1 through 5 (of 5 total)