Ver Mensaje Individual
  #7 (permalink)  
Antiguo 01/08/2008, 14:21
p2pdownloading
Invitado
 
Mensajes: n/a
Puntos:
Respuesta: SEO y WordPress: buen matrimonio?

hola esta es la funcion para tomar parte del post cmo podras ver en el index de mi web www.software-p2p.com

<?php the_excerpt(); ?> solo rremplaza la funcion <?php the_content(); ?>

y listo

aqui una funcion que hace las keywords y la descripcion dinamicas

function get_seo_meta_tags()
{
//--------------------------------------------------------------
// MOD�FICA LAS SIGUIENTES VARIABLES ACORDE CON TU BLOG
//--------------------------------------------------------------

$meta_description = get_bloginfo('description');
$meta_keywords = 'p2p, programas p2p, programa torrent, software p2p, foros p2p, bajar programas p2p, descargas p2p, España';

//--------------------------------------------------------------
// NO NECESITAS CAMBIAR NADA A PARTIR DE AQU�
//--------------------------------------------------------------

//--------------------------------------------------------------
// Inicializa variables
global $posts;

$meta_robots = 'noindex';
$meta_title = get_bloginfo('name') ;
//. ' | ' . get_bloginfo('description')
//--------------------------------------------------------------

//--------------------------------------------------------------
// Robots, Title and description
if (is_home()) {

$meta_robots = 'index';
}
elseif (is_single() || is_page())
{
$meta_robots = 'index';
$meta_title = single_post_title('', false) . ' | ' . $meta_title;

//--------------------------------------------------------------
// Descripción dinámica
if (count($posts) > 0)
{
$temp = substr($posts [0]->post_content, 0, 300);
$temp = strip_tags($temp);
$temp = ereg_replace("/\n\r|\r\n|\n|\r/", "", $temp);

$word_list = explode(' ', trim($temp));

if (count($word_list) > 0)
{
$meta_description = '';

for ($word_item = 0; $word_item < 30; $word_item++)
$meta_description .= $word_list [$word_item] . ' ';

$meta_description = html_entity_decode($meta_description);

$meta_description = trim(str_replace(']]>', ']]&gt;', $meta_description));
}
}
//--------------------------------------------------------------
}
elseif (is_category()) {
$meta_title = single_cat_title('', false) . ' | ' . $meta_title;
}
elseif (is_tag()) {
$meta_title = single_tag_title('', false) . ' | ' . $meta_title;
}
elseif (is_archive()) {
$meta_title = wp_title('', false) . ' | ' . $meta_title;
}
elseif (is_search()) {
$meta_title = $meta_title;
}
elseif (is_404()) {
$meta_title = '404 | ' . $meta_title;
}
else {
$meta_title = wp_title('', false) . ' | ' . $meta_title;
}

//--------------------------------------------------------------
// Keywords
if (count($posts) > 0)
{
$keywords_array = array();

foreach ($posts as $post_item)
{
$tags_array = get_the_tags($post_item->ID);

if (!empty($tags_array))
{
foreach ($tags_array as $tag_item)
$keywords_array [] = trim(strtolower($tag_item->name));
}
}

if (count($keywords_array) > 0)
{
$meta_keywords = '';
$keywords_array = array_unique($keywords_array);

foreach ($keywords_array as $keyword_item)
$meta_keywords .= apply_filters('the_tags', $keyword_item) . ',';
}
}
//--------------------------------------------------------------


//--------------------------------------------------------------
// Build the meta tags strings
$meta_metatitle = "<meta name=\"title\" content=\"" . $meta_title . "\" />";
$meta_title = "<title>" . $meta_title . "</title>";
$meta_robots = "<meta name=\"robots\" content=\"" . $meta_robots . ",follow\" />";
$meta_description = "<meta name=\"description\" content=\"" . $meta_description . " en España.\" />";
$meta_keywords = "<meta name=\"keywords\" content=\"" . $meta_keywords . " España\" />";
//--------------------------------------------------------------

echo "\n\t<!-- Inicio Seo Tags -->";
echo "\n\t" . $meta_title . "\n\t" . $meta_metatitle . "\n\t" . $meta_description . "\n\t" . $meta_keywords . "\n\t" . $meta_robots;
echo "\n\t<!-- Final Seo Tags -->\n";
}

saludos!