• Resolved krakenck

    (@krakenck)


    I have just upgraded to the latest theme release and all of the front page widgets have vanished.

    They are still showing up in the customizing panel, set up as I left them.
    They are not displaying on the homepage or the preview panel.

    I have tried adding new widgets, and logging in again but cannot get anything to display.

    Everything else *seems* OK, but I haven’t looked at everything closely since the upgrade.

    Please help!

Viewing 7 replies - 1 through 7 (of 7 total)
  • I have the same problem: I get the following error:

    Fatal error: Call to undefined function optimizer_attachment_id_by_url() in /web/htdocs/www.rosaliagreco.com/home/wp-content/themes/optimizer/framework/core-functions.php on line 194

    I experience the same problem after today’s update. Plus on the frontpage I also lost the editing part that is normally displayed at the top. Hopefully someone can help.

    Theme Author OptimizerWP

    (@layerthemes)

    Looks like a bug. Can you please go to Appearance >Editor and select core-functions.php and add this to the very bottom of the file:

    //**Return an ID of an attachment by searching the database with the file URL (Inexpensive query)**//
    function optimizer_attachment_id_by_url( $url ) {
    	$parsed_url  = explode( parse_url( WP_CONTENT_URL, PHP_URL_PATH ), $url );
    
    	$this_host = str_ireplace( 'www.', '', parse_url( home_url(), PHP_URL_HOST ) );
    	$file_host = str_ireplace( 'www.', '', parse_url( $url, PHP_URL_HOST ) );
    
    	if ( ! isset( $parsed_url[1] ) || empty( $parsed_url[1] ) || ( $this_host != $file_host ) ) {
    		return;
    	}
    
    	global $wpdb;
    	$attachment = $wpdb->get_col( $wpdb->prepare( "SELECT ID FROM {$wpdb->prefix}posts WHERE guid RLIKE %s;", $parsed_url[1] ) );
    	return $attachment[0];
    }

    We will fix this pretty soon. Thanks for your patience.

    Thread Starter krakenck

    (@krakenck)

    Success!!
    Thanks for the speedy response.
    ??

    Great, it worked! Thanks for the quick reply

    HELP! i pasted that and now i cannot open my website or even the wordpress admin panel it gives me this error:

    Fatal error: Cannot redeclare optimizer_attachment_id_by_url() (previously declared in /home/sslsghfz/public_html/cyboard.xyz/wp-content/themes/optimizer_pro/framework/core-functions.php:366) in /home/sslsghfz/public_html/cyboard.xyz/wp-content/themes/optimizer_pro/framework/core-functions.php on line 436

    Theme Author OptimizerWP

    (@layerthemes)

    @amrrr Sounds like the update did not go well. Can you please switch to another theme and delete Optimizer from Appearance > Themes and then install the theme again? Your theme settings should be intact, so dont worry about that.

    Thanks

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Front Page Box Widgets Disappeared After Theme Upgrade’ is closed to new replies.