我想更改我的网站页面og:url

时间:2016-03-15 19:32:03

标签: facebook-opengraph

在我的wordpress网站上,我有:(在视图中)

var query =
    from current in db.NAVSummaries
    let currentWD = SqlFunctions.DatePart("dw", current.ValueDate)
    let currentPD = DbFunctions.AddDays(current.ValueDate, currentWD == 2 ? -3 : currentWD == 1 ? -2 : -1).Value
    join previous in db.NAVSummaries
    on new { current.Portfolio, PD = currentPD }
    equals new { previous.Portfolio, PD = previous.ValueDate }
    into previousGroup
    from previous in previousGroup.DefaultIfEmpty() // LEFT OUTER JOIN
    select new { outer = current, inner = previous };
if (dateStart.HasValue)
    query = query.Where(e => e.outer.ValueDate >= dateStart.Value);
if (dateEnd.HasValue)
    query = query.Where(e => e.outer.ValueDate <= dateEnd.Value);

现在我想将其更改为

meta property="og:url" content="http://www.myoldwebsite"

这是通过插件生成的,我找到了获取此meta property="og:url" content="http://www.mynewwebsite.com"/ 的插件代码,下面是代码:

og:url

我没有得到改变的地方和内容,因此当我查看源代码我的网站页面时,我可以看到更改后的$fb_url=get_permalink(); if (is_front_page()) { /* Fix homepage type when it's a static page */ $fb_url=get_option('home').(intval($fb_url_add_trailing)==1 ? '/' : ''); $fb_type=trim($fb_type_homepage=='' ? 'website' : $fb_type_homepage); } if (trim($post->post_excerpt)!='') { //If there's an excerpt that's what we'll use $fb_desc=trim($post->post_excerpt);

og:url

代码更改后,我希望它出现:

meta property="og:url" content="http://www.myoldwebsite.com"/

1 个答案:

答案 0 :(得分:0)

如果您想破解它,可以替换

$fb_url=get_option('home').(intval($fb_url_add_trailing)==1 ? '/' : '');

$fb_url='http://www.mynewwebsite.com';

建议;这是一个黑客。你正在改变一个插件。我不是Wordpress专家,但只要你更新插件,这段代码就可能重置了。可能更好地找到home变量的内容并更改它。