azad123 46 ارسال شده در فروردین 5، 1395 گزارش اشتراک گذاری ارسال شده در فروردین 5، 1395 سلام دوستان با چه کدی یا افزونه ایی میشه متا تگ keyword و description خودکار از پست گرفت. فقط میخوام توی صفحه single و یا همون ادامه مطلب این کار رو انجام بده. به این صورت که عنوان پست رو تبدیل به keywords کنه. و خط اول متن پست رو تبدیل به description کنه. ممنون لینک به دیدگاه به اشتراک گذاری در سایت های دیگر More sharing options...
azad123 46 ارسال شده در فروردین 5، 1395 مالک گزارش اشتراک گذاری ارسال شده در فروردین 5، 1395 من این پلاگین رو پیدا کردم خوب هم متاتگ میزنه. ولی توی همه صفحات : صفحه اصلی ، پست ها ، برگه ها ، موضوعات و .... من فقط میخوام توی پست ها ایجاد کنه.توی صفحه اصلی و موضوعات و .... متاتگ ایجاد نکنه. کدش رو هم گذاشتن.دوستان مینوتن ویرایش کنند که فقط توی پست ها ایجاد کنه؟ <?php/*Plugin Name: Meta Keywords GeneratorPlugin URI: لینک ها تنها برای اعضای سایت قابل نمایش است. meta-keywords-generator/'> لینک ها تنها برای اعضای سایت قابل نمایش است. meta-keywords-generator/Description:'> لینک ها تنها برای اعضای سایت قابل نمایش است. meta-keywords-generator/'> لینک ها تنها برای اعضای سایت قابل نمایش است. meta-keywords-generator/Description: This plugin helps your SEO by adding meta keywords tag to each page, post, archive (category, tag, date, day and year). Now it also allows you to specify common keywords to be included on every web page. Plugin from one of the best coder <a href="https://go.20script.ir/index.php?url= لینک ها تنها برای اعضای سایت قابل نمایش است. " target="_blank">Durgesh Chaudhary</a>. For any support just leave your question on our <a href="https://go.20script.ir/index.php?url= لینک ها تنها برای اعضای سایت قابل نمایش است. meta-keywords-generator/'> لینک ها تنها برای اعضای سایت قابل نمایش است. meta-keywords-generator/" target="_blank">Meta Keywords Generator</a> page.<br/>Please update some settings to get more benefit <a href="https://go.20script.ir/index.php?url=options-general.php?page=techphernalia">Update settings</a>.Version: 1.11Author: Durgesh ChaudharyAuthor URI: لینک ها تنها برای اعضای سایت قابل نمایش است. */add_action('admin_menu', 'tp_mkg_add_page');add_action('admin_init', 'tp_mkg_register');add_action('wp_head','tp_act');add_action('rightnow_end','tp_notify');function tp_mkg_register(){ register_setting( 'tp_mkg_options', 'tp_mkg_options', 'tp_mkg_options_validate' ); add_settings_section('tp_mkg_main_section', 'Quick Settings', 'tp_mkg_section_main_render', 'techphernalia'); add_settings_field('tp_mkg_compulsary', 'Compulsary Keywords', 'tp_mkg_render_fields', 'techphernalia', 'tp_mkg_main_section');}function tp_mkg_add_page() { add_options_page('Meta Keywords Generator', 'Meta Keywords Generator ', 'manage_options', 'techphernalia', 'tp_mkg_render_page');}function tp_mkg_render_page() { echo '<style>&anchor=tp_promotion span {display: none;}#tp_promotion a{background: url( لینک ها تنها برای اعضای سایت قابل نمایش است. ) left top no-repeat;float: left;width: 32px;height: 32px;margin-right: 10px;}#tp_promotion a.twitter_link{ background-position: left -414px;}#tp_promotion a.facebook_link{background-position: -69px -414px;}</style>'; echo '<div class="wrap"> <center><h2>Meta Keywords Generator Settings</h2></center> We are working continuously to provide you more SEO benefit and here comes the first in this series which allow you to provide some keywords which you want to be available on each and every web page served to your user. Currently we have only one setting we will have more soon.<br/><br/>Feel free to <b>request features</b> on our <a href="https://go.20script.ir/index.php?url= لینک ها تنها برای اعضای سایت قابل نمایش است. " target="_blank">blog</a> or on <a href="https://go.20script.ir/index.php?url= لینک ها تنها برای اعضای سایت قابل نمایش است. meta-keywords-generator/'> لینک ها تنها برای اعضای سایت قابل نمایش است. meta-keywords-generator/" target="_blank">plugin page</a>. <form action="options.php" method="post">'; settings_fields('tp_mkg_options'); do_settings_sections('techphernalia'); echo '<input name="Submit" class="button-primary" type="submit" value="'; esc_attr_e('Save Changes'); echo'" /> </form></div>'; echo '<br/><br/><div id="tp_promotion"><a target="_blank" href="https://go.20script.ir/index.php?url= لینک ها تنها برای اعضای سایت قابل نمایش است. feed/" title="Subscribe to Our RSS feed" class="rss_link"><span>Subscribe to RSS feed</span></a><a href="https://go.20script.ir/index.php?url= لینک ها تنها برای اعضای سایت قابل نمایش است. " target="_blank" title="Follow us on Twitter" class="twitter_link"><span>Follow us on Twitter</span></a><a href="https://go.20script.ir/index.php?url= لینک ها تنها برای اعضای سایت قابل نمایش است. " target="_blank" title="Visit us on Facebook" class="facebook_link"><span>Visit us on Facebook</span></a></div>';}function tp_mkg_section_main_render() {echo '<b>Compulsary Keywords</b> : Comma separated keywords which should appear on all the web page displayed.';}function tp_mkg_render_fields() { $options = get_option('tp_mkg_options'); echo "<textarea id='tp_mkg_compulsary' name='tp_mkg_options[tp_mkg_compulsary]' cols='80' rows='10' maxlength='500' style='max-width:660px;max-height:164px;' >{$options['tp_mkg_compulsary']}</textarea>";}function tp_mkg_options_validate($input) { $temp = trim($input['tp_mkg_compulsary']); $temp = str_replace(";","",$temp); $newinput['tp_mkg_compulsary'] = trim(str_replace("\"","",$temp)); return $newinput;}function tp_notify () { echo '<p>SEO provided by <strong><a href="https://go.20script.ir/index.php?url= لینک ها تنها برای اعضای سایت قابل نمایش است. meta-keywords-generator/'> لینک ها تنها برای اعضای سایت قابل نمایش است. meta-keywords-generator/" target="_blank">Meta Keywords Generator</a></strong> from <a href="https://go.20script.ir/index.php?url= لینک ها تنها برای اعضای سایت قابل نمایش است. " target="_blank">techphernalia.com</a></p>';}function tp_parse ($str) { $str = str_replace("\"","'",$str); $done = str_replace(", "," ",$str); $done = str_replace(" ",", ",$done); if (strpos($str," ")) return $str.", ".$done; else return $str;}function tp_act () { $name = get_option("blogname"); $desc = get_option("blogdescription"); if (is_tag()) $title = single_tag_title('',false); if (is_category()) $title = single_cat_title('',false); if (is_single() || is_page()) { $add = ""; $postid = get_query_var("p"); $post = get_post($postid); $title = single_post_title('',false); $catlist = get_the_category($post->ID); if (is_array($catlist)) { foreach ($catlist as $catlist) { $add .= ", ".$catlist->name; }} $taglist = get_the_tags($post->ID); if (is_array($taglist)) { foreach ($taglist as $taglist) { $add .= ", ".$taglist->name; }} $description = substr(strip_tags($post->post_content),0,200); } $tp_mkg_options=get_option("tp_mkg_options"); echo '<!-- SEO by Meta Keywords Generator : techphernalia.com v1.11 start-->'; if (!is_home()) { echo '<meta name="keywords" content="'.tp_parse($title).', '.tp_parse($name).$add.", ".$tp_mkg_options["tp_mkg_compulsary"].'" /><meta name="description" content="'.str_replace("\"","'",strip_shortcodes( $description )).'" />'; } else { echo '<meta name="keywords" content="'.tp_parse($desc).', '.$name.", ".$tp_mkg_options["tp_mkg_compulsary"].'" /><meta name="description" content="'.str_replace("\"","'",strip_shortcodes( $desc )).'" />'; } echo '<!-- SEO by Meta Keywords Generator : techphernalia.com v1.1 end-->';}?> لینک به دیدگاه به اشتراک گذاری در سایت های دیگر More sharing options...
laruz 983 ارسال شده در فروردین 6، 1395 گزارش اشتراک گذاری ارسال شده در فروردین 6، 1395 پیشنهاد میشه اینکار رو نکنین. همون کدای قبلی که تحویلتون دادم فقط is_single()یه جای مثلا is_home() بنویسید. موفق باشید لینک به دیدگاه به اشتراک گذاری در سایت های دیگر More sharing options...
azad123 46 ارسال شده در فروردین 6، 1395 مالک گزارش اشتراک گذاری ارسال شده در فروردین 6، 1395 پیشنهاد میشه اینکار رو نکنین.همون کدای قبلی که تحویلتون دادم فقط is_single()یه جای مثلا is_home() بنویسید. موفق باشید ممنون.نه این رو برام اوکی کنین اگه امکانش هست. لینک به دیدگاه به اشتراک گذاری در سایت های دیگر More sharing options...
AynaZ 4,157 ارسال شده در فروردین 8، 1395 گزارش اشتراک گذاری ارسال شده در فروردین 8، 1395 طبق گفته ی فرهنگ عزیز نبایست اینکارو کنین ولی بهترینش این هست در فایل functions.php خودتون بزارین ( یه کپی از فایل داشه باشین ) <?php function create_meta_desc() { global $post;if (!is_single()) { return; } $meta = strip_tags($post->post_content); $meta = strip_shortcodes($post->post_content); $meta = str_replace(array("\n", "\r", "\t"), ' ', $meta); $meta = substr($meta, 0, 125); echo "<meta name='description' content='$meta' />";}add_action('wp_head', 'create_meta_desc'); ?> اسکریپت اینکارم هس لینک به دیدگاه به اشتراک گذاری در سایت های دیگر More sharing options...
پست های پیشنهاد شده
بایگانی شده
این موضوع بایگانی و قفل شده و دیگر امکان ارسال پاسخ نیست.