Support » Plugin: Fade in fade out post title » Fixed undefined error from .js file

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter rezon8dev

    (@rezon8dev)

    Here it is, the plugin will break; causing a bunch of .js errors and breaking the fade-link and fade-links (inline .js) if and when you use special characters or html entities in the post titles. To fix this I altered lines in the fade-in-fade-out-post-title.php, lines 70-88, with changes made to 77 and 78:

    if ( ! empty($sSql) )
    	{
    		$count = 0;
    		foreach ( $sSql as $sSql )
    		{
    			$title = esc_html( $sSql->post_title );
    			//$title = $sSql->post_title;
    			$link = get_permalink(esc_html ($sSql->ID));
    			$fifopost_arr = $fifopost_arr . "fifopost_Links[$count] = '$link';fifopost_Titles[$count] = '$title'; ";
    			if($count == 0)
    			{
    				$first_t = $title;
    				$first_l = $link;
    			}
    			$count = $count + 1;
    		}
    	}
    	wp_reset_query();

    Would be great to see you update the plugin to allow special characters in the post titles, thanks for getting us here.

    Thread Starter rezon8dev

    (@rezon8dev)

    This still did not fix all the errors, I was getting them on pages where the plugin did not render, to fix this (and because I am only ever going to use this plugin on the home page I added
    && is_front_page
    to the script enqueue …

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Fixed undefined error from .js file’ is closed to new replies.