• Hi there,

    I’m sure it is just a really obvious and stupid problem but I am new to wordpress, new to bootstrap and only have done some basic html-ing in the past.

    So I’ve replicated a bootstrap theme to get it to work with wordpress according to this article here: http://blog.teamtreehouse.com/responsive-wordpress-bootstrap-theme-tutorial

    so far so good. Now I am at the stage of customizing it and adding my stuff to it, but everytime I add anything to the functions.php it results in wordpress displaying a blank page where my page should be (NB I am using theme drive to work on the theme so I can keep the old theme live). the only thing I managed to add to the functions.php is <?php // Register custom navigation walker
    require_once(‘wp_bootstrap_navwalker.php’);
    ?>

    Is that a problem that anyone’s encountered before? It could be something simple, maybe I am writing the functions wrongly (so far I have copied and pasted from various sources) – do they all have to be in a <?php ?> ? If not, they won’t show up “colourful” in my editor which makes it look like its not working.

    Sorry for the stupid questions but I am so lost that I can’t add any functions because that’s the whole point of wp!

    Thanks!

Viewing 7 replies - 1 through 7 (of 7 total)
  • Hey there,

    What’s the PHP error you’re getting.

    To output the WordPress debugging information you can open your wp-config.php file and change:

    define('WP_DEBUG', false);

    To:

    define('WP_DEBUG', true);

    You can also have these errors output to a debug.log file located in your /wp-content/ folder, to do this add the following to your wp-config.php file:

    define('WP_DEBUG_LOG', true);

    Using WP_DEBUG would put the errors on the site, you can hide those and just have them out put the WP_DEBUG_LOG (if set to true) by using this as well:

    define('WP_DEBUG_DISPLAY', false);

    Let me know what you find.

    Take care.

    Thread Starter sup3rhero

    (@sup3rhero)

    Hi Timothy,

    Thanks for your help! I have just set the first DEBUG to True now (not the log yet) and uploaded the config file again and now,for some reason when I add something to the functions.php and then look on the site, it still displays the website?

    And it doesnt display any error (would it show the error on the website then online?)

    Thread Starter sup3rhero

    (@sup3rhero)

    edit! I uploaded it in the wrong directory … its been a long day

    error is>

    “Notice: Undefined variable: wp_customize in /customers/c/7/c/fitnessxtreme.co.uk/httpd.www/wp/wp-content/themes/wpbootstrap/functions.php on line 68 Fatal error: Call to a member function add_setting() on a non-object in /customers/c/7/c/fitnessxtreme.co.uk/httpd.www/wp/wp-content/themes/wpbootstrap/functions.php on line 68”

    this is the line

    ` $wp_customize->add_setting(
    $color[‘slug’], array(
    ‘default’ => $color[‘default’],
    ‘type’ => ‘option’,
    ‘capability’ =>
    ‘edit_theme_options’
    )
    );

    I used the first and last function on this website:
    http://www.smashingmagazine.com/2013/03/05/the-wordpress-theme-customizer-a-developers-guide/

    Also, I’d need to add the function to change the header image asap as I deleted the picture and now can’t set a new one 😛

    Hey there,

    The notice is fine in that it shouldn’t cause a white page, it’s just a notice because the wp_customize was not first defined.

    The important one there is the fatal error, you’re trying to call a method but you haven’t yet created the object. Because the object hasn’t been created the method does not yet exist and thus results in an error that will stop everything.

    http://codex.ww.wp.xz.cn/Plugin_API/Action_Reference/customize_register

    How are you writing the code?

    Take care.

    Thread Starter sup3rhero

    (@sup3rhero)

    I’m just flicking through examples to get an idea of how things work, like with this one i added it to the functions.php and then in the actual page. but no matter which function i try (i tried a navwalker customiser too) it makes my page go blank

    Thread Starter sup3rhero

    (@sup3rhero)

    this is the line

    ` $wp_customize->add_setting(
    $color[‘slug’], array(
    ‘default’ => $color[‘default’],
    ‘type’ => ‘option’,
    ‘capability’ =>
    ‘edit_theme_options’
    )
    );

    Is that all the code, I’m sure there is more isn’t there?

    Best to include code in the code backticks, or pastebin if it’s a longer snippet.

    What tutorial or information are you following?

    Did you look at and study the example and how to hook in your code here:

    http://codex.ww.wp.xz.cn/Plugin_API/Action_Reference/customize_register

    Take care.

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Changes to functions.php displays blank website’ is closed to new replies.