Forums

Call to undefined function: bloginfo() (12 posts)

  1. greeny
    Member
    Posted 2 years ago #

    hello,
    i am getting the following error:
    can someone please advise how to correct this problem?
    'Fatal error: Call to undefined function: bloginfo() in /home/okamik/public_html/blog/header.php on line 5'

    i did not see the answer in any other forum.

    the code is:
    '<head profile="http://gmpg.org/xfn/11">
    <meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />

    <title><?php bloginfo('name'); ?><?php wp_title(); ?></title>'

    i have a header.php in
    /public_html/blog/
    and
    /public_html/blog/wp-content/themes/daisy/

  2. greeny
    Member
    Posted 2 years ago #

    hello,
    can someone please help me resolve the bloginfo problem above?

    thanks.

  3. greeny
    Member
    Posted 2 years ago #

    can anyone please help me resolve my issue? i would really appreciate it.

  4. shadow
    Moderator
    Posted 2 years ago #

    Remove this for a moment:

    <meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />

  5. greeny
    Member
    Posted 1 year ago #

    the above task did not fix the error. do you know what else i can do please?

  6. SimonJ
    Member
    Posted 1 year ago #

    Do you really use version 2.0.10 ????

    I strongly suggest an upgrade...

    S.

  7. greeny
    Member
    Posted 1 year ago #

    is upgrading going to fix the 'call to undefined error'?

  8. SimonJ
    Member
    Posted 1 year ago #

    "bloginfo" shouldn't be undifined... It's a core function that you can find in /wp-includes/general-template.php. So as long as your Wordpress is well installed, this function should be well defined...

    ---

    But from what I can tell, your problem is relative to your theme :

    Your error says that you call an undefined function, bloginfo(), in "public_html/blog/header.php"...

    You say that you have two headers...
    one in "/public_html/blog/" the other in
    "/public_html/blog/wp-content/themes/daisy/"

    If you look at the error, you can fairly understand that the problem comes from "public_html/blog/header.php"...

    The fact is that you normally shouldn't have a "header.php" there...

    For a reason or another, your theme seems to include this header.php...

    Look at the index.php in your THEME directory (wp-content/themes/daisy)...

    The first line should be <?php get_header(); ?>

    ---

    Try to switch theme for the "default"... Does the problem persist ? if not, then your problem is in your "daisy" theme... I would guess that you include the wrong header in daisy/index.php or daisy/home.php...

    S.

  9. greeny
    Member
    Posted 1 year ago #

    i know exactly what you are saying. i figured that out last night. i'm just confused on which one should really be there and what the correct code should be written.

    ok, here is the first few lines in the index of wp-content/themes/daisy

    <?php
    define('WP_USE_THEMES',true);
    require('header.php');
    get_header();
    ?>

    i'm not sure where 'default' should be placed.

  10. greeny
    Member
    Posted 1 year ago #

    i deleted the header in "public_html/blog/header.php" so the error now points to the header in my theme.

    if you think i should upgrade and then try to fix the problem please let me know.

  11. SimonJ
    Member
    Posted 1 year ago #

    I don't know how your "daisy" theme is built, but normally, the first few lines you wrote above shouldn't be in wp-content/themes/daisy...

    Are you really sure the code you pasted is in wp-content/themes/daisy ???

    You have TWO index.php...

    One in the root directory where you installed wordpress :

    http://www.where_you_installed_wordpress/index.php

    This one should contain a short and sweet code :

    <?php
    /* Short and sweet */
    define('WP_USE_THEMES', true);
    require('./wp-blog-header.php');
    ?>

    NOTE THE : require('./wp-blog-header.php'); ... this require is really important, this is where all the core WP functions, like bloginfo, are included...

    Then, you have another index.php in wp-content/themes/daisy/

    Where you will likely find the first line :
    <?php get_header(); ?>... the header.php you should fid in your theme directory...

    It seems to me that you have an exotic configuration...

    Your two next steps :

    1) switch theme to the default theme and see if the problem still occur.

    2) Yes, backup your wp-config.php, the /wp-content directory to save your stuff, backup your database, and follow the steps to upgrade your wordpress... At least, you will be able to troubleshoot your theme on a fresh new base...

    S.

  12. greeny
    Member
    Posted 1 year ago #

    ok, it looks like that code was not correct as you suspected. i must have mistakenly copied it in.

    i did try the default theme and received the same error. so i am going to perform the back up and upgrade. hopefully the upgrade goes smoothly. i'll let you know once i've completed it.

    thanks for your patience in all of this.

Topic Closed

This topic has been closed to new replies.

About this Topic