S
sebasxnco
Épsilon
hola forbeta tengo el siguiente código con el que quiero carga meta datos para facebook y twitter pero el the_excerpt no carga el contenido, por que sera.
tambien si alguien sabe porque no carga el <?php the_author_meta('twitter'); ?> seria de mucha ayuda.
un saludo
tambien si alguien sabe porque no carga el <?php the_author_meta('twitter'); ?> seria de mucha ayuda.
un saludo
PHP:
<!-- facebook -->
<meta property="og:type" content="article" />
<meta property="og:site_name" content="<?php bloginfo('name'); ?>" />
<meta property="og:title" content="<?php the_title(); ?>" />
<meta property="og:url" content="<?php the_permalink() ?>" />
<?php $files = get_children("post_parent=".get_the_ID()."&post_type=attachment&post_mime_type=image"); if($files){ $keys = array_keys($files); $thumb=wp_get_attachment_image_src($keys[0], $size = 'thumbnail', $icon = false);?>
<meta property="og:image" content="<?php echo $thumb[0]; ?>" /><?php } ?>
<meta property="og:description" content="<?php the_excerpt(); ?>" />
<!-- Twitter -->
<meta name='twitter:card' content='summary' />
<?php $files = get_children("post_parent=".get_the_ID()."&post_type=attachment&post_mime_type=image"); if($files){ $keys = array_keys($files); $thumb=wp_get_attachment_image_src($keys[0], $size = 'full', $icon = false);?>
<meta name='twitter:image' content='<?php echo $thumb[0]; ?>' />
<?php } ?>
<meta name='twitter:creator' content='<?php the_author_meta('twitter'); ?>' />
<meta name='twitter:site' content='@suplentech' />
<meta name='twitter:url' content='<?php echo get_bloginfo('url')."/?p=".$post->ID; ?>' />
<meta name='twitter:description' content='<?php excerpt('30'); ?>' />
<meta name='twitter:title' content='<?php the_title(); ?>' />