Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*==================================================================
- cheet code
- ==================================================================*/
- <?php the_author(); ?> // To show post author name
- <?php the_author_posts_link(); ?> // To show post author name with author archives link
- <?php the_content(); ?> // To show post content
- <?php the_excerpt(); ?> //Displays the post excerpt with a length of 55 words
- <?php edit_post_link(); ?> // To show edit post link
- <?php next_posts_link( 'Older Entries' ); ?> // To show the previous link
- <?php previous_posts_link( 'Newer Entries' ); ?> // To show the next link
- <?php wp_title(); ?> // The title of your blog
- <?php the_time('m-d-y') ?> // To get time and date
- <?php the_permalink() ?> // To get permanent link for you post/page
- <?php comments_popup_link(); ?> // To get pop-up comment's link
- <?php comments_popup_link( 'Leave a Comment', '1 Comment', '% Comments' ); ?>
- <?php the_category(', ') ?> // To show category >>code
- <?php the_ID(); ?> // To get ID for post/page
- <?php post_class(); ?> // To get class for post/page
- <?php wp_get_archives() ?> // To get Get archive
- <?php get_calendar(); ?> // To get default calender
- <?php wp_list_pages(); ?> // To get site page list
- <?php wp_list_cats(); ?> // To get site category list
- <?php get_links_list(); ?> // To get list for link
- /*==================================================================
- header.php
- ==================================================================*/
- <?php bloginfo('name'); ?> // ব্লগের নাম (Site Title) আনার জন্য
- <?php bloginfo(’description’); ?> // ব্লগের বর্ণনা (Tagline) আনার জন্য
- <?php bloginfo(’wpurl’); ?> // WordPress address (URL) আনার জন্য
- <?php bloginfo(’url’); ?> // Site address (URL) আনার জন্য
- <?php bloginfo('stylesheet_url'); ?> // ডাইনামিক স্টাইল style.css শীট
- <?php bloginfo('html_type'); ?> //Content-Type দেখানোর জন্য
- <?php bloginfo('charset'); ?> //Encoding for page and feeds দেখানোর জন্য
- <?php bloginfo('pingback_url'); ?> //Pingback XML-RPC file URL দেখানোর জন্য
- <?php echo get_template_directory_uri(); ?> // ডাইনামিক থিম ডাইরেক্টরী
- <?php wp_head(); ?> //হেডারের স্ক্রীপ্ট পাওয়ার জন্য
- /*==================================================================
- index.php
- ===================================================================*/
- <?php get_header(); ?> //header.php ফাইল কল করার জন্য
- <?php get_footer(); ?> //footer.php ফাইল কল করার জন্য
- <?php get_sidebar(); ?> //sidebar.php ফাইল কল করার জন্য
- <?php get_search_form(); ?> //searchform.php ফাইল কল করার জন্য
- <?php get_template_part('file_name'); ?> //যে কোন ফাইল কল করার জন্য .php ছাড়া ফাইলের নাম দিতে হবে
- <?php comments_template(); ?> // Call for comment template
- /*==================================================================
- Custom Fields
- ===================================================================*/
- <?php echo get_post_meta($post->ID, 'key', true); ?> //key এর যায়গায় custom fields এর নাম লিখতে হবে
- /*==================================================================
- For_Dynamic_Sidebar
- ===================================================================*/
- //Sidebar.php সাইডবার কল করার জন্য
- <?php dynamic_sidebar('right-sidebar'); ?> //এখানে right_sidebar হল সাইড বারের আইডি।
- //functions.php সাইডবার রেজিস্ট্রার করার জন্য নিচের কোড অন্তর্ভুক্ত করুন
- <?php
- function themename_widget_areas() {
- register_sidebar( array(
- 'name' => __( 'Right Sidebar', 'themename' ),
- 'id' => 'right-sidebar',
- 'description' => __( 'An optional widget area for your welcome message area.', 'themename' ),
- 'before_widget' => '<div class="single_sidebar">',
- 'after_widget' => '</div>',
- 'before_title' => '<h2>',
- 'after_title' => '</h2>',
- ) );
- }
- add_action('widgets_init', 'themename_widget_areas');
- ?>
- /*=============================================================
- For Dynamic Menu
- ===============================================================*/
- //functions.php তে নিচের কোড অন্তর্ভুক্ত করুন
- //To add main menu
- <?php
- // To add a single menu
- if (function_exists('register_nav_menu')) {
- register_nav_menu( 'main_menu', __( 'Main Menu') );
- }
- // To add multiple menu
- if (function_exists('register_nav_menus')) {
- register_nav_menus( array(
- 'main_menu' => 'Main Menu',
- 'footer_menu' => 'Footer Menu'
- ) );
- }
- ?>
- // যেখানে মেনু ব্যবহার করতে চান সেখানে নিচের কোড অন্তর্ভুক্ত করুন
- <?php wp_nav_menu( array( 'theme_location' => 'main_menu','menu_class' => '', 'menu_id' => '') ); ?>
- /*===================================================
- Adding WordPress Loop
- =====================================================*/
- <?php if(have_posts()) : while ( have_posts() ) : the_post(); ?>
- /*All content goes here*/
- <?php endwhile; endif; ?>
- /*===================================================
- For displaying all single posts
- =====================================================*/
- <?php if(have_posts()) : while(have_posts()) : the_post(); ?>
- <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
- <h2 class="entry_title"><a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php printf( esc_attr__( 'Permalink to %s', 'compass' ), the_title_attribute( 'echo=0' ) ); ?>"><?php the_title(); ?></a></h2>
- <div class="entry_meta">
- <p>Posted on <?php the_date(); ?> by <?php the_author(); ?></p>
- </div>
- <div class="entry_content">
- <?php the_content(); ?>
- </div>
- <?php comments_template( '', true ); ?>
- </div>
- <?php endwhile; else : ?>
- <h3><?php _e('404 Error: Not Found'); ?></h3>
- <?php endif; ?>
- /*===================================================
- For enable featured image with auto crop
- =====================================================*/
- add_theme_support( 'post-thumbnails', array( 'post' ) );
- if ( function_exists( 'add_image_size' ) ) {
- add_image_size( 'category-thumb', 300 ); //300 pixels wide (and unlimited height)
- add_image_size( 'custom-size', 220, 180 ); // 220 pixels wide by 180 pixels tall, soft proportional crop mode
- add_image_size( 'homepage-thumb', 220, 180, true ); // 220 pixels wide by 180 pixels tall, hard crop mode
- }
- //ব্যবহার করতে নিচের কেডটি বসাতে হবে
- <?php
- if ( has_post_thumbnail() ) {
- the_post_thumbnail( 'your-custom-size' );
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement