This is a basic PHP error, you need to turn on debugging.
$count_slider
is an Object and not an Integer which is what you are checking for, since you seem to want to compare published posts anyhow , write it like:
<?php if($count_slider->publish > 1)