• All of a sudden my site wont work with the Zephyr theme. Not sure what is going wrong! I had to clear everything out of my computer cache, default on my web host, and still it goes all white if I’m on Zephyr. Help!

Viewing 7 replies - 1 through 7 (of 7 total)
  • Are you able to access any of the server logs?

    A white page normally means a PHP error which you should be able to see in the Apache server log or the PHP error log.

    Your website host should be able to help you access those logs.

    Can you confirm if only the front-end of your blog with Zephyr is broken? Are you able to access the WordPress back-end dashboard and select different themes?

    Thread Starter kristipwith3

    (@kristipwith3)

    I am able to access different themes. As soon as I try and go back to Zephyr, it is white

    Then it does sound like a bug particular to the Zephyr theme. Can you get access to your Apache error log so that we can see what error is being logged; that will help determine if there is coding bug or if Zephyer is looking for a file that is missing.

    As a plan B you could try re-installing the latest version of the Zephyr theme.

    Thread Starter kristipwith3

    (@kristipwith3)

    I can get into my error log. I’m not sure what you need to see though.

    15-May-2015 15:11:24 UTC] PHP Fatal error: Cannot redeclare get_avatar_url() (previously declared in /home2/pyattfox/public_html/wp-includes/link-template.php:3414) in /home2/pyattfox/public_html/wp-content/themes/zephyr/zephyr-includes/zephyr-functions.php on line 34

    Last lines.

    Perfect. That is exactly what we need to know.

    It means the Zephyr theme is accidentally declaring a function that is already being declared by WordPress core files. Possibly due to a WordPress update introducing that function into the core code.

    To fix this I suggest you edit the file /themes/zephyr/zephyr-includes/zephyr-functions.php and just before line 34 add this code:

    if(!function_exists("get_avatar_url")){

    Now the harder part if you are not familiar with PHP code: you need to find the last line of the function that starts on line 34.

    The code should look something like this (from line 34):

    function get_avatar_url($someId){
        ...
        ...
        ...
    }

    And that ‘}‘ closes the function. *After* that you also need to add another ‘}‘ to match the ‘{‘ of the if statement you added at line 33.

    So by the time you finish the code will look like this:

    if(!function_exists("get_avatar_url")){
      function get_avatar_url($someId){
        ...
        ...
        ...
      }
    }

    Does that make sense? If it doesn’t, paste here the code from say line 30 to line 60 of the file zephyr-functions.php and I will edit it for you, then you can paste it back into your file.

    Thread Starter kristipwith3

    (@kristipwith3)

    I’m sorry. I’m not familiar at all with this!

    Is this what you need?

    function get_avatar_url($get_avatar){
    preg_match(“/src='(.*?)’/i”, $get_avatar, $matches);
    return $matches[1];
    }

    // prepare quote content for output
    function zephyr_quote_content($zephyr_content) {
    if ( has_post_format( ‘quote’ ) ) {
    preg_match( ‘/<blockquote.*?>/’, $zephyr_content, $matches );
    if ( empty( $matches ) ) {
    $zephyr_content = “

    {$zephyr_content}

    “;
    }
    }
    return $zephyr_content;
    }
    add_filter( ‘the_content’, ‘zephyr_quote_content’ );

    // pagination

    function zephyr_pagination($pages = ”, $range = 2) {
    if ( !get_theme_mod(‘zephyr_infinite’) ) {
    $showitems = ($range * 2)+1;
    global $paged;
    if(empty($paged)) $paged = 1;
    if($pages == ”) {
    global $wp_query;
    $pages = $wp_query->max_num_pages;
    if(!$pages) {
    $pages = 1;
    }
    }

    Yes, that is very helpful. Please replace the first four lines of the code you sent:

    function get_avatar_url($get_avatar){
      preg_match("/src='(.*?)'/i", $get_avatar, $matches);
      return $matches[1];
    }

    with this code:

    if(!function_exists("zephyr_get_avatar_url")){
      function zephyr_get_avatar_url($get_avatar){
          preg_match("/src='(.*?)'/i", $get_avatar, $matches);
          return $matches[1];
      }
    }

    And save the file.

    IMPORTANT NOTES:

    a) The function get_avatar_url() was added to the core file links-template.php in WordPress version 4.2

    b) Therefore I expect the theme developers of Zephyr theme will issue an updated template soon and I recommend you upgrade your theme template as soon as you can.

    c) The two functions are different so this might not be a full fix yet. That is why I have changed the name of the function. We might need to change everywhere else in the Zephyr theme where it calls its different function get_avatar_url( to zephyr_get_avatar_url(. But looking at the code I think this edit above will get your theme working except the avatar link won’t work any more because I expect get_avatar_url($get_avatar) will now return the value FALSE so it means the avatar links won’t work in your Zephyr theme until the updated theme is issued.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘zephyr = white page of death?’ is closed to new replies.