PHP error in archive.php #17

Open
Interned opened this Issue Feb 20, 2012 · 8 comments

Projects

None yet

2 participants

@Interned

I got this :
Fatal error: Call to undefined function catch_that_image() in ../www/wordpress/wp-content/themes/bootstrapwp/archive.php on line 50

Removing that line makes the file working correctly.

Owner

Weird, for some reason is your functions.php file not updated?

It is updated. But I was wondering about that function :

 * Filter in a link to a content ID attribute for the next/previous image links on image attachment pages
 */
function bootstrapwp_enhanced_image_navigation( $url ) {
    global $post;

    if ( wp_attachment_is_image( $post->ID ) )
        $url = $url . '#main';

    return $url;
}
add_filter( 'attachment_link', 'bootstrapwp_enhanced_image_navigation' );

What happens if there isn't any attachment at all ?
Owner

If there isn't any attachment the nothing happens, I will add an else to the function to clear up any confusion. Are you still having any problems with these pages/functions?

Well, I added this code snippet else $url = ''; and, in a second time, tried return $url.'#main'; return '';. But I still got that notice if I want to modify any element in the WP Library admin, for any attachment :
Notice: Trying to get property of non-object in

Owner

Really, weird! What if you de-activate and then re-activate the theme? I have tested it without problems on WP 3.1.4 alpha.

De-activating and re-activating the theme didn't change anything. You uploaded some file in the WP Library, clicked on "modifying", and then any php notice displayed at all, any issue with that uploaded file ? So... what the fuck did I make °_° ?

I modified the code by if ( isset($post->ID) && wp_attachment_is_image( $post->ID ) ) I haven't got any php notice at all. So, for me, it's ok, issue seems to have been resolved then ?

line 53 in author.php <?php echo catch_that_image();?>. It seems that this function doesn't exist in any file because I got that issue as an author tag is being displayed : Fatal error: Call to undefined function catch_that_image() in ../wp-content/themes/la-mars/author.php

By removing that code snippet, it works fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment