Atik1
1
Hi
I having trouble with the Card Validator;
It gives below
ERROR: Required meta tag missing (twitter:description)
i use below code ,error comes everywhere except home page share-ask.com/
if(is_single() || is_page()) {
$twitter_url = get_permalink();
$twitter_title = get_the_title();
$twitter_desc = get_the_excerpt();
$twitter_thumbs = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), full );
$twitter_thumb = $twitter_thumbs[0];
if(!$twitter_thumb) {
$twitter_thumb = 'http://share-ask.com/wp-content/uploads/popular-debate-topics-for-high-school-students.jpg';
}
$twitter_name = str_replace('@', '', get_the_author_meta('twitter'));
?>
<meta name="twitter:card" value="summary_large_image" />
<meta name="twitter:url" value="<?php echo $twitter_url; ?>" />
<meta name="twitter:title" value="<?php echo $twitter_title; ?>" />
<meta name="twitter:description" value="<?php echo $twitter_desc; ?>" />
<meta name="twitter:image" value="<?php echo $twitter_thumb; ?>" />
<meta name="twitter:site" value="@shareask" />
<?
if($twitter_name) {
?>
<meta name="twitter:creator" value="@<?php echo $twitter_name; ?>" />
<?
}
}
?>
SamA74
2
Where does this function get its data from?
get_the_excerpt();
The description value is appearing empty.
<meta
name="twitter:description" value="" />
Atik1
3
I’ve no excerpt in any post so dat may be reason
so which function i should use as im not using any plugin & reallyhate manual work
Also do u know any function to add php meta title,description for page, post,eetc without plugin
SamA74
4
Are you sure?
Those are not standard php functions you are using there, they came from somewhere.
Only this:-
http://php.net/manual/en/function.get-meta-tags.php
Atik1
5
ya im not using any plugin
SamA74
6
So where are those functions from? Is it the CMS? Which CMS?
Atik1
7
so what should i use for php meta title,description for page, post,eetc without plugin as after searching lot i got
below is what i’ve
<title><?php wp_title(''); ?><?php if (!(is_404()) && (is_single()) || (is_page()) || (is_archive())) { ?><?php } ?><?php bloginfo('name'); ?></title>
<?php if (is_single() || is_page() ) : if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<meta name="description" content="<?php the_excerpt_rss(); ?>" />
<?php endwhile; endif; elseif(is_home()) : ?>
<meta name="description" content="<?php bloginfo('description'); ?>" />
<?php endif; ?>
system
Closed
9
This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.