selected Posted April 27, 2011 Report Posted April 27, 2011 Sa zicem ca am postul de genu:imagine1textimagine2keyword1 keyword2 bla bla(sub forma de text) Cum pot face ca excerpt-ul sa fie format doar din:imagine1textimagine2 Adica sa se opreasca inainte de keyword1 !? Stie cineva vreo functie ? Wordpress !! Quote
selected Posted April 28, 2011 Author Report Posted April 28, 2011 Stiu ca exista asa ceva dar am zis sa intreb...function modified_excerpt_length($length) {return 40;}add_filter('excerpt_length', 'modified_excerpt_length');Functia asta limiteaza excerpt-ul la 40 de caractere.Cine se pricepe la coding si ma poate ajuta ? LE: function excerpt($limit) { $excerpt = explode(' ', get_the_excerpt(), $limit); if (count($excerpt)>=$limit) { array_pop($excerpt); $excerpt = implode(" ",$excerpt).'...'; } else { $excerpt = implode(" ",$excerpt); } $excerpt = preg_replace('`\[[^\]]*\]`','',$excerpt); return $excerpt;}function content($limit) { $content = explode(' ', get_the_content(), $limit); if (count($content)>=$limit) { array_pop($content); $content = implode(" ",$content).'...'; } else { $content = implode(" ",$content); } $content = preg_replace('/\[.+\]/','', $content); $content = apply_filters('the_content', $content); $content = str_replace(']]>', ']]>', $content); return $content;} Cred ca asta ajuta mai tare... Va rog ! ^'> Quote