رفتن به مطلب

از بین بردن اروری در فوتر


win70

پست های پیشنهاد شده

سلام

دوستان توی فوتر سایت یک اروری وجود داره ، من دنبالش گشتم پیداش کردم اما با حذفش قالب بهم میخوره ، کسی هست بتونه کمک کنه؟

ارور هم اینه:

Warning

: Missing argument 2 for wpdb::prepare(), called in /home/saeedb/public_html/blog/wp-content/themes/inove/footer.php on line 24 and defined in

/home/saeedb/public_html/blog/wp-includes/wp-db.php

on line

992

لینک به ارسال

 </div>

<!-- main END -->

<?php

$options = get_option('inove_options');

global $inove_nosidebar;

if(!$options['nosidebar'] && !$inove_nosidebar) {

get_sidebar();

}

?>

<div class="fixed"></div>

</div>

<!-- content END -->

<!-- footer START -->

<div id="footer">

<a id="gotop" href="#" onclick="MGJS.goTop();return false;"><?php _e('Top', 'inove'); ?></a>

<a id="powered" href="http://wordpress.org...">WordPress</a>

<div id="copyright">

<?php

global $wpdb;

$post_datetimes = $wpdb->get_row($wpdb->prepare("SELECT YEAR(min(post_date_gmt)) AS firstyear, YEAR(max(post_date_gmt)) AS lastyear FROM $wpdb->posts WHERE post_date_gmt > 1970"));

if ($post_datetimes) {

$firstpost_year = $post_datetimes->firstyear;

$lastpost_year = $post_datetimes->lastyear;

$copyright = __('Copyright © ', 'inove') . $firstpost_year;

if($firstpost_year != $lastpost_year) {

$copyright .= '-'. $lastpost_year;

}

$copyright .= ' ';

echo $copyright;

bloginfo('name');

}

?>

<?php printf("نسخه 1.0.2 "); ?>

</div>

</div>

</div>

<!-- footer END -->

</div>

<!-- container END -->

</div>

<!-- wrap END -->

<?php

wp_footer();

$options = get_option('inove_options');

if ($options['analytics']) {

echo($options['analytics_content']);

}

?>

</body>

</html>

اینم آدرس هست که ارور رو در پایین مشاهده می کنید :

blog.sefr-yek.com

ممنون

ویرایش شده توسط Morteza
لینک به ارسال

این تکه کد رو از توی کد هاتون حذف کنید درست میشه.


<div id="copyright">
<?php
global $wpdb;

$post_datetimes = $wpdb->get_row($wpdb->prepare("SELECT YEAR(min(post_date_gmt)) AS firstyear, YEAR(max(post_date_gmt)) AS lastyear FROM $wpdb->posts WHERE post_date_gmt > 1970"));

if ($post_datetimes) {
$firstpost_year = $post_datetimes->firstyear;
$lastpost_year = $post_datetimes->lastyear;
$copyright = __('Copyright © ', 'inove') . $firstpost_year;
if($firstpost_year != $lastpost_year) {
$copyright .= '-'. $lastpost_year;
}
$copyright .= ' ';
echo $copyright;
bloginfo('name');
}
?>
<?php printf("نسخه 1.0.2 "); ?>
</div>

اگر هم قصد حذف کردن ندارین منتظر پاسخ دوستان دیگه باشید.

  • امتیاز 1
لینک به ارسال

سلام

ببینید این نوع کد برای کپی رایت سال اولین پست و آخرین پست رو نشون میده

مثلا:

Copy Right 2010 - 2012

همون‌طور که اشکان گفت می‌تونید اون رو تغییر بدید و یک تکه کد فوتر ساده مثل اون رو امتحان کنید

این کد رو:


<?php
global $wpdb;
$post_datetimes = $wpdb->get_row($wpdb->prepare("SELECT YEAR(min(post_date_gmt)) AS firstyear, YEAR(max(post_date_gmt)) AS lastyear FROM $wpdb->posts WHERE post_date_gmt > 1970"));
if ($post_datetimes) {
$firstpost_year = $post_datetimes->firstyear;
$lastpost_year = $post_datetimes->lastyear;
$copyright = __('Copyright © ', 'inove') . $firstpost_year;
if($firstpost_year != $lastpost_year) {
$copyright .= '-'. $lastpost_year;
}
$copyright .= ' ';
echo $copyright;
bloginfo('name');
}
?>
<?php printf("نسخه 1.0.2 "); ?>

به این کد تغییر بدید


<?php echo('Copyright © ') ?><?php echo date('Y');?><?php echo(' . All rights reserved') ?>

البته باز هم راه حل نشد ^_^

  • امتیاز 1
لینک به ارسال
  • 1 سال بعد...

من یه قالب نصب کردم هر کاری میکنم سایت error میده

اینم کد footer

<?php global $theme; ?>

<?php if($theme->display('footer_widgets')) { ?>
<div id="footer-widgets" class="clearfix">
<?php
/**
* Footer Widget Areas. Manage the widgets from: wp-admin -> Appearance -> Widgets
*/
?>
<div class="footer-widget-box">
<?php
if(!dynamic_sidebar('footer_1')) {
$theme->hook('footer_1');
}
?>
</div>

<div class="footer-widget-box">
<?php
if(!dynamic_sidebar('footer_2')) {
$theme->hook('footer_2');
}
?>
</div>

<div class="footer-widget-box footer-widget-box-last">
<?php
if(!dynamic_sidebar('footer_3')) {
$theme->hook('footer_3');
}
?>
</div>

</div>
<?php } ?>
<div id="footer">

<div id="copyrights">
<?php
if($theme->display('footer_custom_text')) {
$theme->option('footer_custom_text');
} else {
?> © <?php echo date('Y'); ?> <a href="<?php echo home_url(); ?>/"><?php bloginfo('name'); ?></a><?php
}
?>
</div>

<div id="farsweb"><a title="wordpress themes" href="http://www.farsweb.net" target="_blank">Design Farsweb</a></div>
</div><!-- #footer -->

</div><!-- #container -->
<?php wp_footer(); ?>
<?php $theme->hook('html_after'); ?>
</body>
</html>

یه کلمه رو دست میزنم error میده یکی کمک کنه لازم این تبلیغ رو پاک کنم ( farsweb )

لینک به ارسال

لطفا برای ارسال دیدگاه وارد شوید

شما بعد از اینکه وارد حساب کاربری خود شدید می توانید دیدگاهی ارسال کنید



ورود به حساب کاربری
×
×
  • اضافه کردن...