انجمن


تغییر کلمه ادامه مطلب  (۱۰ نوشته)

  • mrjaber2

    آفلاین
    عضو
    تعداد نوشته‌ها: ۴۲
    تشکر شده: ۷ بار
    # نوشته شده: ۱۱ سال پیش
    ۲۷ خرداد ۱۳۹۱ - ۱۶:۰۰

    سلام
    من از قالب انگلیسی استفاده میکنم میخواستم جای reading more بنویسم تونستم تغییر بدم ولی فونت فارسی رو نشون نمیده تو سایت اینجوری میشه ����� ���� →
    اگه درست نمیشه یا خیلی کار داره پس
    چطور میشه عکس یا ایکون گذاشت بجاش ؟اگه میشه راهنمایی کنید
    ممنون میشم

    کاربران زیر به‌خاطر این نوشته تشکر کرده‌اند:
    Mojtaba in96
  • Mojtaba in96

    آفلاین
    عضو
    تعداد نوشته‌ها: ۳۲۵
    تشکر شده: ۱۳۰ بار
    # نوشته شده: ۱۱ سال پیش
    ۲۷ خرداد ۱۳۹۱ - ۱۸:۰۰

    mrjaber2 گفت:
    سلام
    من از قالب انگلیسی استفاده میکنم میخواستم جای reading more بنویسم تونستم تغییر بدم ولی فونت فارسی رو نشون نمیده تو سایت اینجوری میشه ����� ���� →
    اگه درست نمیشه یا خیلی کار داره پس
    چطور میشه عکس یا ایکون گذاشت بجاش ؟اگه میشه راهنمایی کنید
    ممنون میشم

    اینکارو انجام بده به جای

    <?php the_content(''); ?>

    از

    <?php the_content('<div style="display:none">{...}</div>'); ?>

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

    <a href="<?PHP the_permalink() ?>">
    <?php
    if(preg_match('~#more-~i', get_the_content())) {
    echo ' ادامه این مطلب ';
    }
    ?> </a>

    ب جای کلمه ی ادامه مطلب کلمه ی مورد نظر خودتو بذاری یا جاش عکس یا هرچی خودت میخوای بذار ...

  • mrjaber2

    آفلاین
    عضو
    تعداد نوشته‌ها: ۴۲
    تشکر شده: ۷ بار
    # نوشته شده: ۱۱ سال پیش
    ۲۸ خرداد ۱۳۹۱ - ۱۱:۰۶

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

    function art_get_content($args = array()) {
    	$more_tag = art_get_array_value($args, 'more_tag', __('Continue reading <span class="meta-nav">&rarr;</span>', THEME_NS));
    	return art_get_the_content($more_tag . wp_link_pages(array('echo' => 0)));
    }
    
    function art_get_excerpt($args = array()) {
    	global $post;
    	$more_tag = art_get_array_value($args, 'more_tag', __('Continue reading <span class="meta-nav">&rarr;</span>', THEME_NS));
    	$auto = art_get_array_value($args, 'auto', art_get_option('art_metadata_excerpt_auto'));
    	$all_words = art_get_array_value($args, 'all_words', art_get_option('art_metadata_excerpt_words'));
    	$min_remainder = art_get_array_value($args, 'min_remainder', art_get_option('art_metadata_excerpt_min_remainder'));
    	$allowed_tags = art_get_array_value($args, 'allowed_tags',
    		(art_get_option('art_metadata_excerpt_use_tag_filter')
    			? explode(',',str_replace(' ', '', art_get_option('art_metadata_excerpt_allowed_tags')))
    			: null));
    	$perma_link = get_permalink($post->ID);
    	$more_token = '%%art-more%%';
    	$show_more_tag = false;
    	if (function_exists('post_password_required') && post_password_required($post)){
    		return get_the_excerpt();
    	}
    	if ($auto && has_excerpt($post->ID)) {
    		$the_contents = get_the_excerpt();
    		$the_contents = apply_filters('the_content', $the_contents);
    		$show_more_tag = strlen($post->post_content) > 0;
    	} else {
    		$the_contents = art_get_the_content($more_token);
    		if(art_is_empty_html($the_contents)) return $the_contents;
    		if ($allowed_tags !== null) {
    			$allowed_tags = '<' .implode('><',$allowed_tags).'>';
    			$the_contents = strip_tags($the_contents, $allowed_tags);
    		}
    		$the_contents = strip_shortcodes($the_contents);
    		if (strpos($the_contents, $more_token) !== false) {
    			return str_replace($more_token, $more_tag, $the_contents);
    		}
    		if($auto && is_numeric($all_words)) {
    			$token = "%art_tag_token%";
    			$content_parts = explode($token, str_replace(array('<', '>'), array($token.'<', '>'.$token), $the_contents));
    			$content = array();
    			$word_count = 0;
    			foreach($content_parts as $part)
    			{
    				if (strpos($part, '<') !== false || strpos($part, '>') !== false){
    					$content[] = array('type'=>'tag', 'content'=>$part);
    				} else {
    					$all_chunks = preg_split('/([\s])/u', $part, -1, PREG_SPLIT_DELIM_CAPTURE);
    					foreach($all_chunks as $chunk) {
    						if('' != trim($chunk)) {
    							$content[] = array('type'=>'word', 'content'=>$chunk);
    							$word_count += 1;
    						} elseif($chunk != '') {
    							$content[] = array('type'=>'space', 'content'=>$chunk);
    						}
    					}
    				}
    			}
    
    			if(($all_words < $word_count) && ($all_words + $min_remainder) <= $word_count) {
    				$show_more_tag = true;
    				$current_count = 0;
    				$the_contents = '';
    				foreach($content as $node) {
    					if($node['type'] == 'word') {
    						$current_count++;
    					}
    					$the_contents .= $node['content'];
    					if ($current_count == $all_words){
    						break;
    					}
    				}
    			}
    			$the_contents = force_balance_tags($the_contents);
    		}
    	}
    	if ($show_more_tag) {
    		$the_contents = $the_contents.'<p><a class="more-link" href="'.$perma_link.'">'.$more_tag.'</a></p>';
    	}
    
    	return $the_contents;
    }
    بجای کدوم بزارم؟اینو پاک کنم کد شما دادین رو قرار بدم؟

  • Mojtaba in96

    آفلاین
    عضو
    تعداد نوشته‌ها: ۳۲۵
    تشکر شده: ۱۳۰ بار
    # نوشته شده: ۱۱ سال پیش
    ۲۸ خرداد ۱۳۹۱ - ۱۵:۱۵

    تو فایل index.php
    باید بگردی
    اگه فایل های
    archive.php
    category
    tag
    search
    v ..

    هم هست اونا رو هم همینطور ...

  • best designer

    آفلاین
    عضو
    تعداد نوشته‌ها: ۵۵۲
    تشکر شده: ۲۸۵ بار
    # نوشته شده: ۱۱ سال پیش
    ۲۸ خرداد ۱۳۹۱ - ۱۸:۳۰

    داداش اینطوری نمیشه که .

    اولا که آدرس سایت نزاشتی تا ببینیم این که گفتی reading more رو تغییر میدی ����� ���� → میشه کلا همه نوشته های فارسی اونجوری میشه ؟

    و بعد از اون ( دوما ) ادامه مطلب رو میتونی توی index.php پیدا کنی . اگه اونجا نبود فانکشین رو بگرد .

    و اگه هیچ کدوم اونا نتونستی پیدا کنی میتونی قالب رو برام بفرستی درستش کنم برات : tanha_an_7001@yahoo.com

  • mrjaber2

    آفلاین
    عضو
    تعداد نوشته‌ها: ۴۲
    تشکر شده: ۷ بار
    # نوشته شده: ۱۱ سال پیش
    ۲۸ خرداد ۱۳۹۱ - ۲۱:۳۹

    نه توفایل فانکشن هستش و اون قسمتی رو که به ادامه مطلب ربط داره که کپی کردم اینجا!
    این خطه
    $more_tag = art_get_array_value($args, 'more_tag', __('Continue reading <span class="meta-nav">→</span>', THEME_NS))

    که بجای Continue reading یه چیز دیگه قرار میدم همهچیز درسته عوض هم میشه ولی به جای این فارسی مینویسم نشون نمیده
    -فونت سایتم خوبه فارسیش درسته همه ی متن ها و بلوک ها و فوتر و...

  • best designer

    آفلاین
    عضو
    تعداد نوشته‌ها: ۵۵۲
    تشکر شده: ۲۸۵ بار
    # نوشته شده: ۱۱ سال پیش
    ۳۰ خرداد ۱۳۹۱ - ۱۵:۵۹

    خوب احتمالا این اصلا اون نیست . شما لطف کن بجای فارسی یه چیز انگلیسی بنویس ببین تغییر میکنه اصلا ؟

    اگه تغییر کرد برو از روی سرورت فانکشین رو ادیت کن . و فارسی بنویس ببین چی میشه

  • Mojtaba in96

    آفلاین
    عضو
    تعداد نوشته‌ها: ۳۲۵
    تشکر شده: ۱۳۰ بار
    # نوشته شده: ۱۱ سال پیش
    ۳۰ خرداد ۱۳۹۱ - ۲۱:۲۲

    city-sound گفت:
    خوب احتمالا این اصلا اون نیست . شما لطف کن بجای فارسی یه چیز انگلیسی بنویس ببین تغییر میکنه اصلا ؟
    اگه تغییر کرد برو از روی سرورت فانکشین رو ادیت کن . و فارسی بنویس ببین چی میشه

    دوست عزیز چرا این رفیقمون میپیچونی ...
    چرا می فرستی فانکشن قالب و ...

    یه کد ساده دارم استفاده کنه مشکلش حل

    داداش کد index.php بذار اینجا برات درست کنم ;-)

    کاربران زیر به‌خاطر این نوشته تشکر کرده‌اند:
    Saeed Fard
  • mrjaber2

    آفلاین
    عضو
    تعداد نوشته‌ها: ۴۲
    تشکر شده: ۷ بار
    # نوشته شده: ۱۱ سال پیش
    ۳۱ خرداد ۱۳۹۱ - ۱۸:۰۳

    بفرمایید

    <?php get_header(); ?>
    <div class="art-content-layout">
        <div class="art-content-layout-row">
            <div class="art-layout-cell art-sidebar1">
              <?php get_sidebar('default'); ?>
              <div class="cleared"></div>
            </div>
            <div class="art-layout-cell art-content"><?php
     //Code automatically inserted by Featurific for Wordpress plugin
     if(is_home())                             //If we're generating the home page (remove this line to make Featurific appear on all pages)...
      if(function_exists('insert_featurific')) //If the Featurific plugin is activated...
       insert_featurific();                    //Insert the HTML code to embed Featurific
    ?>
    			<?php
    			  get_sidebar('top');
    			  global $post;
    			  if (have_posts()){
    				while (have_posts())
    				{
    					the_post();
    					art_post_wrapper(
    						array(
    								'id' => art_get_post_id(),
    								'class' => art_get_post_class(),
    								'thumbnail' => art_get_post_thumbnail(),
    								'title' => '<a href="'.get_permalink($post->ID).'" rel="bookmark" title="'.get_the_title().'">'.get_the_title().'</a>',
    								'before' => art_get_metadata_icons('date,author', 'header'),
    								'content' => art_get_excerpt(), // 'content' => 'My post content',
    								'after' => art_get_metadata_icons('category,tag,comments', 'footer')
    						)
    					);
    				}
    				art_pagination();// previous_posts_link | next_posts_link
    			  } else {
    				art_post_wrapper(
    					array(
    							'title' => __('Not Found', THEME_NS),
    							'content' => '<p class="center">'
    							.__( 'Apologies, but the page you requested could not be found. Perhaps searching will help.', THEME_NS)
    							. '</p>' . "\r\n" . art_get_search()
    					)
    				);
    			  }
    			  get_sidebar('bottom');
    			?>
              <div class="cleared"></div>
            </div>
            <div class="art-layout-cell art-sidebar2">
              <?php get_sidebar('secondary'); ?>
              <div class="cleared"></div>
            </div>
        </div>
    </div>
    <div class="cleared"></div>
    <?php get_footer();
  • Saeed Fard

    آفلاین
    ناظم
    تعداد نوشته‌ها: ۹۸۲
    تشکر شده: ۱۶۱۵ بار
    # نوشته شده: ۱۱ سال پیش
    ۱ تیر ۱۳۹۱ - ۰۰:۰۵

    درود ;

    دوست عزيز شما كاري كه خودتون توي پست اول گفتيد رو انجام بديد درست ميشه ، فقط به اين صورت كه كد‌هارو توي NotePad كپي كنيد و بعد اون رو سيو كنيد و در هنگام سيو Encoding رو روي UTF-8 قرار بديد ، اسمش رو به نام فايل مورد نظرتون با پسوند .php تغيير بديد و فايل قبلي رو حذف و اين فايل رو آپلود كنيد ..

    موفق باشيد ../.

درباره‌ی این موضوع



برچسب‌ها

هیچ برچسبی نیست.