Skip to content

Instantly share code, notes, and snippets.

@shahadat014
Created March 7, 2015 06:07
Show Gist options
  • Save shahadat014/32c52bf921e071f171e2 to your computer and use it in GitHub Desktop.
Save shahadat014/32c52bf921e071f171e2 to your computer and use it in GitHub Desktop.
option-tree,archive
// call, function php for option tree
// option tree
include_once('option-tree/theme-options.php');
/**
* Required: set 'ot_theme_mode' filter to true.
*/
add_filter( 'ot_theme_mode', '__return_true' );
/**
* Required: include OptionTree.
*/
require( trailingslashit( get_template_directory() ) . 'option-tree/ot-loader.php' );
//call,page directory
<?php
$text_option_title = ot_get_option( 'text_option_title' );
$text_option_desc = ot_get_option( 'text_option_desc' );
?>
//call,right location
<h2><?php echo $text_option_title; ?></h2>
// archive php
<div class="row">
<div class="col-lg-8">
<?php if ( have_posts() ) : ?>
<h1 class="archive_title fix">
<?php $post = $posts[0]; // Hack. Set $post so that the_date() works. ?>
<?php /* If this is a category archive */ if (is_category()) { ?>
<?php _e('Archive for the', 'brightpage'); ?> '<?php echo single_cat_title(); ?>' <?php _e('Category', 'brightpage'); ?>
<?php /* If this is a tag archive */ } elseif( is_tag() ) { ?>
<?php _e('Archive for the', 'brightpage'); ?> <?php single_tag_title(); ?> Tag
<?php /* If this is a daily archive */ } elseif (is_day()) { ?>
<?php _e('Archive for', 'brightpage'); ?> <?php the_time('F jS, Y'); ?>
<?php /* If this is a monthly archive */ } elseif (is_month()) { ?>
<?php _e('Archive for', 'brightpage'); ?> <?php the_time('F, Y'); ?>
<?php /* If this is a yearly archive */ } elseif (is_year()) { ?>
<?php _e('Archive for', 'brightpage'); ?> <?php the_time('Y'); ?>
<?php /* If this is a search */ } elseif (is_search()) { ?>
<?php _e('Search Results', 'brightpage'); ?>
<?php /* If this is an author archive */ } elseif (is_author()) { ?>
<?php _e('Author Archive', 'brightpage'); ?>
<?php /* If this is a paged archive */ } elseif (isset($_GET['paged']) && !empty($_GET['paged'])) { ?>
<?php _e('Blog Archives', 'brightpage'); ?>
<?php } ?>
</h1>
<?php get_template_part( 'post-excerpt' ); ?>
<?php get_template_part('inc/pagination'); ?>
<?php else : ?>
<h2><?php _e('404 Error&#58; Not Found', 'Brightpage'); ?></h2>
<?php endif; ?>
</div>
<?php get_sidebar(); ?>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment