Created
December 13, 2016 06:42
-
-
Save mustafix/243c3d359ed15324dc5e168e98f56008 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
<?php if () : ?> | |
<?php else : ?> | |
<?php endif; ?> | |
<?php echo get_template_directory_uri(); ?> | |
<?php the_post_thumbnail('add_image_size'); ?> | |
<?php the_ID(); ?> // Title আনার জন্য | |
<?php the_title(); ?> // Title আনার জন্য | |
<?php the_content(); ?> // post এর পুরো অংশ আনার জন্য | |
<?php the_excerpt(); ?> // post এর কিছু অংশ আনার জন্য | |
<?php echo site_url(); ?> // home page link এর জন্য | |
<?php the_permalink(); ?> | |
<?php get_template_part('index'); ?> //Without extension | |
<?php the_author_posts_link(); ?> // Authore এর পোস্ট লিঙ্ক সহ আনার জন্য | |
<?php the_category(', '); ?> // Category আনার জন্য | |
<?php the_time('g:i a'); ?> at <?php the_time('F j, Y'); ?> // সময় আনার জন্য | |
<?php comments_template('', true); ?> // Default comment box আনার জন্য | |
//************************************************************************************************************************************ | |
add_theme_support('post-formats', array('aside', 'audio', 'video')); | |
add_theme_support('post-thumbnails'); | |
add_image_size('post-type-name',340,250,true); | |
//************************************************************************************************************************************ | |
<?php the_post_thumbnail('post-image', array('class' => '')); ?> | |
<?php $protfolio_category=get_post_meta($post->ID, 'protfolio_category', true); ?> | |
<?php $protfolio_thumb = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'protfolio-thumb' ); ?> | |
<?php echo $protfolio_thumb[0]; ?> | |
//************************************************************************************************************************************ | |
<?php if (have_posts()) : ?> | |
<?php while (have_posts()) : the_post(); ?> | |
<!----- your content !!!!!! ----> | |
<?php endwhile; ?> | |
<?php else : ?> | |
<h2>404,Not found</h2> | |
<?php endif; ?> | |
//************************************************************************************************************************************ | |
<?php | |
global $post; | |
$args = array('posts_per_pages' => 3, 'post_type' =>'protfolio'); | |
$myposts = get_posts($args); | |
foreach( $myposts as $post ) : setup_postdata($post); ?> | |
//----- your content !!!!!! ----// | |
<?php endforeach; ?> | |
//************************************************************************************************************************************ | |
<?php | |
add_filter( 'ot_show_pages', '__return_false' ); | |
add_filter( 'ot_show_new_layout', '__return_false' ); | |
add_filter( 'ot_theme_mode', '__return_true' ); | |
//উপরের code গুলা functions.php এর মাজে দিতে হবে। | |
theme option shows(options tree): | |
index.php | |
/* Single value আনার জন্ন্য */ | |
<?php $variable=ot_get_option('your_id'); ?> | |
<?php echo $variable; ?> | |
/* Social Icon show */ | |
<ul> | |
<?php | |
$socialicons = ot_get_option( 'social_icon', array() ); | |
if ( ! empty( $socialicons ) ) { | |
foreach( $socialicons as $socialicon ) { | |
echo '<a href="'.$socialicon['social_icon_link'].'" class="icon circle tooltip" title="Find us on '.$socialicon['social_icon_name'].'"><i class="fa fa-'.$socialicon['social_icon_name'].'"></i></a>'; | |
} | |
} | |
?> | |
</ul> | |
theme option shows(options framework): | |
index.php | |
<?php global $data; ?> | |
<?php if($data['your_id']) : ?> | |
<?php echo $data['your_id']; ?> | |
<?php endif; ?> | |
//************************************************************************************************************************************ | |
<?php if ( comments_open() ) : ?> | |
<span class="entry-comments"><?php comments_popup_link('No Comments', '1 Comment', '% Comments'); ?></span> | |
<?php endif; ?> | |
// Tag | |
<?php | |
if (function_exists('the_tags')) the_tags('Tags:',',',','); | |
?> | |
//************************************************************************************************************************************ | |
<?php if (function_exists('wp-pagenavi')) { wp-pagenavi(); } else { include('navigation.php'); } ?> | |
//************************************************************************************************************************************ | |
comment এর replay box আনার জন্য word-press এর default script "function.php" এর মধা বাবহার করতে হবে | |
<?php | |
function comment_script(){ | |
if(is_singular()) wp_enqueue_script('comment-repaly'); | |
} | |
add_action('wp_enqueue_script', 'comment_script'); | |
?> | |
//************************************************************************************************************************************ | |
// archive er jonno | |
<?php if (have_posts()) : ?> | |
<?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 } ?> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment