Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

major update 0.0.3

  • Loading branch information...
commit ea968e1965c488e8c81ab96f68ef7d7c270dcda4 1 parent 2d4c9ea
M.Satrya authored
Showing with 1,124 additions and 1,196 deletions.
  1. +1 −1  archive.php
  2. +1 −1  author.php
  3. +6 −0 changelog.txt
  4. +0 −37 content-aside.php
  5. +1 −1  content-featured.php
  6. +0 −62 content-gallery.php
  7. +0 −38 content-image.php
  8. +0 −48 content-link.php
  9. +0 −37 content-quote.php
  10. +0 −90 content-recent.php
  11. +2 −2 content-single.php
  12. +18 −55 content.php
  13. +1 −1  footer.php
  14. +1 −1  header.php
  15. +0 −36 home.php
  16. +60 −2 index.php
  17. +22 −2 library/admin/css/{admin-style.css → optionsframework.css}
  18. +10 −1 library/admin/js/options-custom.js
  19. +50 −14 library/admin/options-framework.php
  20. +56 −26 library/admin/options-interface.php
  21. +3 −2 library/admin/options-medialibrary-uploader.php
  22. +25 −11 library/admin/options-sanitize.php
  23. +1 −63 library/css/shortcodes.css
  24. +2 −1  library/img/icons/readme.txt
  25. +1 −0  library/img/readme.txt
  26. BIN  library/img/shortcodes/delete.png
  27. BIN  library/img/shortcodes/download.png
  28. BIN  library/img/shortcodes/error.png
  29. BIN  library/img/shortcodes/help.png
  30. BIN  library/img/shortcodes/idea.png
  31. BIN  library/img/shortcodes/info.png
  32. BIN  library/img/shortcodes/normal.png
  33. +0 −22 library/img/shortcodes/readme.txt
  34. BIN  library/img/shortcodes/success.png
  35. BIN  library/img/shortcodes/warning.png
  36. +1 −1  library/includes/enqueue.php
  37. +124 −11 library/includes/filters.php
  38. +20 −0 library/includes/options-functions.php
  39. +260 −188 library/includes/options.php
  40. +0 −6 library/includes/setup.php
  41. +1 −1  library/includes/shortcodes.php
  42. +60 −40 library/includes/templates.php
  43. +1 −1  library/js/{script.js → methods.js}
  44. BIN  library/languages/tiga.mo
  45. +244 −258 library/languages/tiga.po
  46. +1 −1  search.php
  47. +2 −1  single.php
  48. +149 −80 style.css
  49. +0 −54 template-blog.php
2  archive.php
View
@@ -79,7 +79,7 @@
* If you want to overload this in a child theme then include a file
* called content-___.php (where ___ is the Post Format name) and that will be used instead.
*/
- get_template_part( 'content', get_post_format() );
+ get_template_part( 'content' );
?>
<?php endwhile; ?>
2  author.php
View
@@ -59,7 +59,7 @@
* If you want to overload this in a child theme then include a file
* called content-___.php (where ___ is the Post Format name) and that will be used instead.
*/
- get_template_part( 'content', get_post_format() );
+ get_template_part( 'content' );
?>
<?php endwhile; ?>
6 changelog.txt
View
@@ -1,3 +1,9 @@
+
+0.0.3 - 02 June 2012
+- Update options theme framework
+- Remove post-format support
+- Remove blog template
+
0.0.2 - 27 May 2012
- Sanitize all theme options output
- Update grids
37 content-aside.php
View
@@ -1,37 +0,0 @@
-<?php
-/**
- * The template for displaying posts in the Aside Post Format on index and archive pages
- *
- * Learn more: http://codex.wordpress.org/Post_Formats
- *
- * @package tiga
- * @since tiga 0.0.1
- */
-?>
-
- <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
-
- <header class="entry-header">
- <div class="entry-format"><?php _e( 'Aside', 'tiga' ); ?></div>
- </header><!-- .entry-header -->
-
- <?php if ( is_search() ) : // Only display Excerpts for Search ?>
- <div class="entry-summary">
- <?php the_excerpt(); ?>
- </div><!-- .entry-summary -->
- <?php else : ?>
- <div class="entry-content">
- <?php the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'tiga' ) ); ?>
- <?php wp_link_pages( array( 'before' => '<div class="page-links">' . __( 'Pages:', 'tiga' ), 'after' => '</div>' ) ); ?>
- </div><!-- .entry-content -->
- <?php endif; ?>
-
- <footer class="entry-meta">
-
- <?php tiga_posted_on(); ?>
-
- <?php edit_post_link( __( 'Edit', 'tiga' ), '<span class="sep"> | </span><span class="post-edit">', '</span>' ); ?>
-
- </footer><!-- .entry-meta -->
-
- </article><!-- #post-<?php the_ID(); ?> -->
2  content-featured.php
View
@@ -45,5 +45,5 @@
</article> <!-- end #post-<?php the_ID(); ?> -->
</li>
- <?php endwhile; ?>
+ <?php endwhile; wp_reset_query();?>
</ul> <!-- end .slides -->
62 content-gallery.php
View
@@ -1,62 +0,0 @@
-<?php
-/**
- * The template for displaying posts in the Link Post Format on index and archive pages
- *
- * Learn more: http://codex.wordpress.org/Post_Formats
- *
- * @package tiga
- * @since tiga 0.0.1
- */
-?>
-
- <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
-
- <header class="entry-header">
- <div class="entry-format"><?php _e( 'Gallery', 'tiga' ); ?></div>
- <h2 class="entry-title"><a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'tiga' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h2>
- </header><!-- .entry-header -->
-
- <?php if ( is_search() ) : // Only display Excerpts for Search ?>
- <div class="entry-summary">
- <?php the_excerpt(); ?>
- </div><!-- .entry-summary -->
- <?php else : ?>
- <div class="entry-content">
-
- <div class="rslides_container">
- <ul class="rslides">
- <?php
- // basic code by:
- // twentyeleven gallery format,
- // http://wpengineer.com/1735/easier-better-solutions-to-get-pictures-on-your-posts
-
- $attachments = get_children( array(
- 'post_parent' => $post->ID,
- 'post_type' => 'attachment',
- 'post_mime_type' => 'image',
- 'numberposts' => -1,
- 'orderby' => 'menu_order',
- 'order' => 'ASC',
- 'numberposts' => 999
- ) );
-
- foreach ( $attachments as $attachment_id => $attachment ) : ?>
- <li><figure class="format-gallery-item"><?php echo wp_get_attachment_link($attachment_id, 'tiga-620px'); ?></figure></li>
- <?php endforeach;
- ?>
- </ul>
- </div>
- <?php the_excerpt(); ?>
- <?php wp_link_pages( array( 'before' => '<div class="page-links">' . __( 'Pages:', 'tiga' ), 'after' => '</div>' ) ); ?>
- </div><!-- .entry-content -->
- <?php endif; ?>
-
- <footer class="entry-meta">
-
- <?php tiga_posted_on(); ?>
-
- <?php edit_post_link( __( 'Edit', 'tiga' ), '<span class="sep"> | </span><span class="post-edit">', '</span>' ); ?>
-
- </footer><!-- .entry-meta -->
-
- </article><!-- #post-<?php the_ID(); ?> -->
38 content-image.php
View
@@ -1,38 +0,0 @@
-<?php
-/**
- * The template for displaying posts in the Image Post Format on index and archive pages
- *
- * Learn more: http://codex.wordpress.org/Post_Formats
- *
- * @package tiga
- * @since tiga 0.0.1
- */
-?>
-
- <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
-
- <header class="entry-header">
- <div class="entry-format"><?php _e( 'Image', 'tiga' ); ?></div>
- <h2 class="entry-title"><a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'tiga' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h2>
- </header><!-- .entry-header -->
-
- <?php if ( is_search() ) : // Only display Excerpts for Search ?>
- <div class="entry-summary">
- <?php the_excerpt(); ?>
- </div><!-- .entry-summary -->
- <?php else : ?>
- <div class="entry-content">
- <?php the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'tiga' ) ); ?>
- <?php wp_link_pages( array( 'before' => '<div class="page-links">' . __( 'Pages:', 'tiga' ), 'after' => '</div>' ) ); ?>
- </div><!-- .entry-content -->
- <?php endif; ?>
-
- <footer class="entry-meta">
-
- <?php tiga_posted_on(); ?>
-
- <?php edit_post_link( __( 'Edit', 'tiga' ), '<span class="sep"> | </span><span class="post-edit">', '</span>' ); ?>
-
- </footer><!-- .entry-meta -->
-
- </article><!-- #post-<?php the_ID(); ?> -->
48 content-link.php
View
@@ -1,48 +0,0 @@
-<?php
-/**
- * The template for displaying posts in the Link Post Format on index and archive pages
- *
- * Learn more: http://codex.wordpress.org/Post_Formats
- *
- * @package tiga
- * @since tiga 0.0.1
- */
-?>
-
- <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
-
- <header class="entry-header">
- <div class="entry-format"><?php _e( 'Link', 'tiga' ); ?></div>
- <h2 class="entry-title"><a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'tiga' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h2>
- </header><!-- .entry-header -->
-
- <?php if ( is_search() ) : // Only display Excerpts for Search ?>
- <div class="entry-summary">
- <?php the_excerpt(); ?>
- </div><!-- .entry-summary -->
- <?php else : ?>
- <div class="entry-content">
- <?php the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'tiga' ) ); ?>
- <?php wp_link_pages( array( 'before' => '<div class="page-links">' . __( 'Pages:', 'tiga' ), 'after' => '</div>' ) ); ?>
- </div><!-- .entry-content -->
- <?php endif; ?>
-
- <footer class="entry-meta">
-
- <?php
- printf( __( 'Posted on <a href="%1$s" title="%2$s" rel="bookmark"><time class="entry-date" datetime="%3$s" pubdate>%4$s</time></a><span class="byline"> by <span class="author vcard"><a class="url fn n" href="%5$s" title="%6$s" rel="author">%7$s</a></span></span>', 'tiga' ),
- esc_url( get_permalink() ),
- esc_attr( get_the_time() ),
- esc_attr( get_the_date( 'c' ) ),
- esc_html( get_the_date() ),
- esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),
- esc_attr( sprintf( __( 'View all posts by %s', 'tiga' ), get_the_author() ) ),
- esc_html( get_the_author() )
- );
- ?>
-
- <?php edit_post_link( __( 'Edit', 'tiga' ), '<span class="sep"> | </span><span class="post-edit">', '</span>' ); ?>
-
- </footer><!-- .entry-meta -->
-
- </article><!-- #post-<?php the_ID(); ?> -->
37 content-quote.php
View
@@ -1,37 +0,0 @@
-<?php
-/**
- * The template for displaying posts in the Quote Post Format on index and archive pages
- *
- * Learn more: http://codex.wordpress.org/Post_Formats
- *
- * @package tiga
- * @since tiga 0.0.1
- */
-?>
-
- <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
-
- <header class="entry-header">
- <div class="entry-format"><?php _e( 'Quote', 'tiga' ); ?></div>
- </header><!-- .entry-header -->
-
- <?php if ( is_search() ) : // Only display Excerpts for Search ?>
- <div class="entry-summary">
- <?php the_excerpt(); ?>
- </div><!-- .entry-summary -->
- <?php else : ?>
- <div class="entry-content">
- <?php the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'tiga' ) ); ?>
- <?php wp_link_pages( array( 'before' => '<div class="page-links">' . __( 'Pages:', 'tiga' ), 'after' => '</div>' ) ); ?>
- </div><!-- .entry-content -->
- <?php endif; ?>
-
- <footer class="entry-meta">
-
- <?php tiga_posted_on(); ?>
-
- <?php edit_post_link( __( 'Edit', 'tiga' ), '<span class="sep"> | </span><span class="post-edit">', '</span>' ); ?>
-
- </footer><!-- #entry-meta -->
-
- </article><!-- #post-<?php the_ID(); ?> -->
90 content-recent.php
View
@@ -1,90 +0,0 @@
-<?php
-/**
- * Display the recent posts posts content on home page
- *
- * Basic code from twentyeleven showcase page
- *
- * @package tiga
- * @since tiga 0.0.1
- */
-
-
-// Display our recent posts, ignoring Aside, Gallery and Quote posts
-$recent_args = array(
- 'order' => 'DESC',
- 'post__not_in' => get_option( 'sticky_posts' ),
- 'tax_query' => array(
- array(
- 'taxonomy' => 'post_format',
- 'terms' => array( 'post-format-aside', 'post-format-gallery', 'post-format-gallery' ),
- 'field' => 'slug',
- 'operator' => 'NOT IN',
- ),
- ),
-);
-$recent = new WP_Query();
-$recent->query( $recent_args );
-$counter = 0;
-
- while ( $recent->have_posts() ) : $recent->the_post();
- // set $more to 0 in order to only get the first part of the post
- global $more;
- $more = 0;
- $counter++;
-
- if ( 1 == $counter ) : ?>
- <article id="post-<?php the_ID(); ?>" <?php post_class('first-posts clearfix'); ?>>
-
- <?php if(has_post_thumbnail()){ ?>
- <figure class="entry-thumbnail last">
- <a href="<?php the_permalink() ?>">
- <?php the_post_thumbnail('tiga-140px', array( 'class' => 'photo thumbnail', 'alt' => get_the_title(), 'title' => get_the_title()));?>
- </a>
- </figure>
- <?php } ?>
-
- <div class="left-content">
- <header>
- <h2 class="entry-title"><a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'tiga' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h2>
- </header>
-
- <div class="entry-summary">
- <?php the_excerpt(); ?>
- </div>
-
- <div class="entry-meta">
- <?php tiga_posted_on(); ?>
- </div>
- </div> <!-- end .left-content -->
-
- </article> <!-- end #post-<?php the_ID(); ?> -->
-
- <?php else : ?>
- <article id="post-<?php the_ID(); ?>" <?php post_class('cols clearfix'); ?>>
-
- <header>
- <h2 class="entry-title"><a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'tiga' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h2>
- </header>
-
- <?php if(has_post_thumbnail()){ ?>
- <figure class="entry-thumbnail">
- <a href="<?php the_permalink() ?>">
- <?php the_post_thumbnail('tiga-300px', array( 'class' => 'photo thumbnail', 'alt' => get_the_title(), 'title' => get_the_title()));?>
- </a>
- </figure>
- <?php } ?>
-
- <div class="entry-summary">
- <?php the_excerpt(); ?>
- </div>
-
- <div class="entry-meta">
- <?php tiga_posted_on(); ?>
- </div>
-
- </article> <!-- end #post-<?php the_ID(); ?> -->
-
- <?php endif;
-
- endwhile;
-?>
4 content-single.php
View
@@ -77,8 +77,8 @@
<?php edit_post_link( __( 'Edit', 'tiga' ), '<span class="post-edit">', '</span>' ); ?>
<?php if(of_get_option('tiga_author_box'))
- tiga_the_author();
- ?>
+ tiga_the_author();
+ ?>
</footer><!-- .entry-meta -->
73 content.php
View
@@ -7,63 +7,26 @@
*/
?>
-<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
-
- <header class="entry-header">
-
- <h2 class="entry-title"><a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'tiga' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h2>
-
- <?php if ( 'post' == get_post_type() ) : ?>
- <div class="entry-meta">
- <?php tiga_posted_on(); ?>
- </div><!-- .entry-meta -->
- <?php endif; ?>
+ <article id="post-<?php the_ID(); ?>" <?php post_class('cols clearfix'); ?>>
+
+ <header>
+ <h2 class="entry-title"><a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'tiga' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h2>
+ </header>
- </header><!-- .entry-header -->
+ <?php if(has_post_thumbnail()){ ?>
+ <figure class="entry-thumbnail">
+ <a href="<?php the_permalink() ?>">
+ <?php the_post_thumbnail('tiga-300px', array( 'class' => 'photo thumbnail', 'alt' => get_the_title(), 'title' => get_the_title()));?>
+ </a>
+ </figure>
+ <?php } ?>
- <?php if ( is_search() || is_archive() ) : // Only display Excerpts for Search ?>
<div class="entry-summary">
<?php the_excerpt(); ?>
- </div><!-- .entry-summary -->
- <?php else : ?>
- <div class="entry-content">
- <?php the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'tiga' ) ); ?>
- <?php wp_link_pages( array( 'before' => '<div class="page-links">' . __( 'Pages:', 'tiga' ), 'after' => '</div>' ) ); ?>
- </div><!-- .entry-content -->
- <?php endif; ?>
-
- <footer class="entry-meta">
-
- <?php if ( 'post' == get_post_type() ) : // Hide category and tag text for pages on Search ?>
- <?php
- /* translators: used between list items, there is a space after the comma */
- $tiga_categories_list = get_the_category_list( __( ', ', 'tiga' ) );
- if ( $tiga_categories_list && tiga_categorized_blog() ) :
- ?>
- <span class="cat-links">
- <?php printf( __( 'Posted in %1$s', 'tiga' ), $tiga_categories_list ); ?>
- </span>
- <?php endif; // End if categories ?>
-
- <?php
- /* translators: used between list items, there is a space after the comma */
- $tiga_tags_list = get_the_tag_list( '', __( ', ', 'tiga' ) );
- if ( $tiga_tags_list ) :
- ?>
- <span class="sep"> | </span>
- <span class="tag-links">
- <?php printf( __( 'Tagged %1$s', 'tiga' ), $tiga_tags_list ); ?>
- </span>
- <?php endif; // End if $tags_list ?>
- <?php endif; // End if 'post' == get_post_type() ?>
-
- <?php if ( comments_open() || ( '0' != get_comments_number() && ! comments_open() ) ) : ?>
- <span class="sep"> | </span>
- <span class="comments-link"><?php comments_popup_link( __( 'Leave a comment', 'tiga' ), __( '1 Comment', 'tiga' ), __( '% Comments', 'tiga' ) ); ?></span>
- <?php endif; ?>
-
- <?php edit_post_link( __( 'Edit', 'tiga' ), '<span class="sep"> | </span><span class="post-edit">', '</span>' ); ?>
+ </div>
+
+ <div class="entry-meta">
+ <?php tiga_posted_on(); ?>
+ </div>
- </footer><!-- #entry-meta -->
-
-</article><!-- #post-<?php the_ID(); ?> -->
+ </article> <!-- end #post-<?php the_ID(); ?> -->
2  footer.php
View
@@ -25,7 +25,7 @@
<div id="site-credit" class="site-info">
<?php do_action( 'tiga_credits' ); ?>
- <span class="copyleft">&copy; Copyleft <?php echo date('Y'); ?> <a href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php bloginfo('name'); ?>"><?php bloginfo('name'); ?></a></span>
+ <span class="copyleft">&copy; Copyright <?php echo date('Y'); ?> <a href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php bloginfo('name'); ?>"><?php bloginfo('name'); ?></a></span>
<span class="credit">
<?php printf( __('Powered by <a href="http://wordpress.org/" title="%1$s" rel="generator">%2$s</a> &middot; Theme by <a href="http://satrya.me/" title="%3$s" rel="designer">%4$s</a>', 'tiga'),
2  header.php
View
@@ -23,7 +23,7 @@
<link rel="profile" href="http://gmpg.org/xfn/11">
<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>">
-<?php wp_head(); ?>
+ <?php wp_head(); ?>
</head>
36 home.php
View
@@ -1,36 +0,0 @@
-<?php
-/**
- * Custom home page
- *
- * Display the featured & recent posts
- *
- * @package tiga
- * @since tiga 0.0.1
- */
-
-get_header(); ?>
-
- <div id="primary" class="site-content">
- <div id="content" role="main">
-
- <?php if(of_get_option('tiga_show_featured')) : ?>
- <section class="featured-posts rslides_container">
- <div class="featuredposts-heading"><?php _e( 'Featured Posts', 'tiga' ); ?></div>
-
- <?php get_template_part( 'content', 'featured' ); ?>
-
- </section> <!-- end .featured-posts -->
- <?php endif; ?>
-
- <section class="recent-posts">
- <div class="recentposts-heading"><?php _e( 'Recent Posts', 'tiga' ); ?></div>
-
- <?php get_template_part( 'content', 'recent' ); ?>
-
- </section> <!-- end .recent-posts -->
-
- </div><!-- #content -->
- </div><!-- #primary .site-content -->
-
-<?php get_sidebar(); ?>
-<?php get_footer(); ?>
62 index.php
View
@@ -1,3 +1,61 @@
<?php
-// Silence is golden.
-?>
+/**
+ * The main template file.
+ *
+ * This is the most generic template file in a WordPress theme
+ * and one of the two required files for a theme (the other being style.css).
+ * It is used to display a page when nothing more specific matches a query.
+ * E.g., it puts together the home page when no home.php file exists.
+ * Learn more: http://codex.wordpress.org/Template_Hierarchy
+ *
+ * @package tiga
+ * @since tiga 0.0.3
+ */
+
+get_header(); ?>
+
+ <div id="primary" class="site-content">
+ <div id="content" role="main">
+
+ <?php if( of_get_option('tiga_show_featured') ) : ?>
+ <section class="featured-posts rslides_container">
+ <div class="featuredposts-heading"><?php _e( 'Featured Posts', 'tiga' ); ?></div>
+
+ <?php get_template_part( 'content', 'featured' ); ?>
+
+ </section> <!-- end .featured-posts -->
+ <?php endif; ?>
+
+ <?php
+ $paged = 1;
+ if ( get_query_var( 'paged' ) ) { $paged = get_query_var( 'paged' ); }
+ if ( get_query_var( 'page' ) ) { $paged = get_query_var( 'page' ); }
+ $paged = intval( $paged );
+
+ $args = array(
+ 'post__not_in' => get_option('sticky_posts'),
+ 'paged' => $paged,
+ );
+ query_posts( $args );
+ if ( have_posts() ) :
+ ?>
+
+ <?php while ( have_posts() ) : the_post(); ?>
+
+ <?php get_template_part( 'content' ); ?>
+
+ <?php endwhile; ?>
+
+ <?php tiga_content_nav( 'nav-below' ); ?>
+
+ <?php elseif ( current_user_can( 'edit_posts' ) ) : ?>
+
+ <?php get_template_part( 'no-results', 'index' ); ?>
+
+ <?php endif; ?>
+
+ </div><!-- #content -->
+ </div><!-- #primary .site-content -->
+
+<?php get_sidebar(); ?>
+<?php get_footer(); ?>
24 library/admin/css/admin-style.css → library/admin/css/optionsframework.css
View
@@ -1,5 +1,5 @@
/*-------------------------------------------------------------------------------------------*/
-/* OptionsFramework Admin Styles */
+/* Options Framework Admin Styles */
/*-------------------------------------------------------------------------------------------*/
.updated {
@@ -7,9 +7,12 @@
margin-bottom:0px !important;
}
#optionsframework {
+ display: inline;
+ float: left;
position:relative;
z-index: 0;
- max-width:780px;
+ width:780px;
+ margin-right: 20px;
background:#fff;
}
#optionsframework h3 {
@@ -18,6 +21,7 @@
#optionsframework p {
margin-bottom:0;
padding-bottom:10px;
+ line-height: 1.4em;
}
#optionsframework .section {
padding:10px 10px 0;
@@ -65,6 +69,7 @@
}
#optionsframework input.checkbox, #optionsframework input.of-radio {
width: 30px;
+ margin-top:2px;
float:left;
clear:both;
}
@@ -159,6 +164,7 @@
/* Editor */
#optionsframework .section-editor .explain {
+ max-width: 98%;
float:none;
margin-bottom:5px;
}
@@ -240,4 +246,18 @@
}
#optionsframework .section:after {
clear: both;
+}
+
+.admin-side {
+ display: inline;
+ float: right;
+ width: 280px;
+}
+
+.admin-side a {
+ text-decoration: none;
+}
+
+#wpbody-content .admin-side .metabox-holder {
+ padding-top: 0;
}
11 library/admin/js/options-custom.js
View
@@ -67,6 +67,15 @@ jQuery(document).ready(function($) {
$('.group').hide();
$(clicked_group).fadeIn();
evt.preventDefault();
+
+ // Editor Height (needs improvement)
+ $('.wp-editor-wrap').each(function() {
+ var editor_iframe = $(this).find('iframe');
+ if ( editor_iframe.height() < 30 ) {
+ editor_iframe.css({'height':'auto'});
+ }
+ });
+
});
$('.group .collapsed input:checkbox').click(unhideHidden);
@@ -98,4 +107,4 @@ jQuery(document).ready(function($) {
$('.of-radio-img-img').show();
$('.of-radio-img-radio').hide();
-});
+});
64 library/admin/options-framework.php
View
@@ -4,7 +4,7 @@
Author: Devin Price
Author URI: http://www.wptheming.com
License: GPLv2
-Version: 1.0
+Version: 1.1
*/
/*
@@ -96,6 +96,9 @@ function optionsframework_init() {
// Registers the settings fields and callback
register_setting( 'optionsframework', $option_name, 'optionsframework_validate' );
+
+ // Change the capability required to save the 'optionsframework' options group.
+ add_filter( 'option_page_capability_optionsframework', 'optionsframework_page_capability' );
}
/**
@@ -164,13 +167,7 @@ function optionsframework_setdefaults() {
if ( !function_exists( 'optionsframework_add_page' ) ) {
function optionsframework_add_page() {
- $of_page = add_theme_page(
- __('Tiga Theme Options', 'tiga'),
- __('Tiga Theme Options', 'tiga'),
- 'edit_theme_options',
- 'options-framework',
- 'optionsframework_page'
- );
+ $of_page = add_theme_page(__('Tiga Theme Options', 'tiga'), __('Tiga Theme Options', 'tiga'), 'edit_theme_options', 'options-framework','optionsframework_page');
// Load the required CSS and javscript
add_action('admin_enqueue_scripts', 'optionsframework_load_scripts');
@@ -182,7 +179,7 @@ function optionsframework_add_page() {
/* Loads the CSS */
function optionsframework_load_styles() {
- wp_enqueue_style('admin-style', OPTIONS_FRAMEWORK_DIRECTORY.'css/admin-style.css');
+ wp_enqueue_style('optionsframework', OPTIONS_FRAMEWORK_DIRECTORY.'css/optionsframework.css');
wp_enqueue_style('color-picker', OPTIONS_FRAMEWORK_DIRECTORY.'css/colorpicker.css');
}
@@ -243,10 +240,49 @@ function optionsframework_page() {
<input type="submit" class="reset-button button-secondary" name="reset" value="<?php esc_attr_e( 'Restore Defaults', 'tiga' ); ?>" onclick="return confirm( '<?php print esc_js( __( 'Click OK to reset. Any theme settings will be lost!', 'tiga' ) ); ?>' );" />
<div class="clear"></div>
</div>
- </form>
-</div> <!-- / #container -->
-</div>
-</div> <!-- / .wrap -->
+ </form>
+ </div> <!-- / #container -->
+
+ <div id="admin-side" class="admin-side">
+
+ <div class="postbox-container">
+ <div class="metabox-holder">
+ <div class="meta-box-sortables ui-sortable">
+
+ <div id="tiga-support" class="postbox">
+ <h3 class="hndle"><span><?php _e('Need a Support ?', 'tiga'); ?></span></h3>
+ <div class="inside">
+ <p><?php _e('You can report an issue <a href="http://satrya.me/tiga-wordpress-theme/" target="_blank">here</a> or you can just drop me an email to asksatrya@gmail.com.', 'tiga'); ?></p>
+ </div>
+ </div>
+
+ <div id="tiga-links" class="postbox">
+ <h3 class="hndle"><span><?php _e('Links', 'tiga'); ?></span></h3>
+ <div class="inside">
+ <ul class="links">
+ <li><a href="http://satrya.me" target="_blank"><?php _e('Tiga by Satrya', 'tiga'); ?></a></li>
+ <li><a href="http://twitter.com/msattt" target="_blank"><?php _e('Follow me on Twitter @msattt', 'tiga'); ?></a></li>
+ </ul>
+ </div>
+ </div>
+
+ <div id="tiga-contribute" class="postbox">
+ <h3 class="hndle"><span><?php _e('Contribute to Tiga Theme', 'tiga'); ?></span></h3>
+ <div class="inside">
+ <ul class="links">
+ <li><?php _e('You can contribute to this project by submitting a translation or you can <a href="https://github.com/satrya/tiga" target="_blank">fork the code on github</a>', 'tiga'); ?></li>
+ </ul>
+ </div>
+ </div>
+
+ </div>
+ </div>
+ </div>
+
+ </div>
+
+ </div>
+ </div> <!-- / .wrap -->
<?php
}
@@ -369,7 +405,7 @@ function optionsframework_adminbar() {
$wp_admin_bar->add_menu( array(
'parent' => 'appearance',
'id' => 'of_theme_options',
- 'title' => __( 'Tiga Theme Options', 'tiga' ),
+ 'title' => __( 'Theme Options', 'tiga' ),
'href' => admin_url( 'themes.php?page=options-framework' )
));
}
82 library/admin/options-interface.php
View
@@ -202,43 +202,73 @@ function optionsframework_fields() {
$output .= optionsframework_medialibrary_uploader( $value['id'], $val, null );
break;
- // Typography
+ // Typography
case 'typography':
-
- $typography_stored = $val;
+
+ unset( $font_size, $font_style, $font_face, $font_color );
+
+ $typography_defaults = array(
+ 'size' => '',
+ 'face' => '',
+ 'style' => '',
+ 'color' => ''
+ );
+
+ $typography_stored = wp_parse_args( $val, $typography_defaults );
+
+ $typography_options = array(
+ 'sizes' => of_recognized_font_sizes(),
+ 'faces' => of_recognized_font_faces(),
+ 'styles' => of_recognized_font_styles(),
+ 'color' => true
+ );
+
+ if ( isset( $value['options'] ) ) {
+ $typography_options = wp_parse_args( $value['options'], $typography_options );
+ }
// Font Size
- $output .= '<select class="of-typography of-typography-size" name="' . esc_attr( $option_name . '[' . $value['id'] . '][size]' ) . '" id="' . esc_attr( $value['id'] . '_size' ) . '">';
- for ($i = 9; $i < 71; $i++) {
- $size = $i . 'px';
- $output .= '<option value="' . esc_attr( $size ) . '" ' . selected( $typography_stored['size'], $size, false ) . '>' . esc_html( $size ) . '</option>';
+ if ( $typography_options['sizes'] ) {
+ $font_size = '<select class="of-typography of-typography-size" name="' . esc_attr( $option_name . '[' . $value['id'] . '][size]' ) . '" id="' . esc_attr( $value['id'] . '_size' ) . '">';
+ $sizes = $typography_options['sizes'];
+ foreach ( $sizes as $i ) {
+ $size = $i . 'px';
+ $font_size .= '<option value="' . esc_attr( $size ) . '" ' . selected( $typography_stored['size'], $size, false ) . '>' . esc_html( $size ) . '</option>';
+ }
+ $font_size .= '</select>';
}
- $output .= '</select>';
// Font Face
- $output .= '<select class="of-typography of-typography-face" name="' . esc_attr( $option_name . '[' . $value['id'] . '][face]' ) . '" id="' . esc_attr( $value['id'] . '_face' ) . '">';
-
- $faces = of_recognized_font_faces();
- foreach ( $faces as $key => $face ) {
- $output .= '<option value="' . esc_attr( $key ) . '" ' . selected( $typography_stored['face'], $key, false ) . '>' . esc_html( $face ) . '</option>';
+ if ( $typography_options['faces'] ) {
+ $font_face = '<select class="of-typography of-typography-face" name="' . esc_attr( $option_name . '[' . $value['id'] . '][face]' ) . '" id="' . esc_attr( $value['id'] . '_face' ) . '">';
+ $faces = $typography_options['faces'];
+ foreach ( $faces as $key => $face ) {
+ $font_face .= '<option value="' . esc_attr( $key ) . '" ' . selected( $typography_stored['face'], $key, false ) . '>' . esc_html( $face ) . '</option>';
+ }
+ $font_face .= '</select>';
}
- $output .= '</select>';
-
- // Font Weight
- $output .= '<select class="of-typography of-typography-style" name="'.$option_name.'['.$value['id'].'][style]" id="'. $value['id'].'_style">';
-
- // Font Style
- $styles = of_recognized_font_styles();
- foreach ( $styles as $key => $style ) {
- $output .= '<option value="' . esc_attr( $key ) . '" ' . selected( $typography_stored['style'], $key, false ) . '>'. $style .'</option>';
+ // Font Styles
+ if ( $typography_options['styles'] ) {
+ $font_style = '<select class="of-typography of-typography-style" name="'.$option_name.'['.$value['id'].'][style]" id="'. $value['id'].'_style">';
+ $styles = $typography_options['styles'];
+ foreach ( $styles as $key => $style ) {
+ $font_style .= '<option value="' . esc_attr( $key ) . '" ' . selected( $typography_stored['style'], $key, false ) . '>'. $style .'</option>';
+ }
+ $font_style .= '</select>';
}
- $output .= '</select>';
// Font Color
- $output .= '<div id="' . esc_attr( $value['id'] ) . '_color_picker" class="colorSelector"><div style="' . esc_attr( 'background-color:' . $typography_stored['color'] ) . '"></div></div>';
- $output .= '<input class="of-color of-typography of-typography-color" name="' . esc_attr( $option_name . '[' . $value['id'] . '][color]' ) . '" id="' . esc_attr( $value['id'] . '_color' ) . '" type="text" value="' . esc_attr( $typography_stored['color'] ) . '" />';
-
+ if ( $typography_options['color'] ) {
+ $font_color = '<div id="' . esc_attr( $value['id'] ) . '_color_picker" class="colorSelector"><div style="' . esc_attr( 'background-color:' . $typography_stored['color'] ) . '"></div></div>';
+ $font_color .= '<input class="of-color of-typography of-typography-color" name="' . esc_attr( $option_name . '[' . $value['id'] . '][color]' ) . '" id="' . esc_attr( $value['id'] . '_color' ) . '" type="text" value="' . esc_attr( $typography_stored['color'] ) . '" />';
+ }
+
+ // Allow modification/injection of typography fields
+ $typography_fields = compact( 'font_size', 'font_face', 'font_style', 'font_color' );
+ $typography_fields = apply_filters( 'of_typography_fields', $typography_fields, $typography_stored, $option_name, $value );
+ $output .= implode( '', $typography_fields );
+
break;
// Background
5 library/admin/options-medialibrary-uploader.php
View
@@ -23,7 +23,7 @@
function optionsframework_mlu_init () {
register_post_type( 'optionsframework', array(
'labels' => array(
- 'name' => __( 'Options Framework Internal Container', 'tiga' ),
+ 'name' => __( 'Theme Options Media', 'tiga' ),
),
'public' => true,
'show_ui' => false,
@@ -33,7 +33,8 @@ function optionsframework_mlu_init () {
'supports' => array( 'title', 'editor' ),
'query_var' => false,
'can_export' => true,
- 'show_in_nav_menus' => false
+ 'show_in_nav_menus' => false,
+ 'public' => false
) );
}
}
36 library/admin/options-sanitize.php
View
@@ -48,7 +48,7 @@ function of_sanitize_multicheck( $input, $option ) {
}
foreach( $input as $key => $value ) {
if ( array_key_exists( $key, $option['options'] ) && $value ) {
- $output[$key] = "1";
+ $output[$key] = "1";
}
}
}
@@ -72,6 +72,20 @@ function of_sanitize_upload( $input ) {
}
add_filter( 'of_sanitize_upload', 'of_sanitize_upload' );
+/* Editor */
+
+function of_sanitize_editor($input) {
+ if ( current_user_can( 'unfiltered_html' ) ) {
+ $output = $input;
+ }
+ else {
+ global $allowedtags;
+ $output = wpautop(wp_kses( $input, $allowedtags));
+ }
+ return $output;
+}
+add_filter( 'of_sanitize_editor', 'of_sanitize_editor' );
+
/* Allowed Tags */
function of_sanitize_allowedtags($input) {
@@ -153,17 +167,17 @@ function of_sanitize_background_attachment( $value ) {
/* Typography */
function of_sanitize_typography( $input, $option ) {
-
+
$output = wp_parse_args( $input, array(
'size' => '',
'face' => '',
'style' => '',
'color' => ''
) );
-
- if ( isset( $option['options']['faces'] ) ) {
- if ( array_key_exists( $input['face'], $option['options']['faces'] ) ) {
- $output['face'] = $input['face'];
+
+ if ( isset( $option['options']['faces'] ) && isset( $input['face'] ) ) {
+ if ( !( array_key_exists( $input['face'], $option['options']['faces'] ) ) ) {
+ $output['face'] = '';
}
}
else {
@@ -173,7 +187,6 @@ function of_sanitize_typography( $input, $option ) {
$output['size'] = apply_filters( 'of_font_size', $output['size'] );
$output['style'] = apply_filters( 'of_font_style', $output['style'] );
$output['color'] = apply_filters( 'of_color', $output['color'] );
-
return $output;
}
add_filter( 'of_sanitize_typography', 'of_sanitize_typography', 10, 2 );
@@ -188,6 +201,7 @@ function of_sanitize_font_size( $value ) {
}
add_filter( 'of_font_size', 'of_sanitize_font_size' );
+
function of_sanitize_font_style( $value ) {
$recognized = of_recognized_font_styles();
if ( array_key_exists( $value, $recognized ) ) {
@@ -218,7 +232,7 @@ function of_recognized_background_repeat() {
'no-repeat' => __('No Repeat', 'tiga'),
'repeat-x' => __('Repeat Horizontally', 'tiga'),
'repeat-y' => __('Repeat Vertically', 'tiga'),
- 'repeat' => __('Repeat All', 'tiga')
+ 'repeat' => __('Repeat All', 'tiga'),
);
return apply_filters( 'of_recognized_background_repeat', $default );
}
@@ -266,7 +280,7 @@ function of_recognized_background_attachment() {
* @return string
*
*/
-
+
function of_sanitize_hex( $hex, $default = '' ) {
if ( of_validate_hex( $hex ) ) {
return $hex;
@@ -283,7 +297,7 @@ function of_sanitize_hex( $hex, $default = '' ) {
*
* @return array
*/
-
+
function of_recognized_font_sizes() {
$sizes = range( 9, 71 );
$sizes = apply_filters( 'of_recognized_font_sizes', $sizes );
@@ -342,7 +356,7 @@ function of_recognized_font_styles() {
* @return bool
*
*/
-
+
function of_validate_hex( $hex ) {
$hex = trim( $hex );
/* Strip recognized prefixes. */
64 library/css/shortcodes.css
View
@@ -7,75 +7,13 @@ Since: tiga 0.0.1
License: GNU General Public License v3
License URI: http://www.gnu.org/licenses/gpl-3.0.html
*/
-/* NOTICE
- ----------------- */
-.notice {
- display: block;
- margin: 5px 0 10px;
- padding: 10px 10px 10px 30px;
-}
-
-.normal {
- background: #eeeeee url('../img/shortcodes/normal.png') no-repeat 7px 15px;
- border: 1px solid #ddd;
- color: #888;
-}
-
-.warning {
- background: #fff6bf url('../img/shortcodes/warning.png') no-repeat 7px 15px;
- border: 1px solid #ffd324;
- color: #514721;
-}
-
-.tip {
- background: #fef6d2 url('../img/shortcodes/idea.png') no-repeat 7px 15px;
- border: 1px solid #EFE3AE;
- color: #514721;
-}
-
-.info {
- background: #d5edf8 url('../img/shortcodes/info.png') no-repeat 7px 15px;
- border: 1px solid #92cae4;
- color: #205791;
-}
-
-.error {
- background: #fbe3e4 url('../img/shortcodes/error.png') no-repeat 7px 15px;
- border: 1px solid #fbc2c4;
- color: #8a1f11;
-}
-
-.download {
- background: #e6efc2 url('../img/shortcodes/download.png') no-repeat 7px 15px;
- border: 1px solid #c6d880;
- color: #264409;
-}
-
-.success {
- background: #edfcd5 url('../img/shortcodes/success.png') no-repeat 7px 15px;
- border: 1px solid #D4EBAF;
- color: #264409;
-}
-
-.help {
- background: #b8e1f3 url('../img/shortcodes/help.png') no-repeat 7px 15px;
- border: 1px solid #77bddd;
- color: #205791;
-}
-
-.delete {
- background: #f7c5c7 url('../img/shortcodes/delete.png') no-repeat 7px 15px;
- border: 1px solid #f9a2a5;
- color: #7b1c0f;
-}
-
/* BUTTON
Copyright (c) 2012 Thibaut Courouble
http://www.webinterfacelab.com/snippets/3d-buttons
Licensed under the MIT License:
http://www.opensource.org/licenses/mit-license.php
- Modified by Satrya - @satryaWp
+ Modified by Satrya - @msattt
----------------- */
.button {
background-color: #dfdfdf;
3  library/img/icons/readme.txt
View
@@ -1 +1,2 @@
-these amazing icon by http://www.designdeck.co.uk/ - https://twitter.com/#!/designdeck/status/199192383290744832
+these amazing icon by http://www.designdeck.co.uk/ -
+Under GPL license - https://twitter.com/#!/designdeck/status/199192383290744832
1  library/img/readme.txt
View
@@ -0,0 +1 @@
+All images here are GPL compatible
BIN  library/img/shortcodes/delete.png
View
Deleted file not rendered
BIN  library/img/shortcodes/download.png
View
Deleted file not rendered
BIN  library/img/shortcodes/error.png
View
Deleted file not rendered
BIN  library/img/shortcodes/help.png
View
Deleted file not rendered
BIN  library/img/shortcodes/idea.png
View
Deleted file not rendered
BIN  library/img/shortcodes/info.png
View
Deleted file not rendered
BIN  library/img/shortcodes/normal.png
View
Deleted file not rendered
22 library/img/shortcodes/readme.txt
View
@@ -1,22 +0,0 @@
-Silk icon set 1.3
-
-_________________________________________
-Mark James
-http://www.famfamfam.com/lab/icons/silk/
-_________________________________________
-
-This work is licensed under a
-Creative Commons Attribution 2.5 License.
-[ http://creativecommons.org/licenses/by/2.5/ ]
-
-This means you may use it for any purpose,
-and make any changes you like.
-All I ask is that you include a link back
-to this page in your credits.
-
-Are you using this icon set? Send me an email
-(including a link or picture if available) to
-mjames@gmail.com
-
-Any other questions about this icon set please
-contact mjames@gmail.com
BIN  library/img/shortcodes/success.png
View
Deleted file not rendered
BIN  library/img/shortcodes/warning.png
View
Deleted file not rendered
2  library/includes/enqueue.php
View
@@ -54,7 +54,7 @@ function tiga_enqueue_scripts() {
wp_enqueue_script( 'plugins', get_template_directory_uri() . '/library/js/plugins.js', array('jquery'), '20120410', true );
- wp_enqueue_script( 'script', get_template_directory_uri() . '/library/js/script.js', array('jquery'), '20120410', true );
+ wp_enqueue_script( 'method', get_template_directory_uri() . '/library/js/methods.js', array('jquery'), '20120410', true );
}
?>
135 library/includes/filters.php
View
@@ -10,21 +10,121 @@
/**
* wp_title filter
+ * Credit: Thematic theme
*
- * @since tiga 0.0.1
+ * @since tiga 0.0.3
*/
add_filter( 'wp_title', 'tiga_title' );
-function tiga_title( $title ) {
+function tiga_title() {
+
+ $site_name = get_bloginfo('name' , 'display');
+ $separator = apply_filters('tiga_doctitle_separator', '|');
+
+ if ( is_single() ) {
+ $content = single_post_title('', FALSE);
+ }
+ elseif ( is_home() || is_front_page() ) {
+ $content = get_bloginfo('description', 'display');
+ }
+ elseif ( is_page() ) {
+ $content = single_post_title('', FALSE);
+ }
+ elseif ( is_search() ) {
+ $content = __('Search Results for:', 'tiga');
+ $content .= ' ' . get_search_query();
+ }
+ elseif ( is_category() ) {
+ $content = __('Category Archives:', 'tiga');
+ $content .= ' ' . single_cat_title('', FALSE);;
+ }
+ elseif ( is_tag() ) {
+ $content = __('Tag Archives:', 'tiga');
+ $content .= ' ' . tiga_tag_query();
+ }
+ elseif ( is_404() ) {
+ $content = __('Not Found', 'tiga');
+ }
+ else {
+ $content = get_bloginfo('description', 'display');
+ }
+
+ if ( get_query_var('paged') ) {
+ $content .= ' ' .$separator. ' ';
+ $content .= 'Page';
+ $content .= ' ';
+ $content .= get_query_var('paged');
+ }
+
+ if($content) {
+ if ( is_home() || is_front_page() ) {
+ $elements = array(
+ 'site_name' => $site_name,
+ 'separator' => $separator,
+ 'content' => $content
+ );
+ }
+ else {
+ $elements = array(
+ 'content' => $content
+ );
+ }
+ } else {
+ $elements = array(
+ 'site_name' => $site_name
+ );
+ }
+
+ // Filters should return an array
+ $elements = apply_filters('tiga_doctitle', $elements);
+
+ // But if they don't, it won't try to implode
+ if( is_array($elements) ) {
+ $doctitle = implode(' ', $elements);
+ }
+ else {
+ $doctitle = $elements;
+ }
+
+ $doctitle = $doctitle;
+
+ echo $doctitle;
- $site_title = get_bloginfo( 'name' );
- $filtered_title = $site_title . $title;
-
- if ( is_singular() ) {
- $the_title = get_the_title();
- $filtered_title = $the_title;
- }
-
- return $filtered_title;
+}
+
+
+/**
+ * Create nice multi_tag_title
+ * Credit: Thematic theme
+ *
+ * @since tiga 0.0.3
+ */
+function tiga_tag_query() {
+ $nice_tag_query = get_query_var( 'tag' ); // tags in current query
+ $nice_tag_query = str_replace(' ', '+', $nice_tag_query); // get_query_var returns ' ' for AND, replace by +
+ $tag_slugs = preg_split('%[,+]%', $nice_tag_query, -1, PREG_SPLIT_NO_EMPTY); // create array of tag slugs
+ $tag_ops = preg_split('%[^,+]*%', $nice_tag_query, -1, PREG_SPLIT_NO_EMPTY); // create array of operators
+
+ $tag_ops_counter = 0;
+ $nice_tag_query = '';
+
+ foreach ($tag_slugs as $tag_slug) {
+ $tag = get_term_by('slug', $tag_slug ,'post_tag');
+ // prettify tag operator, if any
+ if ( isset($tag_ops[$tag_ops_counter]) && $tag_ops[$tag_ops_counter] == ',') {
+ $tag_ops[$tag_ops_counter] = ', ';
+ } elseif ( isset( $tag_ops[$tag_ops_counter]) && $tag_ops[$tag_ops_counter] == '+') {
+ $tag_ops[$tag_ops_counter] = ' + ';
+ }
+ // concatenate display name and prettified operators
+ if ( isset( $tag_ops[$tag_ops_counter] ) ) {
+ $nice_tag_query = $nice_tag_query.$tag->name.$tag_ops[$tag_ops_counter];
+ $tag_ops_counter += 1;
+ } else {
+ $nice_tag_query = $nice_tag_query.$tag->name;
+ $tag_ops_counter += 1;
+ }
+ }
+ return $nice_tag_query;
}
@@ -186,4 +286,17 @@ function tiga_wp_page_menu ($page_markup) {
return $new_markup;
}
+
+/**
+ * Customize tag cloud widget
+ *
+ * @since tiga 0.0.1
+ */
+add_filter( 'widget_tag_cloud_args', 'tiga_new_tag_cloud' );
+function tiga_new_tag_cloud( $args ) {
+ $args['largest'] = 12;
+ $args['smallest'] = 12;
+ $args['unit'] = 'px';
+ return $args;
+}
?>
20 library/includes/options-functions.php
View
@@ -8,6 +8,7 @@
add_action('wp_head', 'tiga_custom_favicon', 5);
add_action('wp_head', 'tiga_custom_css', 10);
+add_action('wp_head', 'tiga_custom_background', 10);
add_action('wp_head', 'tiga_iframe_blocker', 11);
add_filter( 'body_class', 'tiga_custom_layouts' );
add_action('wp_head', 'tiga_meta_google', 2);
@@ -30,6 +31,25 @@ function tiga_custom_css() {
}
/**
+ * Custom background
+ *
+ * @since tiga 0.0.3
+ */
+function tiga_custom_background() {
+ $bg = of_get_option('tiga_custom_bg');
+
+ if($bg) { ?>
+ <style type="text/css">
+ <?php if ($bg['image']) {
+ echo 'body { background: '.$bg['color'].' url('. esc_url( $bg['image'] ). ') '.$bg['repeat'].' '.$bg['position'].' '.$bg['attachment'].'; }'. "\n";
+ } else {
+ echo 'body { background: '.$bg['color']. ' }'. "\n";
+ } ?>
+ </style>
+ <?php }
+}
+
+/**
* Output favicon from theme options
*
* @since tiga 0.0.1
448 library/includes/options.php
View
@@ -7,13 +7,6 @@
* @package tiga
* @since tiga 0.0.1
*/
-
-/**
- * A unique identifier is defined to store the options in the database and reference them from the theme.
- * By default it uses the theme name, in lowercase and without spaces, but this can be changed if needed.
- * If the identifier changes, it'll appear as if the options have been reset.
- *
- */
function optionsframework_option_name() {
// This gets the theme name from the stylesheet (lowercase and without spaces)
@@ -28,242 +21,321 @@ function optionsframework_option_name() {
/**
* Defines an array of options that will be used to generate the settings page and be saved in the database.
- * When creating the 'id' fields, make sure to use all lowercase and no spaces.
*
*/
function optionsframework_options() {
- // Number data
- $numbers = array('2' => __('Two', 'tiga'), '3' => __('Three', 'tiga'), '4' => __('Four', 'tiga'), '5' => __('Five', 'tiga'), '6' => __('Six', 'tiga'), '7' => __('Seven', 'tiga'), '8' => __('Eight', 'tiga'), '9' => __('Nine', 'tiga'), '10' => __('Ten', 'tiga') );
-
- // Enable disable
- $endi_select = array('enable' => __('Enable', 'tiga'), 'disable' => __('Disable', 'tiga') );
-
// Background Defaults
+ $tiga_background = array(
+ 'color' => '',
+ 'image' => '',
+ 'repeat' => 'repeat',
+ 'position' => 'top center',
+ 'attachment'=>'scroll'
+ );
- $background_defaults = array('color' => '', 'image' => '', 'repeat' => 'repeat','position' => 'top center','attachment'=>'scroll');
+ $tiga_numbers = array(
+ '2' => __('Two', 'tiga'),
+ '3' => __('Three', 'tiga'),
+ '4' => __('Four', 'tiga'),
+ '5' => __('Five', 'tiga'),
+ '6' => __('Six', 'tiga'),
+ '7' => __('Seven', 'tiga'),
+ '8' => __('Eight', 'tiga'),
+ '9' => __('Nine', 'tiga'),
+ '10' => __('Ten', 'tiga')
+ );
+ $tiga_select = array(
+ 'enable' => __('Enable', 'tiga'),
+ 'disable' => __('Disable', 'tiga')
+ );
+
+ $tiga_social = array(
+ 'tiga_post' => __('Single post', 'tiga'),
+ 'tiga_page' => __('Page', 'tiga'),
+ 'tiga_both' => __('Both', 'tiga'),
+ 'tiga_none' => __('None', 'tiga')
+ );
- // Pull all the categories into an array
- $options_categories = array();
- $options_categories_obj = get_categories();
- foreach ($options_categories_obj as $category) {
- $options_categories[$category->cat_ID] = $category->cat_name;
- }
-
- // Pull all the pages into an array
- $options_pages = array();
- $options_pages_obj = get_pages('sort_column=post_parent,menu_order');
- $options_pages[''] = 'Select a page:';
- foreach ($options_pages_obj as $page) {
- $options_pages[$page->ID] = $page->post_title;
- }
-
- // If using image radio buttons, define a directory path
- $imagepath = get_stylesheet_directory_uri() . '/library/images/';
- $imageadminpath = get_stylesheet_directory_uri() . '/library/admin/images/';
- $imageadminpathlayouts = get_stylesheet_directory_uri() . '/library/admin/images/layouts/';
+ $imagepath = get_stylesheet_directory_uri() . '/library/admin/images/layouts/';
$options = array();
- $options[] = array( 'name' => __('General Settings', 'tiga'),
- 'type' => 'heading');
+ $options[] = array(
+ 'name' => __('General', 'tiga'),
+ 'type' => 'heading'
+ );
- $options[] = array( 'name' => __('Custom Logo', 'tiga'),
- 'desc' => __('Upload a logo for your website, or specify the image address of your online logo. (http://example.com/logo.png)', 'tiga'),
- 'id' => 'tiga_custom_logo',
- 'type' => 'upload');
+ $options[] = array(
+ 'name' => __('Custom Logo', 'tiga'),
+ 'desc' => __('Upload a logo for your website, or specify the image address of your online logo. (http://example.com/logo.png)', 'tiga'),
+ 'id' => 'tiga_custom_logo',
+ 'type' => 'upload'
+ );
- $options[] = array( 'name' => __('Custom Favicon', 'tiga'),
- 'desc' => __('Upload a favicon for your website, or specify the image address of your online favicon. (http://example.com/favicon.png)', 'tiga'),
- 'id' => 'tiga_custom_favicon',
- 'type' => 'upload');
+ $options[] = array(
+ 'name' => __('Custom Favicon', 'tiga'),
+ 'desc' => __('Upload a favicon for your website, or specify the image address of your online favicon. (http://example.com/favicon.png)', 'tiga'),
+ 'id' => 'tiga_custom_favicon',
+ 'type' => 'upload'
+ );
- $options[] = array( 'name' => __('Custom CSS', 'tiga'),
- 'desc' => __('Quickly add some CSS to your theme by adding it to this block.', 'tiga'),
- 'id' => 'tiga_custom_css',
- 'std' => '',
- 'type' => 'textarea');
+ $options[] = array(
+ 'name' => __('Custom CSS', 'tiga'),
+ 'desc' => __('Quickly add some CSS to your theme by adding it to this block.', 'tiga'),
+ 'id' => 'tiga_custom_css',
+ 'std' => '',
+ 'type' => 'textarea'
+ );
- $options[] = array( 'name' => __('Analytic Code', 'tiga'),
- 'desc' => __('Paste your Google Analytics (or other) tracking code here. It will be inserted before the closing body tag of your theme.', 'tiga'),
- 'id' => 'tiga_analytic_code',
- 'type' => 'textarea');
+ $options[] = array(
+ 'name' => __('Analytic Code', 'tiga'),
+ 'desc' => __('Paste your Google Analytics (or other) tracking code here. It will be inserted before the closing body tag of your theme.', 'tiga'),
+ 'id' => 'tiga_analytic_code',
+ 'type' => 'textarea'
+ );
- $options[] = array( 'name' => __('Iframe Blocker', 'tiga'),
- 'desc' => __('Enable or disable iframe blocker.', 'tiga'),
- 'id' => 'tiga_iframe_blocker',
- 'std' => 'disable',
- 'type' => 'select',
- 'options' => $endi_select);
+ $options[] = array(
+ 'name' => __('Iframe Blocker', 'tiga'),
+ 'desc' => __('Iframe blocker is for block iframe to your site such as google image.', 'tiga'),
+ 'id' => 'tiga_iframe_blocker',
+ 'std' => 'disable',
+ 'type' => 'select',
+ 'options' => $tiga_select
+ );
/* ============================== End General Settings ================================= */
- $options[] = array( 'name' => __('Theme Settings', 'tiga'),
- 'type' => 'heading');
+ $options[] = array(
+ 'name' => __('Theme', 'tiga'),
+ 'type' => 'heading'
+ );
- $options[] = array( 'name' => __('Facebook open graph default thumb', 'tiga'),
- 'desc' => __('Upload the default facebook open graph thumbnail', 'tiga'),
- 'id' => 'tiga_og_thumb',
- 'type' => 'upload');
+ $options[] = array(
+ 'name' => __('Facebook open graph default thumb', 'tiga'),
+ 'desc' => __('Upload your default facebook open graph thumbnail', 'tiga'),
+ 'id' => 'tiga_og_thumb',
+ 'type' => 'upload'
+ );
- $options[] = array( 'name' => __('Layouts', 'tiga'),
- 'desc' => __('Available layout(left content, right content)', 'tiga'),
- 'id' => 'tiga_layouts',
- 'std' => 'lcontent',
- 'type' => 'images',
- 'options' => array(
- 'lcontent' => $imageadminpathlayouts . '2cr.png',
- 'rcontent' => $imageadminpathlayouts . '2cl.png')
- );
+ $options[] = array(
+ 'name' => __('Layouts', 'tiga'),
+ 'desc' => __('Available layout(left content, right content)', 'tiga'),
+ 'id' => 'tiga_layouts',
+ 'std' => 'lcontent',
+ 'type' => 'images',
+ 'options' => array(
+ 'lcontent' => $imagepath . '2cr.png',
+ 'rcontent' => $imagepath . '2cl.png'
+ )
+ );
+
+ $options[] = array(
+ 'name' => __('Custom background', 'tiga'),
+ 'desc' => __('Customize your background', 'tiga'),
+ 'id' => 'tiga_custom_bg',
+ 'std' => $tiga_background,
+ 'type' => 'background'
+ );
- $options[] = array( 'name' => __('Show featured posts', 'tiga'),
- 'desc' => __('Check this options to show featured posts on home page', 'tiga'),
- 'id' => 'tiga_show_featured',
- 'type' => 'checkbox');
+ $options[] = array(
+ 'name' => __('Show featured posts', 'tiga'),
+ 'desc' => __('Check this options to show featured posts on home page', 'tiga'),
+ 'id' => 'tiga_show_featured',
+ 'type' => 'checkbox'
+ );
- $options[] = array( 'name' => __('Select a number of featured posts', 'tiga'),
- 'desc' => __('How many featured posts you want to show ?', 'tiga'),
- 'id' => 'tiga_featured',
- 'class' => 'hidden',
- 'type' => 'select',
- 'std' => '2',
- 'options' => $numbers);
+ $options[] = array(
+ 'name' => __('Select a number of featured posts', 'tiga'),
+ 'desc' => __('How many featured posts you want to show ?', 'tiga'),
+ 'id' => 'tiga_featured',
+ 'class' => 'hidden',
+ 'type' => 'select',
+ 'std' => '2',
+ 'options' => $tiga_numbers
+ );
- $options[] = array( 'name' => __('Use footer widgets', 'tiga'),
- 'desc' => __('Check this option if you want to use the footer widgets', 'tiga'),
- 'id' => 'tiga_footer_widgets',
- 'type' => 'checkbox');
+ $options[] = array(
+ 'name' => __('Use footer widgets', 'tiga'),
+ 'desc' => __('Check this option if you want to use the footer widgets', 'tiga'),
+ 'id' => 'tiga_footer_widgets',
+ 'type' => 'checkbox'
+ );
- $options[] = array( "name" => __('Display social share button', 'tiga'),
- "desc" => __('Display social share on single post and page', 'tiga'),
- "id" => "tiga_social_share",
- "std" => 'tiga_post', // These items get checked by default
- "type" => "radio",
- "options" => array(
- 'tiga_post' => __('Single post', 'tiga'),
- 'tiga_page' => __('Page', 'tiga'),
- 'tiga_both' => __('Both', 'tiga')
- ));
+ $options[] = array(
+ 'name' => __('Display social share button', 'tiga'),
+ 'desc' => __('Display social share on single post and page', 'tiga'),
+ 'id' => "tiga_social_share",
+ 'std' => 'tiga_post', // These items get checked by default
+ 'type' => "radio",
+ 'options' => $tiga_social
+ );
- $options[] = array( 'name' => __('Display author box', 'tiga'),
- 'desc' => __('Check this option if you want display the author box on single posts', 'tiga'),
- 'id' => 'tiga_author_box',
- 'type' => 'checkbox');
+ $options[] = array(
+ 'name' => __('Display author box', 'tiga'),
+ 'desc' => __('Check this option if you want display the author box on single posts', 'tiga'),
+ 'id' => 'tiga_author_box',
+ 'type' => 'checkbox'
+ );
/* ============================== End Theme Settings ================================= */
- $options[] = array( 'name' => __('Social Settings', 'tiga'),
- 'type' => 'heading');
+ $options[] = array(
+ 'name' => __('Social', 'tiga'),
+ 'type' => 'heading'
+ );
- $options[] = array( 'name' => __('Social settings', 'tiga'),
- 'desc' => __('If you want to display the social button, first you should fill the form below, put only the <strong>username</strong>. After that, go to Appearance > Widgets then drag the widget called &raquo; tiga socia widget.', 'tiga'),
- 'type' => 'info');
+ $options[] = array(
+ 'name' => __('Social settings', 'tiga'),
+ 'desc' => __('If you want to display the social button, first you should fill the form below, put only the <strong>username</strong>. After that, go to Appearance > Widgets then drag the widget called &raquo; tiga socia widget.', 'tiga'),
+ 'type' => 'info'
+ );
- $options[] = array( 'name' => __('Email', 'tiga'),
- 'desc' => __('Your email', 'tiga'),
- 'id' => 'tiga_email',
- 'type' => 'text');
+ $options[] = array(
+ 'name' => __('Email', 'tiga'),
+ 'desc' => __('Your email', 'tiga'),
+ 'id' => 'tiga_email',
+ 'type' => 'text'
+ );
- $options[] = array( 'name' => __('Twitter Username', 'tiga'),
- 'desc' => __('Your twitter username', 'tiga'),
- 'id' => 'tiga_twitter_username',
- 'type' => 'text');
+ $options[] = array(
+ 'name' => __('Twitter Username', 'tiga'),
+ 'desc' => __('Your twitter username', 'tiga'),
+ 'id' => 'tiga_twitter_username',
+ 'type' => 'text'
+ );
- $options[] = array( 'name' => __('Facebook Username', 'tiga'),
- 'desc' => __('Your facebook username', 'tiga'),
- 'id' => 'tiga_fb_username',
- 'type' => 'text');
+ $options[] = array(
+ 'name' => __('Facebook Username', 'tiga'),
+ 'desc' => __('Your facebook username', 'tiga'),
+ 'id' => 'tiga_fb_username',
+ 'type' => 'text'
+ );
- $options[] = array( 'name' => __('Google Plus Username', 'tiga'),
- 'desc' => __('https://plus.google.com/u/<strong>109253446701726260861</strong>', 'tiga'),
- 'id' => 'tiga_gplus_username',
- 'type' => 'text');
+ $options[] = array(
+ 'name' => __('Google Plus Username', 'tiga'),
+ 'desc' => __('https://plus.google.com/u/<strong>109253446701726260861</strong>', 'tiga'),
+ 'id' => 'tiga_gplus_username',
+ 'type' => 'text'
+ );
- $options[] = array( 'name' => __('Youtube Username', 'tiga'),
- 'desc' => __('Your youtube username', 'tiga'),
- 'id' => 'tiga_ytube_username',
- 'type' => 'text');
+ $options[] = array(
+ 'name' => __('Youtube Username', 'tiga'),
+ 'desc' => __('Your youtube username', 'tiga'),
+ 'id' => 'tiga_ytube_username',
+ 'type' => 'text'
+ );
- $options[] = array( 'name' => __('Flickr Username', 'tiga'),
- 'desc' => __('Your flickr username', 'tiga'),
- 'id' => 'tiga_flickr_username',
- 'type' => 'text');
+ $options[] = array(
+ 'name' => __('Flickr Username', 'tiga'),
+ 'desc' => __('Your flickr username', 'tiga'),
+ 'id' => 'tiga_flickr_username',
+ 'type' => 'text'
+ );
- $options[] = array( 'name' => __('Linkedin Username', 'tiga'),
- 'desc' => __('http://id.linkedin.com/in/<strong>username</strong>', 'tiga'),
- 'id' => 'tiga_linkedin_username',
- 'type' => 'text');
+ $options[] = array(
+ 'name' => __('Linkedin Username', 'tiga'),
+ 'desc' => __('http://id.linkedin.com/in/<strong>username</strong>', 'tiga'),
+ 'id' => 'tiga_linkedin_username',
+ 'type' => 'text'
+ );
- $options[] = array( 'name' => __('Pinterest Username', 'tiga'),
- 'desc' => __('Your pinterest username', 'tiga'),
- 'id' => 'tiga_pinterest_username',
- 'type' => 'text');
+ $options[] = array(
+ 'name' => __('Pinterest Username', 'tiga'),
+ 'desc' => __('Your pinterest username', 'tiga'),
+ 'id' => 'tiga_pinterest_username',
+ 'type' => 'text'
+ );
- $options[] = array( 'name' => __('Dribbble Username', 'tiga'),
- 'desc' => __('Your dribbble username', 'tiga'),
- 'id' => 'tiga_dribbble_username',
- 'type' => 'text');
+ $options[] = array(
+ 'name' => __('Dribbble Username', 'tiga'),
+ 'desc' => __('Your dribbble username', 'tiga'),
+ 'id' => 'tiga_dribbble_username',
+ 'type' => 'text'
+ );
- $options[] = array( 'name' => __('Github Username', 'tiga'),
- 'desc' => __('Your github username', 'tiga'),
- 'id' => 'tiga_github_username',
- 'type' => 'text');
+ $options[] = array(
+ 'name' => __('Github Username', 'tiga'),
+ 'desc' => __('Your github username', 'tiga'),
+ 'id' => 'tiga_github_username',
+ 'type' => 'text'
+ );
- $options[] = array( 'name' => __('LastFM Username', 'tiga'),
- 'desc' => __('Your lastfm username', 'tiga'),
- 'id' => 'tiga_lastfm_username',
- 'type' => 'text');
+ $options[] = array(
+ 'name' => __('LastFM Username', 'tiga'),
+ 'desc' => __('Your lastfm username', 'tiga'),
+ 'id' => 'tiga_lastfm_username',
+ 'type' => 'text'
+ );
- $options[] = array( 'name' => __('Vimeo Username', 'tiga'),
- 'desc' => __('Your vimeo username', 'tiga'),
- 'id' => 'tiga_vimeo_username',
- 'type' => 'text');
+ $options[] = array(
+ 'name' => __('Vimeo Username', 'tiga'),
+ 'desc' => __('Your vimeo username', 'tiga'),
+ 'id' => 'tiga_vimeo_username',
+ 'type' => 'text'
+ );
/* ============================== End Social Settings ================================= */
- $options[] = array( 'name' => __('Meta Verification', 'tiga'),
- 'type' => 'heading');
+ $options[] = array(
+ 'name' => __('Meta Verification', 'tiga'),
+ 'type' => 'heading'
+ );
- $options[] = array( 'name' => __('Webmaster Tools Setting', 'tiga'),
- 'desc' => __('You can use the boxes below to verify with the different Webmaster Tools. Only enter the meta values/content. <br />ex: <i><meta name="google-site-verification" content="<b>2141241512</b>" /></i>', 'tiga'),
- 'type' => 'info');
+ $options[] = array(
+ 'name' => __('Webmaster Tools Setting', 'tiga'),
+ 'desc' => __('You can use the boxes below to verify with the different Webmaster Tools. Only enter the meta values/content. <br />ex: <i><meta name="google-site-verification" content="<b>2141241512</b>" /></i>', 'tiga'),
+ 'type' => 'info'
+ );
- $options[] = array( 'name' => __('Google Webmaster Tools', 'tiga'),
- 'desc' => __('<a href="http://www.google.com/webmasters/">Google webmaster tools &raquo;</a>', 'tiga'),
- 'id' => 'tiga_meta_google',
- 'std' => '',
- 'type' => 'text');
+ $options[] = array(
+ 'name' => __('Google Webmaster Tools', 'tiga'),
+ 'desc' => __('<a href="http://www.google.com/webmasters/">Google webmaster tools &raquo;</a>', 'tiga'),
+ 'id' => 'tiga_meta_google',
+ 'std' => '',
+ 'type' => 'text'
+ );
- $options[] = array( 'name' => __('Bing Webmaster', 'tiga'),
- 'desc' => __('<a href="http://www.bing.com/webmaster/">Bing webmaster &raquo;</a>', 'tiga'),
- 'id' => 'tiga_meta_bing',
- 'std' => '',
- 'type' => 'text');
+ $options[] = array(
+ 'name' => __('Bing Webmaster', 'tiga'),
+ 'desc' => __('<a href="http://www.bing.com/webmaster/">Bing webmaster &raquo;</a>', 'tiga'),
+ 'id' => 'tiga_meta_bing',
+ 'std' => '',
+ 'type' => 'text'
+ );
- $options[] = array( 'name' => __('Alexa', 'tiga'),
- 'desc' => __('<a href="http://www.alexa.com/">Alexa &raquo;</a>', 'tiga'),
- 'id' => 'tiga_meta_alexa',
- 'std' => '',
- 'type' => 'text');
+ $options[] = array(
+ 'name' => __('Alexa', 'tiga'),
+ 'desc' => __('<a href="http://www.alexa.com/">Alexa &raquo;</a>', 'tiga'),
+ 'id' => 'tiga_meta_alexa',
+ 'std' => '',
+ 'type' => 'text'
+ );
/* ============================== End Meta Verivication Settings ================================= */
- $options[] = array( 'name' => __('Ads Settings', 'tiga'),
- 'type' => 'heading');
+ $options[] = array(
+ 'name' => __('Ads', 'tiga'),
+ 'type' => 'heading'
+ );
- $options[] = array( 'name' => __('Ads 1', 'tiga'),
- 'desc' => __('Ads after post title on single post', 'tiga'),
- 'id' => 'tiga_ads_after_title',
- 'std' => '',
- 'type' => 'textarea');
+ $options[] = array(
+ 'name' => __('Ads 1', 'tiga'),
+ 'desc' => __('Ads after post title on single post', 'tiga'),
+ 'id' => 'tiga_ads_after_title',
+ 'std' => '',
+ 'type' => 'textarea'
+ );
- $options[] = array( 'name' => __('Ads 2', 'tiga'),
- 'desc' => __('Ads after post content on single post', 'tiga'),
- 'id' => 'tiga_ads_after_content',
- 'std' => '',
- 'type' => 'textarea');
+ $options[] = array(
+ 'name' => __('Ads 2', 'tiga'),
+ 'desc' => __('Ads after post content on single post', 'tiga'),
+ 'id' => 'tiga_ads_after_content',
+ 'std' => '',
+ 'type' => 'textarea'
+ );
/* ============================== End Ads Settings ================================= */
6 library/includes/setup.php
View
@@ -30,12 +30,6 @@ function tiga_setup() {
// Add default posts and comments RSS feed links to <head>.
add_theme_support( 'automatic-feed-links' );
- // Add support for custom backgrounds
- add_custom_background();
-
- // Add support for a variety of post formats
- add_theme_support(