رفتن به مطلب

تغییر مکان نمایش افزونه gd star rating


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

با سلام ،

افزونه ی ذکر شده بعد از کد content قسمت ستاره ها و امتیاز دهی ها رو میاره که این برای سایتم مشکل ایجاد میکنه و می خوام در قسمت دلخواه من نمایش داده بشه.

از کد


<?php if(function_exists('the_ratings')) { the_ratings(); } ?>

هم استفاده کردم ولی نتیجه ای نداشت !

اگر کد یا راهکاری دارید ممنون میشم بدید .

لینک به ارسال

تابعی که بکار بردید مربوطه به افزونه wp-postrating هست

برای GD Start Rating از توابع زیر استفاده کنید:


<?php
$postRatingData = wp_gdsr_rating_article(get_the_ID());
gdsr_render_stars_custom(array(
"max_value" => gdsr_settings_get('stars'),
"size" => 12,
"vote" => $postRatingData->rating
));
?>

<? wp_gdsr_render_article_thumbs ($template_id=0, $read_only=false, $stars_set="", $stars_size=0, $stars_set_ie6="", $echo=true); ?>

<?php if(function_exists('wp_gdsr_render_article_thumbs')) { wp_gdsr_render_article_thumbs(array('template_id' => 45)); } ?>

لینک به ارسال

کد دوم و سومی که دادین مربوط به ستاره ها نمیشه و علامت thumb رو میاره .

ولی کد اول ستاره ها رو میاره ولی فقط مقدار امتیازات رو نشون میده که از قبل به مطلب داده شده و امکان کلیک روی ستاره ها برای دادن امتیاز وجود نداره ...

راه حلی وجود داره ؟

لینک به ارسال

اینها رو تست کنید:

<?php if(function_exists('wp_gdsr_render_article')){ wp_gdsr_render_article();} ?> 

if (function_exists('wp_gdsr_render_article')) {
wp_gdsr_render_article(10, false,'',16);
}

لینک به ارسال

ضمن تشکر از کمک تون برای کد ستاره ها ، یه مشکل کوچیک دیگه هم هست.

پایین هر پست به طور اتوماتیک عبارت out of 10 based on 1 rating ... رو میاره و من می خوام این نشون داده نشه . توی تنظیماتش چیزی پیدا نکردم .

چطوری میشه این رو برش داشت؟

لینک به ارسال

متاسفانه بخش مستندات سایت مرجع به علت بروزرسانی در دسترس نیست برای همین نمیشه با اطمینان گفت.

شاید بهتر باشه فعلا اون بخش رو توی کدهای افزونه پیدا و حذف کنید.

لینک به ارسال

این سورس اون بخش هست :


$tpl = apply_filters("gdsr_snippet_template_stars_rating", $tpl, $this->snippet_type);
$votes = $options["votes"];
$hidden = $options["hidden"] ? ' style="display: none !important;"' : '';
$tpl = str_replace("%HIDDEN%", $hidden, $tpl);
$tpl = str_replace("%WORD_BASEDON%", __("based on", "gd-star-rating"), $tpl);
$tpl = str_replace("%WORD_OUTOF%", __("out of", "gd-star-rating"), $tpl);
$tpl = str_replace("%WORD_VOTES%", _n("rating", "ratings", $votes, "gd-star-rating"), $tpl);
$tpl = str_replace("%TITLE%", $options["title"], $tpl);
$tpl = str_replace("%RATING%", $options["rating"], $tpl);
$tpl = str_replace("%MAX_RATING%", $options["max_rating"], $tpl);
$tpl = str_replace("%VOTES%", $votes, $tpl);
$tpl = str_replace("%REVIEW_EXCERPT%", $options["review_excerpt"], $tpl);
return $tpl;

لطف می کنین ویرایش کنین که خروجی نده ؟

(خودم تا 90 درصد پیش رفتم ولی کامل حذف نشد!)

لینک به ارسال

این رو تست کنید:

					    $tpl = apply_filters("gdsr_snippet_template_stars_rating", $tpl, $this->snippet_type);
$votes = $options["votes"];
$hidden = $options["hidden"] ? ' style="display: none !important;"' : '';
$tpl = str_replace("%HIDDEN%", $hidden, $tpl);
//$tpl = str_replace("%WORD_BASEDON%", __("based on", "gd-star-rating"), $tpl);
//$tpl = str_replace("%WORD_OUTOF%", __("out of", "gd-star-rating"), $tpl);
$tpl = str_replace("%WORD_VOTES%", _n("rating", "ratings", $votes, "gd-star-rating"), $tpl);
$tpl = str_replace("%TITLE%", $options["title"], $tpl);
$tpl = str_replace("%RATING%", $options["rating"], $tpl);
$tpl = str_replace("%MAX_RATING%", $options["max_rating"], $tpl);
$tpl = str_replace("%VOTES%", $votes, $tpl);
$tpl = str_replace("%REVIEW_EXCERPT%", $options["review_excerpt"], $tpl);
return $tpl;

لینک به ارسال

کار نکرد مرتضی جان ، خودم تا اینجا ویرایش کردم :


$tpl = apply_filters("gdsr_snippet_template_stars_review", $tpl, $this->snippet_type);
$hidden = $options["hidden"] ? ' style="display: none !important;"' : '';
$tpl = str_replace("%HIDDEN%", $hidden, $tpl);
$tpl = str_replace("%WORD_REVIEWEDBY%", __("reviewed by", "gd-star-rating"), $tpl);
$tpl = str_replace("%WORD_ON%", __("on", "gd-star-rating"), $tpl);
$tpl = str_replace("%WORD_RATING%", __("rating", "gd-star-rating"), $tpl);
$tpl = str_replace("%WORD_OUTOF%", __("out of", "gd-star-rating"), $tpl);
$tpl = str_replace("%TITLE%", $options["title"], $tpl);
$tpl = str_replace("%RATING%", $options["rating"], $tpl);
$tpl = str_replace("%MAX_RATING%", $options["max_rating"], $tpl);
$tpl = str_replace("%REVIEWER%", $options["reviewer"], $tpl);
$tpl = str_replace("%REVIEW_DATE%", $options["review_date"], $tpl);
$tpl = str_replace("%REVIEW_EXCERPT%", $options["review_excerpt"], $tpl);
return $tpl;

و برای تمام مطالب که مثلا 1 رای بهشون داده شده ، عبارت ", ۱ " رو میاره .

لینک به ارسال
  • 4 ماه بعد...

سلام

من نمیدونم باید کدوم خط رو تغییر بدم میشه راهنمایی کنین

فایل رو آپلود کردم

ممنون

http://uploadkon.ir/?file=theme-functions.zip

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

اینها رو تست کنید:

<?php if(function_exists('wp_gdsr_render_article')){ wp_gdsr_render_article();} ?> 

if (function_exists('wp_gdsr_render_article')) {
wp_gdsr_render_article(10, false,'',16);
}

سلام

این کد دومی که اندازه ی ستاره ها رو تعیین کردین

وقتی تویه صفحه ی اصلی سایت استفاده می کنم این نوشته (Rating: 0.0/5 (0 votes cast) رو هم نشون میده

میشه یک کدی بدین که این رو تویه صفحه ی اول نمایش نده

ممنون

لینک به ارسال

به گفتگو بپیوندید

هم اکنون می توانید مطلب خود را ارسال نمایید و بعداً ثبت نام کنید. اگر حساب کاربری دارید، برای ارسال با حساب کاربری خود اکنون وارد شوید .

مهمان
ارسال پاسخ به این موضوع ...

×   شما در حال چسباندن محتوایی با قالب بندی هستید.   حذف قالب بندی

  تنها استفاده از 75 اموجی مجاز می باشد.

×   لینک شما به صورت اتوماتیک جای گذاری شد.   نمایش به صورت لینک

×   محتوای قبلی شما بازگردانی شد.   پاک کردن محتوای ویرایشگر

×   شما مستقیما نمی توانید تصویر خود را قرار دهید. یا آن را اینجا بارگذاری کنید یا از یک URL قرار دهید.

×
×
  • اضافه کردن...