在推特上发布我的Wordpress帖子时,如何让短代码输出而不是短代码文本出现



我在WordPress网站上使用短代码来帮助显示BibTeX文件中文章的参考信息。例如,我文章顶部的文章信息是通过这种方式生成的,使用[bibtex key="id"]形式的短代码,其中id是BibTeX文件中的引用id。我正在使用papercite插件。

然而,当我使用上面的URL发推特时,我得到的是短代码文本本身,而不是短代码输出。参见:

https://twitter.com/JDHamkins/status/1306124193357074433

为什么Twitter在这里使用短代码文本,以及我如何让它使用输出文本?

如果你查看源HTML,它有行

<!-- Jetpack Open Graph Tags -->
...
<meta property="og:description" content="[bibtex key=&#8221;HamkinsSolberg:Categorical-large-cardinals&#8221;]" />
...
<!-- End Jetpack Open Graph Tags -->

所以看起来Jetpack WP插件没有处理短代码。

我建议在帖子的顶部,在[bibtex]行之前加一句介绍性的话。比如一句话的摘要?

更新:显然Yoast SEO插件可以用来解决这个问题,请参阅https://randomneuronsfiring.com/jetpack-publicize-setting-the-image-and-text-shown-on-twitter-and-facebook/

这将是因为Twitter在标题中使用<meta property="og:...">标签,而不是使用页面文本:

<!-- Jetpack Open Graph Tags -->
<meta property="og:type" content="article" />
<meta property="og:title" content="Categorical large cardinals and the tension between categoricity and set-theoretic reflection" />
<meta property="og:url" content="http://jdh.hamkins.org/categorical-large-cardinals/" />
<meta property="og:description" content="[bibtex key=&#8221;HamkinsSolberg:Categorical-large-cardinals&#8221;]" />
<meta property="article:published_time" content="2020-09-16T06:50:00+00:00" />
<meta property="article:modified_time" content="2020-09-16T06:50:04+00:00" />
<meta property="og:site_name" content="Joel David Hamkins" />
<meta property="og:image" content="http://jdh.hamkins.org/wp-content/uploads/Categorical-cardinals-Venn-diagram.jpg" />
<meta property="og:image:width" content="504" />
<meta property="og:image:height" content="306" />
<meta property="og:locale" content="en_US" />
<meta name="twitter:site" content="@JDHamkins" />
<meta name="twitter:text:title" content="Categorical large cardinals and the tension between categoricity and set-theoretic reflection" />
<meta name="twitter:card" content="summary" />

JetPack提供了一些帮助--https://jetpack.com/tag/open-graph/——关于如何手动更改他们的开放图插件的功能,但这可能需要一些工作

最新更新