最初它是工作時,我在whatsapp共享blogpost鏈接,然後添加新的meta標籤在網站header.php頁面它只與元標記og圖像工作。最後我刪除它,但它不工作。Og圖像不能在wordpress中的whatsapp共享
我的更改(帶有og圖像的元標記)正在添加到此header.php頁面,但共享帖子的圖像不能與該鏈接一起工作。請幫助我。 的header.php
<?php
/**
* NewsGamer Theme
*
* Theme by: MipThemes
* http://themes.mipdesign.com
*
* Our portfolio: http://themeforest.net/user/mip/portfolio
* Thanks for using our theme!
*
*/
?>
<!doctype html>
<!--[if lt IE 7]> <html class="no-js ie6 oldie"> <![endif]-->
<!--[if IE 7]> <html class="no-js ie7 oldie"> <![endif]-->
<!--[if IE 8]> <html class="no-js ie8 oldie"> <![endif]-->
<!--[if IE 9]> <html class="no-js ie9 oldie"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" <?php language_attributes(); ?>> <!--<![endif]-->
<head>
<!-- start:global -->
<!-- <meta property="og:url" content="https://www.mediatenlive.com/webpage/"> -->
<meta charset="<?php bloginfo('charset');?>" />
<!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1"><![endif]-->
<!-- end:global -->
<!-- start:responsive web design -->
<meta name="viewport" content="width=device-width, initial-scale=1" />
<!-- end:responsive web design -->
<title><?php wp_title('|',true,'right'); ?></title>
<link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />
<?php
// Theme Custom Meta
MipThemeFramework_Util::miptheme_set_meta();
?>
<!-- start:wp_head -->
<?php wp_head(); ?>
<!-- end:wp_head -->
<!--[if lt IE 9]>
<script src="<?php echo get_template_directory_uri(); ?>/assets/js/respond.js"></script>
<script src="<?php echo get_template_directory_uri(); ?>/assets/js/html5shiv.js"></script>
<![endif]-->
<!-- RMS Code Start -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.2.4/jquery.min.js"></script>
<script>
$(function(){
$(".soc-media").prepend("<a href='https://play.google.com/store/apps/details?id=com.mediaten.media10'><i class='fa fa-android'></i></a>");
$(".soc-media-sharing").prepend('<a class="btn-social btn-facebook btn-icon" href="whatsapp://send?text='+window.location.href+'" onclxick="window.open(this.href, \'weeklywin\', \'left=50,top=50,width=600,height=360,toolbar=0\'); return false;"><i class="fa fa-whatsapp fa-lg"></i><span id="smWhatsapp">whatsapp</span></a>');
});
/*$(document).click(function(event) {
//alert("Clicked");
if(!$(event.target).closest('#mobile-menu').length && !$(event.target).closest('#nav-expander').length){
//alert("outside menu=="+$('#mobile-menu').is(":visible")+"==");
if($('#mobile-menu').is(":visible")) {
//alert("visible");
$('#mobile-menu').hide();
$("#wall-ad-container").remove();
}
}
});*/
</script>
<!-- RMS Code End -->
</head>
<body <?php body_class() ?> itemscope itemtype="http://schema.org/WebPage">
<!-- start:body-start -->
<?php get_template_part('elements/body-start'); ?>
<!-- end:body-start -->
<!--RMS Code start:ad-top-banner -->
<?php if (!wp_is_mobile()) echo"<div style='height:100px;align:center;' class='hidden-xs'></div>";get_template_part('elements/ad-wall-banner'); ?>
<!-- end:ad-top-banner -->
<!-- start:page outer wrap -->
<div id="page-outer-wrap">
<!-- start:page inner wrap -->
<div id="page-inner-wrap">
<!-- start:page header mobile -->
<?php get_template_part('elements/header-mobile'); ?>
<!-- end:page header mobile -->
<!-- start:page header -->
<?php get_template_part('elements/header-navigation'); ?>
<!-- end:page header -->
<!-- start:page top grid -->
<?php get_template_part('elements/top-grid'); ?>
<!-- end:page top grid -->
<!-- start:ad-side-banner -->
<?php get_template_part('elements/ad-side-banner'); ?>
<!-- end:ad-side-banner -->
<!-- start:outside post header -->
<?php get_template_part('elements/post-header-outside'); ?>
<!-- end:outside post header -->
<!-- start:ad-top-banner -->
<?php get_template_part('elements/ad-top-banner'); ?>
<!-- end:ad-top-banner -->
的single.php
<?php
/**
* NewsGamer Theme
*
* Theme by: MipThemes
* http://themes.mipdesign.com
*
* Our portfolio: http://themeforest.net/user/mip/portfolio
* Thanks for using our theme!
*
*/
// load header
get_header();
// Get Page properties
$mip_current_page = new MipThemeFramework_Page();
// Update Post View
MipThemeFramework_Post_Views::update_post_views($post->ID);
// Load Custom post headers
get_template_part('elements/parts/post-header-'. $mip_current_page->page_template .'');
?>
<!-- start:post-info-bar -->
<?php if ($mip_current_page->enable_post_info_bar) get_template_part('elements/post-info-bar'); ?>
<!-- end:post-info-bar -->
<!-- start:page content -->
<div id="page-content" class="<?php echo esc_attr($mip_current_page->page_template_class); ?> clearfix">
<?php
//get sidebar
if (($mip_current_page->page_sidebar_template == 'left-sidebar')&&(!wp_is_mobile())) get_sidebar();
?>
<!-- start:main -->
<div id="main" class="main article">
<!-- start:article post -->
<article id="post-<?php echo esc_attr($post->ID); ?>" <?php post_class('article-post clearfix'); ?> <?php echo MipThemeFramework_Util::get_item_scope($mip_current_page->review_post); ?>>
<?php
if (have_posts()) :
// Get Template
get_template_part('elements/'. $mip_current_page->page_template .'');
else :
// No Posts
esc_html_e('No posts.', 'newsgamer');
endif;
?>
</article>
<!-- end:article post -->
</div>
<!-- end:main -->
<?php
//get sidebar
if (($mip_current_page->page_sidebar_template == 'right-sidebar')||(($mip_current_page->page_sidebar_template == 'left-sidebar')&&(wp_is_mobile()))) get_sidebar();
?>
</div>
<!-- end:page content -->
<?php
// load footer
get_footer();
?>
1.Normally當共享帖子我得到這樣 enter image description here 2.當添加meta標籤的圖像與任何圖像鏈接我得到這樣的內容這 enter image description here意味着獲得任何職位的圖像。但我需要不同的圖像(職位)與不同的職位。請幫助我的任何人。
你可以爲single.php和header.php顯示一些代碼嗎?雖然這個線程可能有所幫助 - https://stackoverflow.com/questions/25100917/showing-thumbnail-for-link-in-whatsapp-ogimage-meta-tag-doesnt-work –
如果添加這些鏈接我在任何帖子分享時都會看到這些圖片但是當我分享這篇文章時我想要正確的帖子圖片。我能做些什麼請幫忙。 –