有没有办法在Blogger上获得帖子标题? [英] Is there a way to get the post title on Blogger?

查看:85
本文介绍了有没有办法在Blogger上获得帖子标题?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在Blogger上获得帖子标题

I want to get the post title on Blogger

例如:

MyApp for Android

所以我可以用它在其中插入带有该标题的链接:

so I can use it to insert a link with that title in it:

例如:

http://download.to/search/developer/?search=[title here]`.

我可以为此使用JavaScript吗?还是可以通过Blogger获得它?

Could I use JavaScript for this? Or it is possible to get it with Blogger?

代码语法类似于:

<b:loop values='data:posts' var='post'>  

推荐答案

如果在post循环中使用代码,则可以使用以下代码:

If you use the code inside the post loop, you can use something as:

<a expr:href='&quot;http://download.to/search/developer/?search=&quot; + data:post.title'>My link</a>

如果要在页面的其他部分使用,则可以使用以下内容:

If you want to use in other part of the page, you can use something as:

<a href="javascript:void(0);" onclick="window.location.href = 'http://download.to/search/developer/?search='+document.title.replace('Some common part of your title','');">My link</a>

要做同样的工作.

请记住,在第二个示例中,您需要删除标题标签的某些公共部分.例如您的博客名称.而且Google和其他搜索引擎未对该链接 进行处理.

Remember that in the second example you NEED to remove some common part of your title tag. Such as your blog name, for example. And that link is not processed by Google and other search engines.

这篇关于有没有办法在Blogger上获得帖子标题?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆