Folha de estilos (style.css)
/* 2.6 Footer */
#footer{ background:#828282; color:#cacaca; font-family:Georgia, "Times New Roman", Times, serif; font-style:italic; font-size:11px;padding: 25px 0;border-top: 1px solid #b3b3b3;}
#footer a { color:#cacaca; }
#footer a:hover { border-bottom:1px dotted; }
#footer #credit img{vertical-align:middle; }
#footer #credit span{display:none;}
/* 2.6.1 Footer Widget Area */
#footer-widgets{ position:relative; background:url(images/bevel-footer-widgets.png) repeat-x top; background-color:#c1c0c0; border-bottom:1px solid #7b7b7b; }
#footer-widgets .container { background:url(images/bg-footer-widgets.png) no-repeat center 2px; padding:30px 0 10px; }
#footer-widgets .block { width:300px; float:left; margin:0 30px 0px 0; }
#footer-widgets .block.last { margin-right:0;; }
#footer-widgets .widget h3 { background:url(images/bg-footer-widget-title.png) repeat-x; text-shadow: #fff 0px 1px 0px;}Modelo da Página (page.php)
<?php get_header(); ?>
<div id="content" class="col-full">
<div id="main" class="col-left">
<?php if (have_posts()) : $count = 0; ?>
<?php while (have_posts()) : the_post(); $count++; ?>
<div class="box">
<div class="post">
<h1 class="title"><?php the_title(); ?></h1>
<div class="entry">
<?php the_content(); ?>
</div>
</div><!-- /.post -->
</div><!-- /.box -->
<?php if ('open' == $post->comment_status) : ?>
<?php comments_template(); ?>
<?php endif; ?>
<?php endwhile; else: ?>
<div class="box">
<div class="post">
<p><?php _e('Sorry, no posts matched your criteria.', 'harlockthemes') ?></p>
</div><!-- /.post -->
</div>
<?php endif; ?>
</div><!-- /#main -->
<?php get_sidebar(); ?>
</div><!-- /#content -->
<?php get_footer(); ?>Modelo da página principal (index.php)
<?php get_header(); ?>
<div id="content" class="col-full">
<?php if ( !$paged && get_option('harlock_featured') == "true" ) include ( TEMPLATEPATH . '/includes/featured.php' ); ?>
<div id="main" class="col-left">
<?php
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
$args = array( 'post__not_in' => $GLOBALS['shownposts'], 'cat' => '-'.$GLOBALS[video_id], 'paged'=> $paged ); query_posts($args);
?>
<?php if (have_posts()) : $count = 0; ?>
<?php while (have_posts()) : the_post(); $count++; ?>
<div class="box">
<div class="post">
<?php harlock_get_image('image',$GLOBALS['thumb_width'],$GLOBALS['thumb_height'],'thumbnail '.$GLOBALS['align']); ?>
<h2 class="title"><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title(); ?>"><?php the_title(); ?></a></h2>
<p class="post-meta">
<img src="<?php bloginfo('template_directory'); ?>/images/ico-time.png" alt="" /><?php the_time($GLOBALS['harlockdate']); ?>
<span class="comments"><img src="<?php bloginfo('template_directory'); ?>/images/ico-comment.png" alt="" /><?php comments_popup_link(__('0 Comments', 'harlockthemes'), __('1 Comment', 'harlockthemes'), __('% Comments', 'harlockthemes')); ?></span>
</p>
<div class="entry">
<?php if ( get_option('harlock_home_content') == "true" ) { ?>
<?php the_content(__('Read more...', 'harlockthemes')); ?>
<?php } else { ?>
<?php the_excerpt(); ?><span class="read-more"><a href="<?php the_permalink() ?>" title="<?php the_title(); ?>" class="btn"><?php _e('Read more', 'harlockthemes'); ?></a></span>
<?php } ?>
</div>
<div class="fix"></div>
</div><!-- /.post -->
<div class="post-bottom">
<div class="fl"><span class="cat"><?php the_category(', ') ?></span></div>
<div class="fr"><?php the_tags('<span class="tags">', ', ', '</span>'); ?></div>
<div class="fix"></div>
</div>
</div><!-- /.box -->
<?php endwhile; else: ?>
<div class="box">
<div class="post">
<p><?php _e('Sorry, no posts matched your criteria.', 'harlockthemes') ?></p>
</div><!-- /.post -->
</div><!-- /.box -->
<?php endif; ?>
<div class="more_entries">
<?php if (function_exists('wp_pagenavi')) wp_pagenavi(); else { ?>
<div class="fl"><?php previous_posts_link(__('Newer Entries', 'harlockthemes')) ?></div>
<div class="fr"><?php next_posts_link(__('Older Entries', 'harlockthemes')) ?></div>
<br class="fix" />
<?php } ?>
</div>
</div><!-- /#main -->
<?php get_sidebar(); ?>
</div><!-- /#content -->
<?php get_footer(); ?>Rodapé (footer.php)
<!-- Footer Widget Area Starts -->
<?php if ( ( function_exists('dynamic_sidebar') && (is_active_sidebar(3) || is_active_sidebar(4) || is_active_sidebar(5)) ) ) : ?>
<div class="fix">
<div class="footer-widgets">
<div class="block">
<?php dynamic_sidebar(3); ?>
</div>
<div class="block">
<?php dynamic_sidebar(4); ?>
</div>
<div class="block last">
<?php dynamic_sidebar(5); ?>
</div>
</div></div>
<?php endif; ?>
<!-- Footer Widget Area Ends -->
<!-- Footer Starts -->
<div id="footer-wrap">
<div id="footer">
<div id="credits">
<div id="copyright" class="col-left">
<p>© <?php echo date('Y'); ?> <?php bloginfo(); ?>. <?php _e('<a href="http://www.uniq-themes.ru">All Rights Reserved.</a>', 'harlockthemes') ?></p>
</div>
<div id="credit" class="col-right">
<p><?php _e('Powered by', 'harlockthemes') ?> <a href="http://www.wordpress.org">Wordpress</a>. <?php _e('Designed by', 'harlockthemes') ?> <a href="http://www.harlockthemes.com"><img src="<?php bloginfo('template_directory'); ?>/images/harlockthemes.png" width="87" height="21" alt="harlock Themes" /></a></p>
</div>
</div>
</div>
</div>
<!-- Footer Ends -->
</div><!-- /#container -->
<?php wp_footer(); ?>
<?php if ( get_option('harlock_google_analytics') <> "" ) { echo stripslashes(get_option('harlock_google_analytics')); } ?>
</body>
</html>theme-functions.php
<?php
// Show sidebar on left
function harlock_sidebar_left() {
if ( get_option('harlock_left_sidebar') == "true" )
echo '<style type="text/css">#main.col-left { float:right; } #main.col-right { float:left; }</style>' . "\n";
}
add_action('wp_head','harlock_sidebar_left');
// Use Cufon font replacement
function harlock_cufon() {
if ( get_option('harlock_cufon') == "true" ) {
echo '<script type="text/javascript">Cufon.replace("h1, h2, h3, h4, h5, h6, .cufon");</script>' . "\n";
echo '<style type="text/css">.widget h3 { line-height:22px; }</style>' . "\n";
}
}
add_action('wp_head','harlock_cufon');
// Show Category descriptions in menu
function harlock_menu_description() {
if ( get_option('harlock_menu_desc') == "true" ) {
$GLOBALS[desc] = "true";
echo '<style type="text/css">#secnav a { line-height:16px; padding:13px 15px; }</style>' . "\n";
}
}
add_action('wp_head','harlock_menu_description');
// SET GLOBAL harlock VARIABLES
function harlock_globals() {
// Featured dimensions
$GLOBALS['align_feat'] = 'alignleft'; if (get_option('harlock_align_feat')) $GLOBALS['align_feat'] = get_option('harlock_align_feat');
$GLOBALS['thumb_width_feat'] = '200'; if (get_option('harlock_thumb_width_feat')) $GLOBALS['thumb_width_feat'] = get_option('harlock_thumb_width_feat');
$GLOBALS['thumb_height_feat'] = '200'; if (get_option('harlock_thumb_height_feat')) $GLOBALS['thumb_height_feat'] = get_option('harlock_thumb_height_feat');
// Thumbnail dimensions
$GLOBALS['align'] = 'alignleft'; if (get_option('harlock_align')) $GLOBALS['align'] = get_option('harlock_align');
$GLOBALS['thumb_width'] = '200'; if (get_option('harlock_thumb_width')) $GLOBALS['thumb_width'] = get_option('harlock_thumb_width');
$GLOBALS['thumb_height'] = '200'; if (get_option('harlock_thumb_height')) $GLOBALS['thumb_height'] = get_option('harlock_thumb_height');
// Featured Tags
$GLOBALS['feat_tags_array'] = array();
// Duplicate posts
$GLOBALS['shownposts'] = array();
// Video Category
global $wpdb;
$video_cat = get_option('harlock_video_category');
$GLOBALS[video_id] = $wpdb->get_var("SELECT term_id FROM $wpdb->terms WHERE name = '$video_cat'");
}
// Remove image dimentions from harlock_get_image images
update_option('harlock_force_all',false);
update_option('harlock_force_single',false);
// SHOW SOCIAL BOOKMARKS
function harlock_social() {
?>
<a href="http://twitter.com/home/?status=<?php the_title(); ?> : <?php echo get_tiny_url(get_permalink($post->ID)); ?>"><img src="<?php bloginfo('template_directory'); ?>/images/ico-social-twitter.png" alt="Twitter" /></a>
<a href="http://digg.com/submit?phase=2&url=<?php the_permalink() ?>"><img src="<?php bloginfo('template_directory'); ?>/images/ico-social-digg.png" alt="Digg" /></a>
<a href="http://del.icio.us/post?url=<?php the_permalink() ?>&title=<?php the_title(); ?>"><img src="<?php bloginfo('template_directory'); ?>/images/ico-social-delicious.png" alt="Delicious" /></a>
<a href="http://www.stumbleupon.com/submit?url=<?php the_permalink() ?>&title=<?php echo urlencode(the_title('','', false)) ?>"><img src="<?php bloginfo('template_directory'); ?>/images/ico-social-stumbleupon.png" alt="Stumbleupon" /></a>
<a href="http://technorati.com/cosmos/search.html?url=<?php the_permalink() ?>"><img src="<?php bloginfo('template_directory'); ?>/images/ico-social-technorati.png" alt="Technorati" /></a>
<a href="http://www.facebook.com/sharer.php?u=<?php the_permalink();?>&t=<?php the_title(); ?>"><img src="<?php bloginfo('template_directory'); ?>/images/ico-social-facebook.png" alt="Facebook" /></a>
<?php
}
// Shorten URL for Twitter
function get_tiny_url($url) {
if (function_exists('curl_init')) {
$url = 'http://tinyurl.com/api-create.php?url=' . $url;
$ch = curl_init();
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_URL, $url);
$tinyurl = curl_exec($ch);
curl_close($ch);
return $tinyurl;
}
else {
# cURL disabled on server; Can't shorten URL
# Return long URL instead.
return $url;
}
}
// Shorten Excerpt text for use in theme
function harlock_excerpt($text, $chars = 120) {
$text = $text." ";
$text = substr($text,0,$chars);
$text = substr($text,0,strrpos($text,' '));
$text = $text."...";
return $text;
}
?>theme-widgets.php
<?php
// =============================== Author widget ======================================
function authorWidget()
{
$settings = get_option("widget_authorwidget");
$title = $settings['title'];
if ($title == "")
$title = __('Author Info', 'harlockthemes');
if ( is_single() ) :
?>
<div id="author" class="widget">
<h3 class="widget_title"><img src="<?php bloginfo('template_directory'); ?>/images/ico-author.png" alt="" /><?php echo $title; ?></h3>
<div class="wrap">
<div class="fl"><?php echo get_avatar( get_the_author_id(), '48' ); ?></div>
<span class="author-info"><?php _e('This post was written by', 'harlockthemes'); ?> <?php the_author_posts_link(); ?> <?php _e('who has written', 'harlockthemes'); ?> <?php the_author_posts(); ?> <?php _e('posts on', 'harlockthemes'); ?> <a href="<?php echo get_option('home'); ?>/"><?php bloginfo('name'); ?></a>.</span>
<br class="fix"></br>
<p class="author-desc"><?php the_author_description(); ?></p>
</div>
</div>
<?php
endif;
}
function authorWidgetAdmin() {
$settings = get_option("widget_authorwidget");
// check if anything's been sent
if (isset($_POST['update_author'])) {
$settings['title'] = strip_tags(stripslashes($_POST['author_title']));
update_option("widget_authorwidget",$settings);
}
echo '<p>
<label for="author_title">Title:
<input id="author_title" name="author_title" type="text" class="widefat" value="'.$settings['title'].'" /></label></p>';
echo '<p>
<small>NOTE: This widget will only show on single post page.</small>
</p>';
echo '<input type="hidden" id="update_author" name="update_author" value="1" />';
}
register_sidebar_widget('harlock - Author', 'authorWidget');
register_widget_control('harlock - Author', 'authorWidgetAdmin', 200, 200);
// =============================== Flickr widget ======================================
function flickrWidget()
{
$settings = get_option("widget_flickrwidget");
$id = $settings['id'];
$number = $settings['number'];
?>
<div id="flickr" class="widget">
<h3 class="widget_title"><?php _e('Photos on <span>Flick<span>r</span></span>', 'harlockthemes') ?></h3>
<div class="wrap">
<script type="text/javascript" src="http://www.flickr.com/badge_code_v2.gne?count=<?php echo $number; ?>&display=latest&size=s&layout=x&source=user&user=<?php echo $id; ?>"></script>
<div class="fix"></div>
</div>
</div>
<?php
}
function flickrWidgetAdmin() {
$settings = get_option("widget_flickrwidget");
// check if anything's been sent
if (isset($_POST['update_flickr'])) {
$settings['id'] = strip_tags(stripslashes($_POST['flickr_id']));
$settings['number'] = strip_tags(stripslashes($_POST['flickr_number']));
update_option("widget_flickrwidget",$settings);
}
echo '<p>
<label for="flickr_id">Flickr ID (<a href="http://www.idgettr.com">idGettr</a>):
<input id="flickr_id" name="flickr_id" type="text" class="widefat" value="'.$settings['id'].'" /></label></p>';
echo '<p>
<label for="flickr_number">Number of photos:
<input id="flickr_number" name="flickr_number" type="text" class="widefat" value="'.$settings['number'].'" /></label></p>';
echo '<input type="hidden" id="update_flickr" name="update_flickr" value="1" />';
}
register_sidebar_widget('harlock - Flickr', 'flickrWidget');
register_widget_control('harlock - Flickr', 'flickrWidgetAdmin', 400, 200);
// =============================== Ad 200x200 widget ======================================
function ad300Widget()
{
include(TEMPLATEPATH . '/ads/widget_300_ad.php');
}
register_sidebar_widget('harlock - Ad 300x250', 'ad300Widget');
// =============================== Search widget ======================================
function searchWidget()
{
include(TEMPLATEPATH . '/search-form.php');
}
register_sidebar_widget('harlock - Search', 'SearchWidget');
// =============================== Video Player widget ======================================
function videoWidget()
{
$number = 3;
$title = "Latest Videos";
$settings = get_option("widget_videowidget");
if ($settings['number']) $number = $settings['number'];
if ($settings['title']) $title = $settings['title'];
?>
<div id="video" class="widget">
<h3><?php echo $title; ?></h3>
<div class="inside">
<?php query_posts('showposts='.$number.'&cat='.$GLOBALS[video_id]); ?>
<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?>
<div id="video-<?php the_ID(); ?>" class="latest">
<?php echo harlock_get_embed('embed','269','225'); ?>
</div>
<?php endwhile; ?>
<?php endif; ?>
</div>
<?php query_posts('showposts='.$number.'&cat='.$GLOBALS[video_id]); ?>
<?php if (have_posts()) : ?>
<ul class="harlockTabs">
<?php while (have_posts()) : the_post(); $count++; ?>
<li><a href="#video-<?php the_ID(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></li>
<?php endwhile; ?>
</ul>
<?php endif; ?>
</div>
<?php
}
register_sidebar_widget('harlock - Video Player', 'videoWidget');
function videoWidgetAdmin() {
$settings = get_option("widget_videowidget");
// check if anything's been sent
if (isset($_POST['update_video'])) {
$settings['number'] = strip_tags(stripslashes($_POST['video_number']));
$settings['title'] = strip_tags(stripslashes($_POST['video_title']));
update_option("widget_videowidget",$settings);
}
echo '<p>
<label for="video_number">Number of videos (default = 5):
<input id="video_number" name="video_number" type="text" class="widefat" value="'.$settings['number'].'" /></label></p>';
echo '<p>
<label for="video_title">Title
<input id="video_title" name="video_title" type="text" class="widefat" value="'.$settings['title'].'" /></label></p>';
echo '<label>NOTE: Setup the video category in the theme Options Panel';
echo '<input type="hidden" id="update_video" name="update_video" value="1" /></label>';
}
register_widget_control('harlock - Video Player', 'videoWidgetAdmin', 200, 200);
// =============================== Ad 125x125 widget ======================================
function adsWidget()
{
$settings = get_option("widget_adswidget");
$number = $settings['number'];
if ($number == 0) $number = 1;
$img_url = array();
$dest_url = array();
$numbers = range(1,$number);
$counter = 0;
if (get_option('harlock_ads_rotate') == "true") {
shuffle($numbers);
}
?>
<div id="advert_125x125" class="widget">
<?php
foreach ($numbers as $number) {
$counter++;
$img_url[$counter] = get_option('harlock_ad_image_'.$number);
$dest_url[$counter] = get_option('harlock_ad_url_'.$number);
?>
<a href="<?php echo "$dest_url[$counter]"; ?>"><img src="<?php echo "$img_url[$counter]"; ?>" alt="Ad" /></a>
<?php } ?>
</div>
<!--/ads -->
<?php
}
register_sidebar_widget('harlock - Ads 125x125', 'adsWidget');
function adsWidgetAdmin() {
$settings = get_option("widget_adswidget");
// check if anything's been sent
if (isset($_POST['update_ads'])) {
$settings['number'] = strip_tags(stripslashes($_POST['ads_number']));
update_option("widget_adswidget",$settings);
}
echo '<p>
<label for="ads_number">Number of ads (1-6):
<input id="ads_number" name="ads_number" type="text" class="widefat" value="'.$settings['number'].'" /></label></p>';
echo '<input type="hidden" id="update_ads" name="update_ads" value="1" />';
}
register_widget_control('harlock - Ads 125x125', 'adsWidgetAdmin', 200, 200);
/* Deregister Default Widgets */
function harlock_deregister_widgets(){
unregister_widget('WP_Widget_Search');
}
add_action('widgets_init', 'harlock_deregister_widgets');
?>THKS in advance










