__( 'Header Pages', 'themejunkie' ), 'header-cats' => __( 'Header Categories', 'themejunkie' ) ) ); } /* MENUS END */ // General Widgets if (function_exists('register_sidebar')) { register_sidebar(array( 'name' => 'Sidebar', 'before_widget' => '', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', )); register_sidebar(array( 'name' => 'Footer Widget #1', 'before_widget' => '', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', )); register_sidebar(array( 'name' => 'Footer Widget #2', 'before_widget' => '', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', )); register_sidebar(array( 'name' => 'Footer Widget #3', 'before_widget' => '', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', )); register_sidebar(array( 'name' => 'Footer Widget #4', 'before_widget' => '', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', )); } # Content Excerpts function tj_content_limit($max_char, $more_link_text = '', $stripteaser = 0, $more_file = '') { $content = get_the_content($more_link_text, $stripteaser, $more_file); $content = apply_filters('the_content', $content); $content = str_replace(']]>', ']]>', $content); $content = strip_tags($content); if (strlen($_GET['p']) > 0) { echo ""; echo $content; echo "..."; } else if ((strlen($content)>$max_char) && ($espacio = strpos($content, " ", $max_char ))) { $content = substr($content, 0, $espacio); $content = $content; echo ""; echo $content; echo "..."; } else { echo ""; echo $content; } } // Turn a category ID to a Name function cat_id_to_name($id) { foreach((array)(get_categories()) as $category) { if ($id == $category->cat_ID) { return $category->cat_name; break; } } } // Get Image Attachments function tj_get_image($postid=0, $size='full') { if ($postid<1) $postid = get_the_ID(); $thumb = get_post_meta($postid, "thumb", TRUE); // Declare the custom field for the image if ($thumb != null or $thumb != '') { echo get_image_path($thumb); } elseif ($images = get_children(array( 'post_parent' => $postid, 'post_type' => 'attachment', 'numberposts' => '1', 'post_mime_type' => 'image', ))) foreach($images as $image) { $thumbnail=wp_get_attachment_image_src($image->ID, $size); ?> 0) { $imagePath = explode('/files/', $thumbnail); if (isset($imagePath[1])) { $thumbnail = '/blogs.dir/' . $blog_id . '/files/' . $imagePath[1]; } } return $thumbnail; } // Show Post Thumbnails function tj_show_thumb($width = 100, $height = 100) { ?> <?php the_title(); ?> have_posts()) : $popular->the_post(); ?>
  • have_posts()) : $the_query->the_post(); ?>
  • 0) ?>
  • comments LEFT OUTER JOIN $wpdb->posts ON ($wpdb->comments.comment_post_ID = $wpdb->posts.ID) WHERE comment_approved = '1' AND comment_type = '' AND post_password = '' ORDER BY comment_date_gmt DESC LIMIT ".$posts; $comments = $wpdb->get_results($sql); foreach ($comments as $comment) { ?>
  • comment_author); ?>: com_excerpt); ?>...