Viewing 9 replies - 1 through 9 (of 9 total)
  • I had the same issue, and it occurred with the most recent update to All-in-One Calendar. I’ve posted a version of this over there…

    It looks like the Simple Share Buttons code

    get_the_title($post->ID);

    used to return something like this:

    “Event Title”

    After the recent update, that same code returns this:

    “<span class=” summary”>Event Title</span>”

    Again, we didn’t have that issue until the most recent All-in-One Calendar update, so not necessarily a problem with this plugin.

    Not optimal code, as I’m not an amature programmer. This works as a hack to fix the issue, placed just after where $strPageTitle is set in the Simple Share Buttons Adder code:

    if (strpos($strPageTitle,'</span>') !== false) {
       				$strPageTitle = ltrim($strPageTitle,'<span class=" summary">');
    				$strPageTitle = rtrim($strPageTitle,'</span>');
    			}
    Thread Starter rasaanj123

    (@rasaanj123)

    Thanks for the info. It looks like the $strPageTitle appears nine times in the simpleshareadder.php file. I tried placing this line at several different places and I get an error.

    Could you tell or show me the exact placement of this line of code. I’m not a programmer at all, but I can get around a little bit.

    Thanks in advance!

    I had originally started this thread so I don’t know if it could help anyone. I also am not a programmer.

    https://www.ads-software.com/support/topic/title-plugin-conflict

    // set page URL and title as set by user or get if needed
    					$urlCurrentPage = (isset($atts['url']) ? $atts['url'] : ssba_current_url());
    					$strPageTitle = (isset($atts['title']) ? $atts['title'] : get_the_title());
    			}
    
    	if (strpos($strPageTitle,'</span>') !== false) {
       				$strPageTitle = ltrim($strPageTitle,'<span class=" summary">');
    				$strPageTitle = rtrim($strPageTitle,'</span>');
    			}	
    
    			// the buttons!

    If you are still looking for this hack, I added the code I posted previously in this thread just above the “// the buttons!” comment line, which is about half way down the Simple-Share-Buttons-Adder.php file. It’s just a hack, as it looks for ‘</span>’ in the page title, and removes the code from the beginning and end of the title if it is there. The code snippet above has the added lines in context.

    Since All-in-One Calendar’s Events are a custom post type, I’d really love it if custom post types could be globally excluded from the Share Buttons adder. Adding the shortcode to hide the buttons to a few dozen or a few hundred items just makes it seem like there should be an easier way.

    I like SSBA a lot, it loads much faster than the previous plugin I was using, but that previous plugin also had checkboxes to enable to disable buttons on CPTs in addition to regular posts and pages.

    I will try this code out and see what happens…

    I’ve been using it for mine and love it. I’ve used it both ways. Adding the shortcode to what I want to be able to share or clicking the box to add it automatically. Either way, it works very well. It’s the only one I’ve found that works well with CPTs.

    Actually, with the previous All-in-One Calendar update, the code I posted above doesn’t work anymore. I think the “summary” class changed to “p-summary.”

    Check out the forum on what they helped me fix it.
    https://time.ly/forums/topic/actual-event-changes-entire-page/page/2/

    Here is the code just in case someone needs help with it.

    Add below code to functions.php in your theme directory.

    function fix_sharing_elements_workaround( $title, $post_id ) {
    if ( get_post_type( $post_id ) === AI1EC_POST_TYPE ) {
    $title = strip_tags( $title );
    }
    return $title;
    }
    
    add_filter( 'the_title', 'fix_sharing_elements_workaround', PHP_INT_MAX, 2);

    Thank you nppbc. That works much better than my code, which will break every time there is an update.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Not working Properly on Events Page’ is closed to new replies.