• Here is the issue. I made an edit to functions.php in my child theme to get the link (day of the week) on the widget calendar to go to a page instead of the archives. Refer to the original post where the code was given to me.

    http://wordpress.org/support/topic/where-do-i-find-the-files-to-edit-the-calendar-if-possible?replies=12

    It works perfectly on my local XAMPP testing server. When I publish it my my live server I get no link at all on the day of the week.

    Hopefully someone can help.

    site is http://aapensacola.skeeterz71.com

    This is the code I have in my child theme functions.php

    <?php
    /* Applied Filter to Calendar Widget
    Change link on calendar day from pointing to the archives to the page designated for that day. Monday, Tuesday, Wednesday ect.. Delete this if you wish to return to the archives.*/
    add_filter( 'day_link', 'filter_day_link', 10, 4 );
    function filter_day_link( $link, $year, $month, $day ) {
    
      $the_day = date( 'l', mktime( 00, 00, 00, $month, $day, $year ) ); // Monday,Thuesday etc
      $the_day = strtolower( $the_day );
      global $wpdb;
      $post_id = $wpdb->get_var( "SELECT ID FROM $wpdb->posts WHERE post_name = '$the_day'" );
      if ( $post_id ) {
        return get_permalink( $post_id );
      }
      return  $link;
    }
    
    add_filter( 'dynamic_sidebar_params', 'calendar_widget_titles' );
    function calendar_widget_titles( $params ) {
      if ( $params[0]['widget_name'] == 'Calendar' )
        add_filter( 'the_title', '__return_false' );
      return $params;
    }
    
    add_filter( 'get_calendar', 'filter_calendar_output' );
    function filter_calendar_output( $calendar ) {
      $calendar = preg_replace( '/title=""/', 'title="View meetings for this day"', $calendar );
      return  $calendar;
    
    }

    Thanks

  • The topic ‘Link on widget calendar works on Test server not live server’ is closed to new replies.