উপর 2 years ago I published an article on how to fix problems with WordPress themes which didn’t pass the Google Rich Snippets Testing Tool. ওয়ার্ডপ্রেস এবং সবচেয়ে থিম ভাল সমর্থন আছে - তারপর থেকে অনেক পরিবর্তন হয়েছে, HTML5 এর CSS 3 আগত আছে, এবং গুগল, Yahoo and Bing got together and decided to focus on Microdata, schema.org মাধ্যমে. সময়ে Microformats পেজ বাড়ান সবচেয়ে সহজ উপায় করলো, এবং টেস্টিং টুল এই জন্য সর্বাত্মক সমর্থন ছিল. Microdata করার পদক্ষেপ এবং ওয়ার্ডপ্রেস পরিবর্তন একটি নতুন নিবন্ধ প্রয়োজন: এই হল এটা!
পরিবর্তে বিভিন্ন থিম জন্য পৃথক নিবন্ধ প্রচুর থাকার আমি এ সমস্ত তথ্য প্রদান করার চেষ্টা করার সিদ্ধান্ত নিয়েছে করেছি 1 পথপ্রদর্শক. This makes it easier to keep up to date, এবং ঠিক আছে মানে 1 সব অনুরোধ ও আলোচনার জন্য কেন্দ্রীয় বিন্দু. It also makes more sense as several of the steps are the same regardless of what theme you are using. I’m not going to cover all the optional extras in this article, শুধু বুনিয়াদি আপনার সাইট হাতিয়ার সঙ্গে বৈধতা যাচাই পেতে. আপনি খুঁজে উচিত পরিচালিত করেছি অতিরিক্ত মার্কআপ যোগ তুলনামূলকভাবে সহজ. So lets get started…
আপনার সাইটে আপনার Google প্রোফাইল থেকে একটি লিঙ্ক যুক্ত করুন
আপনি দেখতে হবে আমার Google PRO-ফাইল আমি একটি পাব-LIC লিঙ্ক আছে HTTPS://diymediahome.org - আপনি আপনার নিজের সাইটের জন্য একই হবে. মূলত আপনি এই হিসাবে একই ভাবে আপনার সাইট সাথে সংযুক্ত করা হয় যে একটি Google প্রোফাইল আছে আপনার লেখক সব প্রয়োজন হবে.
- লগ ইন আপনার গুগল PRO-ফাইল
- আপনি দেখতে না হওয়া পর্যন্ত স্ক্রোল ডাউন লিঙ্ক কোথাও পৃষ্ঠার নীচের অংশে ডান দিকে অধ্যায়
- ক্লিক করুন সম্পাদন করা লিংক
- অধীন contributor to সেকে-tion ক্লিক Cus-টম লিঙ্ক যুক্ত করুন
- লেখার অধিকার নিশ্চিত বাক্স করুন contributor to সেট করা হয় public
- আপনার সাইটের নাম লিখুন (উদাঃ. DIY মিডিয়া হোম) ও ঠিকানা (উদাঃ. HTTPS://diymediahome.org)
- সংরক্ষণ ক্লিক করুন
আপনার Google প্রোফাইলে আপনার সাইট থেকে একটি লিঙ্ক যুক্ত করুন
এখন আমরা আপনার Google প্রোফাইলে আপনার লেখক পাতা থেকে একটি লিঙ্ক যুক্ত করতে হবে. আছে 2 Altern-এ তোমার প্রতি যা করতে উপায়, আমি অত্যন্ত Yoast ব্যবহার জীবনটা কেন মেরামত করা এই PLU-জিন.
- ইনস্টল করুন Yoast এই PLU-জিন বা আপনার থিমের functions.php ফাইলে নিচের কোড যুক্ত123456789function update_contactmethods( $contactmethods ) {// Add Google Profiles$contactmethods['googleplus'] = 'Google+';// Add Twitter$contactmethods['twitter'] = __( 'Twitter username (without @)', 'wordpress-seo' );return $contactmethods;}add_filter( 'user_contactmethods', 'update_contactmethods', 10, 1);
- ওয়ার্ডপ্রেস অ্যাডমিন ইন্টারফেস আপনার লেখক প্রোফাইল এ যান (hover over ব্যবহারকারীরা বাম দিকের মেনুতে, এবং ক্লিক করুন আপনার প্রো-ফাইল)
- মধ্যে Google+ এ ক্ষেত্রের আপনার Google PRO-ফাইলের একটি লিঙ্ক যুক্ত (উদাঃ. HTTPS://plus.google.com/104657888470728381512 /)
- আপনি হয় তা নিশ্চিত করুন, or your other site authors do the same thing, and each link to your own google profiles
- এখন, আপনি Yoast PLU-জিন ব্যবহার করছেন, যান এই মেনু এবং নির্বাচন নমুনা এ থেকে জেড এবং গোল, গপ্রথম লেহন বাড়ি পৃষ্ঠার উপরের এবং মেনু উচ্চ হালকা হয়-ing লেখক পতনযোগ্য বাক্স আপনি হোমপেজে লেখক হিসেবে ব্যবহার করতে চান ব্যবহারকারী নির্বাচন
- আপনি নিজে header.php নিম্নলিখিত কোড যোগ করতে হবে Yoast প্লাগিন ব্যবহার করে না সম্পর্কে সনির্বন্ধ হন (আপনি এক আছে রোস্ট-ing). Don’t forget to change my google profile url to yours. This code will use the post author’s google profile url if there is a valid one, এবং একটি ডিফল্ট ব্যবহার করতে হবে (আপনার) আছে না হলে.1<link rel="author" href="<?php $gplus = 'https://plus.google.com/115369062315673853712/posts'; if ( is_singular() ) {global $post; $gplus = get_the_author_meta( 'googleplus', $post->post_author );} echo $gplus; ?>"/>
Fix errors of a missing “updated” field
অধিকাংশ ওয়ার্ডপ্রেস থিম পোস্ট পোস্টের তথ্য এলাকা প্রকাশিত হয় যখন সম্পর্কে তথ্য অন্তর্ভুক্ত, এটি শেষ আপডেট যখন কিন্তু খুব কম এছাড়াও অন্তর্ভুক্ত. এটি একটি দু: খের বিষয় হল, because updated is required whereas published actually isn’t! এটা যদিও সহজ যোগ করার পদ্ধতি, এবং আবার, আছে 2 উপায়, the proper way and the quick hack way. I recommend the proper way of course, কিন্তু প্রয়োজনে আপনি দ্রুত হ্যাক যাও অবলম্বন করতে পারে. আমরা একই সময়ে Microformats থেকে Microdata পরিবর্তন চলুন.
সঠিক উপায়
We’re going to add some additional information to post headers, উভয় সার্চ ইঞ্জিনের জন্য এবং আমাদের সামনি এটি ors জন্য. আমরা পোস্টের জন্য এই কাজ করতে হবে, পৃষ্ঠাসমূহ, আর্কাইভ এবং হোমপেজে.
- আমরা প্রকাশিত লিঙ্ক তৈরি করে যা কোড ধারণকারী ফাইল খুঁজে প্রয়োজন. এই প্রায় অবশ্যই ওয়ার্ডপ্রেস ফাংশন ব্যবহার করতে হবে get_the_date(). আপনি আপনার থিম ফাইল মাধ্যমে অনুসন্ধান করতে পারেন, or refer to theme specific details below where I have provided details for lots of themes
- প্রকাশিত এবং আপডেট তারিখগুলি একই হলে আমরা চেক যাচ্ছে. তারা যদি আমরা শুধু অতিরিক্ত যোগ হবে dateUp-তারিখের itemprop but if they are different we will output some extra text to the visitor
- আমরা fol কম হয়-ing যুক্ত করতে যাচ্ছেন (and modify it as it explains)1234567891011121314151617<?php if(get_the_date()==get_the_modified_date()): ?>//we're going to use the original code just with the updated class added//put your theme's original code here//remove any class=""//add itemprop="datePublished dateCreated dateModified" to the HTML tag surrounding the get_the_date() function<?php else: ?>//we're going to use slightly code just with the updated date added//copy your theme's original code to here and then modify it as below//remove any class=""//add itemprop="datePublished dateCreated" to the HTML tag surrounding the get_the_date() function//add in a new html tag into the line where you want it to appear as below//Updated <?php echo get_the_modified_date() ?><?php endif; ?>
- You’ll either have to figure out the original theme’s code and edit it, or refer to the details for specific themes below.
- আপনি একাধিক ফাইল জন্য এই সম্পাদনা পুনরাবৃত্তি করতে হতে পারে
দ্রুত হ্যাক
আমরা আপডেট তারিখ হিসাবে প্রকাশিত তারিখ ঠকাই এবং সরবরাহ চলুন, পোস্ট আসলে আরো সম্প্রতি আপডেট করা হয়েছে, এমনকি যদি. পোস্ট আপডেট করা হয়েছে, তাহলে আমরা আসলে ভুল তথ্য সরবরাহ করা হবে, কিন্তু এটি এখনও Val-ID-ate হবে. এটা সত্যিই সম্ভব যদি সঠিকভাবে তা ভালো, আপনি এটা করছেন নেভিগেশন সনির্বন্ধ হন তাহলে কিন্তু এই পথে পড়া. আমরা পোস্টের জন্য এই কাজ করতে হবে উপরোক্ত হিসাবে, পৃষ্ঠাসমূহ, আর্কাইভ এবং হোমপেজে.
- আমরা প্রকাশিত লিঙ্ক তৈরি করে যা কোড ধারণকারী ফাইল খুঁজে প্রয়োজন উপরোক্ত হিসাবে. এই প্রায় অবশ্যই ওয়ার্ডপ্রেস ফাংশন ব্যবহার করতে হবে get_the_date(). আপনি আপনার থিম ফাইল মাধ্যমে অনুসন্ধান করতে পারেন, অথবা আমি থিম প্রচুর জন্য বিবরণ প্রদান করে থাকেন যেখানে নীচের টেবিলে পড়ুন
- সন্ধান এইচটিএমএল তারিখ উপরি - চক্রের যে Ele-ment (প্রায়ই এটা করতে হবে
class="published"
). - বর্গ অপসারণ এবং পরিবর্তে নিম্নলিখিত যুক্ত করে উপাদান সম্পাদনা করুন
itemprop="datePublished dateCreated dateUpdated"
- উপরোক্ত হিসাবে, আপনি একাধিক ফাইল এই সম্পাদনা পুনরাবৃত্তি করার প্রয়োজন হতে পারে
প্রতিস্থাপন করা হচ্ছে বিল্ট-ইন মাইক্রোবিন্যাসের (কারণ সমৃদ্ধ স্নিপেট ফরম্যাটের মিশ জিনিষ ভঙ্গ)
ডিফল্ট ওয়ার্ডপ্রেস দ্বারা এখনও মন্তব্যের জন্য microformat মার্কআপ ব্যবহার করছে, দুঃখজনকভাবে ইসলাম ভালো জিনিস Microdata মার্কআপ বিরতি যা মনে. এই সমাধানের সর্বোত্তম উপায় microformat মার্কআপ সরিয়ে Microdata মার্কআপ সঙ্গে এটি প্রতিস্থাপন করা হয়. শিশুরা-Tu-nately, এই সম্পর্কে tinkering একটি বিট প্রয়োজন তাই এই মার্কআপ উত্পাদন যে ওয়ার্ডপ্রেস কোর ফাংশন একটি সুবিধামত অবস্থিত ফিল্টার বা হুক হবে না.
মন্তব্য বিভাগে vCard প্রতিস্থাপন করা হচ্ছে
- আমরা কি করতে যাচ্ছেন মন্তব্য আউটপুট পরিবর্তন একটি মন্তব্য কলব্যাক ব্যবহার হয়. Many themes already use a callback which we can modify, এবং তা চান না যে তাদের জন্য আমরা ওয়ার্ডপ্রেস ডিফল্ট উপর ভিত্তি করে এক যুক্ত করতে হবে
- আপনি থিম ইতিমধ্যে একটি মন্তব্য কলব্যাক হয়েছে থাকে চেক করুন - ফাংশন জন্য আপনার থিম ফাইল অনুসন্ধান
wp_list_comments
. এটা কোড অন্তর্ভুক্ত থাকেcallback=
অথবা'callback' =>
তারপর এটি আপনাকে খুঁজে পাওয়া সম্ভব হবে, যা একটি কলব্যাক ব্যবহার করছে (prob-দক্ষতার সহিত functions.php মধ্যে) কলব্যাক ফাংশন নাম খুঁজছেন দ্বারা, = সাইন বা তীর পরে অংশ যা হয়, উদাঃ.wp_list_comments( array( 'callback' => 'twentyten_comment' ) );
অথবাwp_list_comments('type=comment&callback=bones_comments');
. If it doesn’t then we will need to add one by addingcallback=diymh_comment
অথবাarray( 'callback' => 'diymh_comment' )
লাইন. - আপনি একটি মন্তব্য কলব্যাক যোগ করা প্রয়োজন, তাহলে আপনি functions.php নিম্নলিখিত কোড যোগ করতে হবে123456789101112131415161718192021222324function diymh_comment($comment, $args, $depth) {$GLOBALS['comment'] = $comment; ?><li <?php comment_class(); ?> id="li-comment-<?php comment_ID() ?>"><div id="comment-<?php comment_ID(); ?>"><div class="comment-author novcard"><?php echo get_avatar($comment,$size='48',$default='<path_to_url>' ); ?><?php printf(__('<cite class="fn">%s</cite> <span class="says">says:</span>'), get_comment_author_link()) ?></div><?php if ($comment->comment_approved == '0') : ?><em><?php _e('Your comment is awaiting moderation.') ?></em><br /><?php endif; ?><div class="comment-meta commentmetadata"><a href="<?php echo htmlspecialchars( get_comment_link( $comment->comment_ID ) ) ?>"><?php printf(__('%1$s at %2$s'), get_comment_date(), get_comment_time()) ?></a><?php edit_comment_link(__('(Edit)'),' ','') ?></div><?php comment_text() ?><div class="reply"><?php comment_reply_link(array_merge( $args, array('depth' => $depth, 'max_depth' => $args['max_depth']))) ?></div></div><?php}
- আপনি এই কোড একটি আছে লক্ষ্য করবেন
class="novcard"
instead of the originalclass="vcard".
- আপনার থিম নিজস্ব কলব্যাক আছে কি যদি আপনি কলব্যাক ফাংশন খুঁজে পেতে এবং কোনো দৃষ্টান্ত প্রতিস্থাপন করতে হবে
class="vcard"
সঙ্গেclass="novcard"
হেডারের মধ্যে hfeed প্রতিস্থাপন করা হচ্ছে
- পরবর্তী, আমরা যে কোনো স্থানেই সরিয়ে ফেলা আবশ্যক
class="hfeed"
, যা ব্যবহার-মিত্র header.php পাওয়া যায়. সব ঘটতে-rences এর প্রতিস্থাপন করুনhfeed
সঙ্গেnohfeed
প্রতিস্থাপন করা হচ্ছে hentry এবং শিরোনাম রিচ স্নিপেট
- আমরা functions.php যোগ ঝরঝরে ফাংশন কয়েক সঙ্গে এই উপাদান প্রতিস্থাপন করতে পারেন12345678910function diymh_replace_hentry($classes){if(($key = array_search('hentry', $classes)) !== false) $classes[$key]='nohentry';return $classes;}add_filter('post_class','diymh_replace_hentry');function diymh_microdata_title($title) {return '<span itemprop="name">'.$title.'</span>';}add_filter('the_title', 'diymh_microdata_title', 10, 2);
তথ্য টাইপ যোগ করার পদ্ধতি (উদাঃ. প্রবন্ধ, প্রণালী, প্রভৃতি) নিবন্ধ হেডার
- প্রথম, decide what type of work you are publishing — most likely an article. Have a look at the list at schema.org
- সন্ধান এইচটিএমএল ট্যাগ যা বিরূদ্ধে-tains func-tion
post_class()
- কোড যুক্ত করুন
itemscope itemtype="https://schema.org/Article"
(আপনি কাজের একটি ভিন্ন ধরনের বাছাই করা হলে নিবন্ধ প্রতিস্থাপন করুন)
পরিশেষে, আমাদের পণ্য কোন মডেল ভঙ্গ এড়াতে
- আপনি আপনার থিম এর style.css এডিট করতে হবে এবং সব দৃষ্টান্ত প্রতিস্থাপন করতে একটি অনুসন্ধান / প্রতিস্থাপন অপারেশন করতে হবে
.vcard
সঙ্গে.novcard
এবং সব দৃষ্টান্ত প্রতিস্থাপন.hfeed
সঙ্গে.nohfeed
আমাদের পরিবর্তনের কোনো জড়ান না যাতে সিএসএস styling of our comments
অন্য কোন ত্রুটি স্থির
Any other changes necessary will be detailed on a per theme basis below. আপনি ঠিক করতে পারিনি যা একটি থিম আছে মন্তব্য পোষ্ট করুন. তার একটি বিনামূল্যে থিম যদি আমার থিম নামের দয়া করে, and if it is a premium theme please let me know so I can provide you with an e‑mail address to send a zipped copy to.
থিম নির্দিষ্ট বিবরণ
Before just carrying out these edits don’t forget to carry out the steps to link your google profile and your site to each other, এবং Yoast ইনস্টল এই, বা কোড উপরোক্ত প্রদান করে যোগ.
কুড়ি দশ 1.5
Functions.php এই প্রতিস্থাপন
474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 | function twentyten_posted_on() { printf( __( '<span class="%1$s">Posted on</span> %2$s <span class="meta-sep">by</span> %3$s', 'twentyten' ), 'meta-prep meta-prep-author', sprintf( '<a href="%1$s" title="%2$s" rel="bookmark"><span class="entry-date">%3$s</span></a>', get_permalink(), esc_attr( get_the_time() ), get_the_date() ), sprintf( '<span class="author vcard"><a class="url fn n" href="%1$s" title="%2$s">%3$s</a></span>', get_author_posts_url( get_the_author_meta( 'ID' ) ), esc_attr( sprintf( __( 'View all posts by %s', 'twentyten' ), get_the_author() ) ), get_the_author() ) ); } |
এই সঙ্গে
474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 | function twentyten_posted_on() { if(get_the_date()==get_the_modified_date()){ printf( __( '<span class="%1$s">Posted on</span> %2$s <span class="meta-sep">by</span> %3$s', 'twentyten' ), 'meta-prep meta-prep-author', sprintf( '<a href="%1$s" title="%2$s" rel="bookmark"><span itemprop="datePublished dateCreated dateModified">%3$s</span></a>', get_permalink(), esc_attr( get_the_time() ), get_the_date() ), sprintf( '<span class="author vcard"><a itemprop="author" href="%1$s" title="%2$s">%3$s</a></span>', get_author_posts_url( get_the_author_meta( 'ID' ) ), esc_attr( sprintf( __( 'View all posts by %s', 'twentyten' ), get_the_author() ) ), get_the_author() ) ); } else{ printf( __( '<span class="%1$s">Posted on</span> %2$s <span class="meta-sep">by</span> %3$s. Updated <span itemprop="dateModified">%4$s</span>.', 'twentyten' ), 'meta-prep meta-prep-author', sprintf( '<a href="%1$s" title="%2$s" rel="bookmark"><span itemprop="datePublished dateCreated">%3$s</span></a>', get_permalink(), esc_attr( get_the_time() ), get_the_date() ), sprintf( '<span class="author vcard"><a itemprop="author" href="%1$s" title="%2$s">%3$s</a></span>', get_author_posts_url( get_the_author_meta( 'ID' ) ), esc_attr( sprintf( __( 'View all posts by %s', 'twentyten' ), get_the_author() ) ), get_the_author() ), get_the_modified_date() ); } } |
Functions.php এই প্রতিস্থাপন
336 | <div class="comment-author vcard"> |
এই সঙ্গে
336 | <div class="comment-author novcard"> |
Header.php এই প্রতিস্থাপন
56 | <div id="wrapper" class="hfeed"> |
এই সঙ্গে
56 | <div id="wrapper" class="nohfeed"> |
Loop.php ইন (3 দৃষ্টান্ত), লুপ-single.php, লুপ-page.php এবং লুপ-attachment.php এই প্রতিস্থাপন
1 | <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>> |
এই সঙ্গে
1 | <div id="post-<?php the_ID(); ?>" <?php post_class(); ?> itemscope itemtype="http://schema.org/Article"> |
Twenty Eleven 1.5
খুব শীঘ্রই কম-ing ...
Annotum বেজ 1.1.1
মধ্যে 7 ফাইল (ফাংশন বৈশিষ্ট্য-articles.php, উদ্ধৃতাংশ টাইপ article.php, উদ্ধৃতাংশ উদ্ধৃতাংশ-default.php, কন্টেন্ট টাইপ article.php, কন্টেন্ট page.php, কন্টেন্ট কন্টেন্ট-default.php, কন্টেন্ট নিবন্ধ-pdf.php) প্রতিস্থাপন করা
1 | <article <?php post_class('article-full'); ?>> |
সঙ্গে
1 | <article <?php post_class('article-full'); ?> itemscope itemtype="http://schema.org/Article"> |
মনে করি আমরা কিছু মিস করেছি? আমাদের নীচের মন্তব্য করে জানতে দিন. আপনি সদস্যতা করতে চান তাহলে উপরের ডানদিকের মেনু এর লিঙ্কে সাবস্ক্রাইব ব্যবহার করুন. এছাড়াও আপনি নীচের সামাজিক লিঙ্ক ব্যবহার করে আপনার বন্ধুদের সাথে ভাগ করতে পারেন. চিয়ার্স.
Thanks — working on it — eisenberg.co.za
মহান, grazie mille!