Michael Torbert on "[Plugin: All in One SEO Pack] moved to https, likes gone, can I specify og:url"

ساخت وبلاگ

Michael, I was thinking..the issue is only present on the homepage as that's the only place I had a like/share button active. I think maybe your hook suggestion is the way to go then..I would just check for the post id of the homepage as described in the hook comment?

I'm awful with PHP, maybe you can point me in the right direction? If my homepage is set to post #1249, how would I check this in the hook?

add_filter('aiosp_opengraph_meta','aioseop_change_my_og_url', 10, 3);
function aioseop_change_my_og_url ( $value, $type, $field ){
/**this will allow allow you to change your OG URL *this is only an example, in real life you'd likely want to check for *more things, such as the post id to only run the code where you want it **/
if( $field == 'url' && something to check post id here?) $value = 'http://mynewurl.com';
retu $value;
}

Thanks for your help, I hope this works out.

Also if it matters to anyone for future reference, the only things I did in the transition were changing the home and canonical URLs in wordpress itself from http to https://sitename.com, and I'm using a plugin to clean up insecure content which affects the following:

scripts registered using wp_register_script() or wp_enqueue_script()
stylesheets registered using wp_register_style() or wp_enqueue_style()
images and other media loaded by calling wp_get_attachment_image(), wp_get_attachment_image_src(), etc.
data retued from wp_upload_dir() (e.g. for some CAPTCHA images)
images loaded by the plugin Image Widget

WordPress ...
ما را در سایت WordPress دنبال می کنید

برچسب : نویسنده : استخدام کار wpss بازدید : 210 تاريخ : شنبه 5 تير 1395 ساعت: 3:46