Skip to content

Instantly share code, notes, and snippets.

View mustafix's full-sized avatar

Mustafizur Rahman mustafix

View GitHub Profile
<?php
// function.php
function single_shortcode( $atts, $content = null ) {
extract( shortcode_atts( array(
'title' => '',
'des' => '',
<?php if(have_posts()) : ?>
<?php while(have_posts()) : the_post(); ?>
<h3><?php the_title(); ?></h3>
<?php the_content(); ?>
<?php endwhile; ?>
<?php else : ?>
<?php
//----------------------------------------------------------
'.get_the_title().'
'.get_the_content().'
'.get_the_excerpt().'
'.get_the_author().' // author এর নাম আনার জন্য
'.get_author_posts_url(get_the_author_meta('ID')).' // author এর নাম এর সাতে লিঙ্ক আনার জন্য
'.get_avatar(get_the_author_meta('ID'), 60).' // avata থেকে user এর ছবি আনার জন্য
'.get_the_date().'
// html code
===========================================
<div class="main-menu floatright">
<ul id="nav">
<li><a href="">Home</a></li>
<li><a href="">About Me</a></li>
// for comments
<?php if ( comments_open() ) : ?>
<span class="on-your-class"><?php comments_popup_link('No Comment', '1 Comment', '% Comments'); ?></span>
<?php endif; ?>
// for tags
<span class="entry-tags"><?php if (function_exists('the_tags')) the_tags('Tags: ', ', '); ?></span>
<div class="nav-previous">
<?php next_posts_link( __( '<span class="meta-nav">&larr;</span> Previous Posts', 'twentyeleven' ) ); ?>
</div>
<div class="nav-next">
<?php previous_posts_link( __( 'Next Posts <span class="meta-nav">&rarr;</span> ', 'twentyeleven' ) ); ?>
</div>
<!---
উপরের কোড এর সাথে এই স্টাইল টি দিলে দেখতে সুন্দর লাগবে
<?php if(have_posts()) : ?>
<?php while(have_posts()) : the_post(); ?>
<h3><?php the_title(); ?></h3>
<?php the_content(); ?>
<?php endwhile; ?>
<?php else : ?>
<h2>404 Not Found !</h2>
<?php endif; ?>
<?php if(function_exists('wp-pagenavi')){wp-pagenavi();} else {include('navigation.php');} ?>
<?php
<?php if () : ?>
<?php else : ?>
<?php endif; ?>
<?php echo get_template_directory_uri(); ?>
<?php the_post_thumbnail('add_image_size'); ?>
@mustafix
mustafix / Archive
Last active October 31, 2017 13:08
<?php
if( is_category() ){
single_cat_title();
}elseif( is_tag() ){
single_tag_title();
}elseif( is_author() ){
the_post();
echo 'Author Archive: '.get_the_author();
rewind_posts();
}elseif( is_day() ){