WordPress knowledge sharing

How Baidu Bear Palm Realizes Mapping of Search Results

How Baidu Bear Palm Realizes Mapping of Search Results What about? Many people are a little confused when they hear this term, and do not know what it means. Look at the figure below. The following is the list of Baidu Xiongzhang articles in Weieisi blog. Previously, there were only text titles. Now the program will automatically grab the first three pictures in the article to show them, so it is called search result mapping.

Baidu, the bear's palm, has always stressed that it can improve the display volume of mobile terminals. Let's not say that Baidu always does things regardless of the end. At least we can spend some time to add a piece of code to improve the website traffic, which is good for us. After I used Weiaisi's blog, the number of visitors has really increased, but now many people are still indifferent to the bear's paw. Old Wei mentioned it on many different occasions, but few people responded.

I have written two articles about Baidu bear palm before, one is installation tutorial, the other is active push tutorial. This is the third article in a series of tutorials. In the future, new things about bear palm will be released in time.

WordPress Baidu Bear Palm Auto Push Plug in Installation and Use Tutorial

Baidu bear palm API resources php initiative push submit tutorial

Now let's talk about how to operate Baidu bear palm search results.

 

1. Baidu's official description of the bear's paw is that the bear's paw provides high-quality graphic content producers with the right to plot search results, helps the site get a better display style of search results, and provides search users with a better browsing experience. For landing pages and resources whose image quality meets the requirements, the style of one picture and three pictures will be displayed in the search results.

2. Cooperation requirements
In order to obtain the right to map from the search results, the images must meet the following requirements: high definition, 3:2 aspect ratio, and the image size must not be less than 300 * 200px; The main content of the picture should be centered and fully displayed (the picture may be trimmed at the edges, and poor results after trimming will affect the display); Pictures shall not involve vulgarity, pornography, reactionary, etc; No duplicate pictures in the same content; The pictures shall not be pure text, advertising pictures, pornographic pictures, solid color pictures, or uncomfortable pictures; No QR code, telephone number, WeChat and other benefit methods shall be shown in the picture; The image watermark can only add the name of the bear's paw, and cannot be placed in a prominent position, and cannot cover the image in a large area; The image format is JPG, GIF, and PNG static images. By default, JPG is used to display thumbnails.

3. Put the following code in front of the</head>tag of the topic header. php file. Remember to replace the contents of the appid with your bear's paw ID.

<!– Start of Bear Palm homepage presentation –>
<? php
if(is_single()||is_page()){
echo ‘<script type=”application/ld+json”>{
“@context”: “ https://ziyuan.baidu.com/contexts/cambrian.jsonld ”,
“@id”: “‘.get_the_permalink().'”,
"Appid": "Your bear's paw ID",
“title”: “‘.get_the_title().'”,
“images”: [“‘.fanly_post_imgs().'”],
“pubDate”: “‘.get_the_time(‘Y-m-d\TH:i:s’).'”
}</script>
‘;}
//Get the figure in the article last update 2018/01/22
function fanly_post_imgs(){
global $post;
$src = ”;
$content = $post->post_content;
preg_match_all(‘/<img .*? src=[\”|\’](.+?)[\”|\’].*?>/’, $ content, $strResult, PREG_PATTERN_ORDER);
$n = count($strResult[1]);
if($n >= 3){
$src = $strResult[1][0].'”,”‘.$ strResult[1][1].'”,”‘.$ strResult[1][2];
}elseif($n >= 1){
$src = $strResult[1][0];
}
return $src;
}
?>
<!– End of Bear Palm homepage presentation –>

The above code comes from the original address of the Tear Snow Blog https://zhangzifan.com/wordpress-xzh-structurepic.html

In addition, it is required that you can apply after the novice period (above 100 points). The above code will automatically obtain the first three pictures, but it does not support wordpress featured pictures (the bear's paw requires that the pictures must belong to the content of the article), so the pictures you want to display will be captured only when they are placed in the content of the article. It supports image links outside the site, and image links must use absolute links.

Like( two )
Article name: How Baidu Bear Palm Achieves Mapping of Search Results
Article link: https://www.vpsss.net/8426.html
Copyright notice: The resources of this website are only for personal learning and exchange, and are not allowed to be reproduced and used for commercial purposes, otherwise, legal issues will be borne by yourself.
The copyright of the pictures belongs to their respective creators, and the picture watermark is for the purpose of preventing unscrupulous people from stealing the fruits of labor.