Call to a member function render_social_icons() on a non-object - php

i have received a Fatal error from logs its repeating same error.
I don,t understand what to do please help me out on this.
Eroor logs:
PHP Fatal error: Call to a member function render_social_icons() on a
non-object in content-single.php on line 190
Code :
<div class="fusion-sharing-box share-box">
<h4>
<?php echo __('Share This Story, Choose Your Platform!', 'Avada'); ?></h4>
<?php
echo $social_icons->render_social_icons( $sharingbox_soical_icon_options );
?>

Create an object of class then use it in cotent-single.php file.Before that you have to include file for that specific class.
$social_icons= new <Some class>;
$social_icons->render_social_icons( $sharingbox_soical_icon_options );
You have to share cotent-single.php that will give more idea.

$social_icons isn't what you're expecting it to be.
You're treating $social_icons as an object when you try to call the render_social_icons() method and it's generating an error because it isn't one.
Where are you defining $social_icons? Was the code copied/pasted from elsewhere? Without seeing more code it's difficult to help devise a solution beyond suggesting that you trace it back and find out where $social_icons is being defined.

Related

Call to undefined function mod_dir()

I am trying to host an app which is already written and i am unable to process beyond this point, I know this might be very little detail to solve this issue. But anyone has any idea what this function is? (mod_dir()). Am i missing a library.
<?php
global $dir;
echo 'a';
$dir = mod_dir();
?>
Actual error : Fatal error: Call to undefined function mod_dir() in /Users/****/Sites/test/index.php on line 10

PHP Fatal Error Call to Undefined. Stop it breaking page?

Please forgive me if this is a duplicate question. I have searched but cant come up with an answer.
I am getting a PHP fatal error: call to undefined in my Wordpress site.
I know why this is, I am calling a method in my template file that is defined in a plugin - if the plugin isnt installed, then the template throws the error.
Is there any way I can encapsulate this method so that if it fails, the fatal error doesnt stop the rest of the page loading?
Many thanks.
You can check if the function is defined before calling it.
<?php
if (function_exists('plugin_function')) {
plugin_function();
} else {
error_log('plugin is not activated');
die();
}
?>

Fatal error: Call to a member function in product.php

I am new to opencart, so please help me.
I am using opencart version 1.5.6, now whenever I edit and delete the product it shows me
Fatal error: Call to a member function productUpdateListen() on a non-object in /home/crazepur/public_html/admin/controller/catalog/product.php on line 78
and
Fatal error: Call to a member function deleteProduct() on a non-object in /home/crazepur/public_html/admin/controller/catalog/product.php on line 133 respectively.
Although it edit and delete the product.
Please help me how to fix it.
Code in Line 78 $this->openbay->productUpdateListen($this->request->get['product_id'], $this->request->post);
And code in line 133 $this->openbay->deleteProduct($product_id);
This means $this->openbay is not an object which contains function productUpdateListen() & deleteProduct(), probably it's NULL or false in some cases (nothing found) due to it's not accessible. Out of scope.
Try
var_dump($this->openbay);
Check the O/P
it's simple and the error-message says it all: your $this->openbay doesn't have those methods (productUpdateListen() and deleteProduct()) - most likely it isn't an object at all.
please debug your code since it's impossible to say what's going wrong wich so little information. to start, do a var_dump($this->openbay); right before the function-calls and check the output.

Fatal error: Call to undefined function themify_build_write_panels()

I am getting an error when I try to access my site (site on WordPress)
Fatal error: Call to undefined function themify_build_write_panels() in /home/ash/public_html/wp-content/themes/metro/theme- functions.php on line 931
My line 931 is =>
themify_build_write_panels( apply_filters(
'themify_theme_meta_boxes' ,
please help me!!
Thanks :)
This error is occurring because you did not define this function in functions.php
Check if you properly defined this function or not.
Find this function in your functions.php
function themify_build_write_panels(){
//statements
//statements
}
You are right you are new to WordPress but as a developer you should know programming and how functions are used in programming and also how to define them.
Error is transparent that you did not define your function.

Non-object when adding code into html

I am getting the following error:
Fatal error: Call to a member function error() on a non-object in /home/gamepla3/public_html/football/result.php on line 177
The line for this is
<?php echo $form->error("homescore"); ?>
I'm failing to see how this could be the case?
The thing worked fine before I added working code into my html document so it looked better.
Now I can't get it working??
EDIT.
When the code is not within HTML, it works fine.
Once I have it within the HTML, it throws back an error?
Has anyone seen anything like this before?
var_dump($form);
Well, this just require a little & simple debug logic
Confirm $form is a Form object, try this
$class_methods = get_class_methods('form');
foreach ($class_methods as $method_name)
{
echo "$method_name\n";
}
does error is a defined method for Form object?
Based on your comment, the error is not a define method for object Form, so
$form->setError('homescore');
$errors = $form->getErrorArray();
// or $errors = $form->getError();

Categories