Discuz! Board

 找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 204|回复: 0

Adding Meta Tags Define the Type of Twitter Card

[复制链接]

1

主题

1

帖子

5

积分

新手上路

Rank: 1

积分
5
发表于 2022-8-21 14:18:50 | 显示全部楼层 |阅读模式
For example, you will use an adaptation of the following code on every webpage where you want to be able to control the look of any tweets that link to it. <meta name="twitter:card" content="summary"></meta meta meta> The above code creates a Summary Card as it uses the word "summary" as its content. You can change this code to match the Twitter Card type you want: "summary," "summary_large_image," "app," or " player ." You can only have one type of Twitter card on any webpage, so if you place the above line of code on a particular page, all tweets linking to that page will have a Summary Card look (with the smaller image). If you use "summary_large_image" as your content type, tweets that link to the

page will appear with larger pictures or videos. If you try adding more than one Twitter Card type, Twitter will use the kind that appears latest in your code. 2. Setting Attribution Yo usually want to attribute the Twitter Background Remove Service Card to a particular Twitter username. For example, you would use the following line of code (inserting the actual username): <meta name="twitter:site" content="username" /> For Summary Card with Large Image cards only, you can also show the username of the content creator: <meta name=" twitter:creator" content="username" /> 3. Giving Your Twitter Card a Title and Description One of the advantages of a Twitter Card is that you can set the Title and Description used in your tweet – your title can be up to 70 characters and your description 200 characters. By doing this,you aren't leaving it to chance that the link takes whatever it likes from your webpage. <meta name="twitter:title" content="Title of your webpage" /> <meta name="twitter:description" content=" Description" / > Note that on iOS and Android, your title will truncate to two lines in the timeline and expanded


Tweet, whereas, on the web, it will truncate to one line. The description won't display on iOS and Android devices but will show, truncated to three lines, on the web. Twitter suggests you don't merely repeat your title as your description but should write about your webpage's general services. While you should still give a description for an App Card, you don't need to worry about a title, as Twitter will pull that from your app ID. 4.Setting the Image URL One of the pivotal features of a Twitter Card is that it links somewhere. Therefore, you will need to set the URL where you want people to go when they click on your tweet. <meta name=”twitter:image” content=”https://where-your-image-is-hosted/name.jpg” /> As with most images on a website, you should include an alt description of your image to assist visually impaired people (up to 420 characters ).

回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|DiscuzX

GMT+8, 2025-6-18 07:31 , Processed in 0.058322 second(s), 19 queries .

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表