کل فانکشن قالب سایت را قرار دادم
<?php
add_theme_support('post-thumbnails');
set_post_thumbnail_size('120, 120');
?>
<?php
add_filter('post_thumbnail_html','add_post_thumbnail_title_attribute',10,3);
function add_post_thumbnail_title_attribute($html, $post_id, $post_thumbnail_id) {
if( $html == '' ) {
return $html;
} else {
$out = $html;
$thumbnail_image = get_posts(array('p' => $post_thumbnail_id, 'post_type' => 'attachment'));
if ($thumbnail_image && isset($thumbnail_image[0])) {
$title = $thumbnail_image[0]->post_title;
if($title) {
$output = ' title="' . esc_attr($title) . '" ';
$out = str_replace( 'class=', $output . 'class=', $html );
}
}
}
return $out;
}
?>
<?php
remove_filter('get_the_excerpt', 'wp_trim_excerpt');
add_filter('get_the_excerpt', 'improved_trim_excerpt');
function improved_trim_excerpt($text) {
global $post;
if ( '' == $text ) {
$text = get_the_content('');
$text = apply_filters('the_content', $text);
$text = str_replace(']]>', ']]>', $text);
$text = preg_replace('@<script[^>]*?>.*?</script>@si', '', $text);
$text = strip_tags($text, '<p>');
$excerpt_length = 25;
$words = explode(' ', $text, $excerpt_length + 1);
if (count($words)> $excerpt_length) {
array_pop($words);
array_push($words, '[...]');
$text = implode(' ', $words);
}
}
return $text;
}
?>
<?php
function wp_get_postcount($id)
{
//return count of post in category child of ID 15
$count = 0;
$taxonomy = 'category';
$args = array(
'child_of' => $id,
);
$tax_terms = get_terms($taxonomy,$args);
foreach ($tax_terms as $tax_term) {
$count +=$tax_term->count;
}
return $count;
}
?>
اگر ممکن هست کمک کنید.اون تابع اولی پیدا نیست.