Fatal error. Not sure what to do
-
I have got this error:
Fatal error: Call to undefined function viva() in /home/cleanmfc/public_html/tsih/wp-content/themes/wpsn/home.php on line 33Not sure what to do. The URL is https://www.tsih.clean-mf.co.uk
Thanks
-
this error is telling you that a file called ‘home.php’ in the folder ‘/home/cleanmfc/public_html/tsih/wp-content/themes/wpsn/’ is trying to call a function called viva(), but that this function cannot be found.
Possible reasons are –
1) The function genuinly does not exist, you may have mispelled it or copied it from the web and forget to rename it.
2) The function is in a file that has not been called yet. It is possible to create a .php file, whack a load of functions in there that are all to do with the same thing, and then include or require that .php file – but if the function is called before the include or require statement is reached, then it’s not going to be able to find it.
3) The function is used as part of a plugin, and for what ever reason that plugin is not activcted – check Plugins in your admin area to see.To avoid the error replace the code
viva()
withif(function_exists('viva')) : viva();
, but of course any functionality gained by the function will be lost.Hello, I had a look to try and help you but can’t see PHP throwing an error like that…
Is the issue resolved?
But all that basically means is that you are making a function call to the “viva” function on the home.php template file. Have a look through there and either implement the viva function, or remove the call ??
Good luck.
The function pointed out by duck__boy i.e. function_exists() is considered standard practice these days when calling pretty much any function from themes (and Plugins). Just take a sneaky peak around the Twenty Ten code and see how many (i.e. all!) functions are wrapped inside if(function_exists(‘func_name’)) constructs.
This is considered good practice so as to NOT break your site if the function cannot be found. The worst that will happen is that the function will not run (as it can’t be found!). That is much better than your whole site breaking down.. ??
I don’t know if it is just my tough luck, my hosting server, or WP just doesn’t want to work for me. I’ve had to re-install it and start over 7 times already! I need to get the site done ASAP and this is holding me down! Ok, here is the latest error I’ve gotten and now I cannot do a darn thing!
Fatal error: Call to undefined function wp_count_comments() in /hermes/bosweb/web108/b1086/ipg.askbenet/wp-admin/menu.php on line 25
Before this error, it threw me one regarding exceeding memory and sending me in a goose-chase to the wp-admin/menu.php file. I opened the file from the server viewer to see if I could find any string referring to max memory but there was no mention of it. I closed without making any changes and the next thing I know, the error above appears for no reason! I am so frustrated! I would really appreciate your help so I don’t have to uninstall and re-install WP and extensions all over again!
Thank you so much for your time and help.
If you’re getting so many errors regarding exceeding memory and function references, could it be your hosting? I.e. permissions on files, etc…
I’m a bit confused. In all the sites I’ve made with WP I’ve not had a single problem.
The only place on the home.php page i can find Viva is in this section:
What exactly do i put in place and where abouts.
Sorry still new to this area
Try:
" rel="bookmark"><?php if (function_exists('viva')):?><img src="<?php viva(134,'');?>" alt="<?php the_title(); ?> <?php _e('thumbnail'); ?>" align="left" style="border: 0px; padding: 0px 10px 0px 0px; margin: 3px 0px 3px 0px; width: 134px; height: 75px;"/><?php endif; ?>
Now I am getting this error:
Parse error: syntax error, unexpected T_ENDWHILE in /home/cleanmfc/public_html/tsih/wp-content/themes/wpsn/home.php on line 45
Most probably a missing semicolon somewhere (
;
) after a PHP statement… Look around line 44/45.All have between line 40 & 48 is this:
<?php wswwpx_content_extract ( ‘ ‘, 37, 37 ); ?>” rel=”bookmark”>[+]
<?php endwhile; ?>
Oh right ok well in that case it looks as though you have an endwhile without an opening while statement.
If you don’t have an opening
<?php while(): ?>
then just delete the<?php endwhile; ?>
bit.I do this is from line 25 to 45:
<?php while ($my_query->have_posts()) : $my_query->the_post(); ?>
<h1 class=”mainheadline”>” rel=”bookmark”><?php the_title(); ?></h1>
<span id=”small-txt”><?php the_time(‘F j, Y’); ?> by <?php the_author_posts_link(); ?></span>
<div style=”margin-bottom: 10px; padding-bottom: 10px; border-bottom: 1px solid #dddddd;”></div>
<?php wswwpx_content_extract ( ‘ ‘, 37, 37 ); ?>” rel=”bookmark”>[+]
<?php endwhile; ?> ;
Sorry for being a pain
I think it may be because you have missed out the
<?php endif; ?>
after the<img />
tag…Remember the first bit I posted, with function_exists()… etc?
Just put that in after the <img>, that should clear it up. The PHP interpreter is looking for a closing if in the structure of the script, but instead is finding an endwhile. Thus, it’s failing.
HTH, and no worries ??
Thank you
georgeedwards Thank you so much for trying to help. It turned out that my hosting service had not allocated enough memory in the PHP (that’s what the tech support guy told me). I guess I should consider other hosting service that actually knows NOT to do that! Anyway, so far, it seems to be resolved. I sincerely appreciate your feedback. ‘Til next time and have a wonderful week! ??
- The topic ‘Fatal error. Not sure what to do’ is closed to new replies.