WordPress.org

Support

Support » Themes and Templates » [Theme: obandes] Code in header won't go away!

[Theme: obandes] Code in header won't go away!

Viewing 12 replies - 1 through 12 (of 12 total)
  • Andrew Nevins
    Moderator

    @anevins

    Can you link your website in which the problem is in?

    doodleoodle
    Member

    @doodleoodle

    Thanks for your reply Andrew.

    The two sites shown in my post above show examples of the problematic code.

    Andrew Nevins
    Moderator

    @anevins

    Are any your websites?

    doodleoodle
    Member

    @doodleoodle

    Yes I composed the JerichoCafe one :o)

    Andrew Nevins
    Moderator

    @anevins

    Look at the PHP function reference when using is_object. You need one parameter.
    http://php.net/manual/en/function.is-object.php

    doodleoodle
    Member

    @doodleoodle

    Thanks mate I’ll study that.

    Much appreciated.

    doodleoodle
    Member

    @doodleoodle

    Any idea what to put or what should go in there?

    Andrew Nevins
    Moderator

    @anevins

    You could put a variable with your object in there, or remove the code all together if it’s not doing anything.

    doodleoodle
    Member

    @doodleoodle

    Okay thanks.

    The code obandes: Theme Functions (functions.php) says;

    $image_data = get_theme_mod( ‘header_image_data’ );
    if(is_object()){
    $width = $image_data->width;
    $height = $image_data->height;
    }

    I don’t have the skill or knowledge to see what to put in there. I would be very grateful if you can suggest or tell me what to delete.

    Andrew Nevins
    Moderator

    @anevins

    Try

    if ( is_object( $image_data ) ) {
    
     $width = $image_data->width;
     $height = $image_data->height;
    
    }

    doodleoodle
    Member

    @doodleoodle

    Cheers mate, you’re a diamond.

    That’s exactly what it needed.

    Just out of interest; do you think it’s a fault in the original theme code or was it something I did?

    …tried to notify the author but can’t find the link to him as yet, maybe later.

    Thanks again, much appreciated!

    Andrew Nevins
    Moderator

    @anevins

    The fault is with whom added the is_object function or removed the is_object parameter.

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘[Theme: obandes] Code in header won't go away!’ is closed to new replies.