Advertisement
arnabkumar

Wordpress Bengali help-sheet

Apr 29th, 2014
188
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 27.22 KB | None | 0 0
  1. WP Theme Development-1 (Create PHP Files)
  2. By Rasel Ahmed in আর আর ফাউন্ডেশনন্ডেশন ( অফিফিসিয়াল গ্রুপ )
  3. ==================================
  4. < ?php bloginfo('name'); ?> = ব্লগেশনগের নাম আনার জনয
  5. < ?php echo get_template_directory_uri(); ?> = ডাইনািমক িথিম ডাইেশনরক্টরী
  6. < ?php bloginfo('stylesheet_url'); ?> = ডাইনািমক স্টাইল শীট
  7. < ?php wp_head(); ?> = েহেডােশনরর স্ক্রীপ্ট পাওয়ার জনয
  8. index.php
  9. ==================================
  10. < ?php get_header(); ?> = header.php ফাইল কল করার জনয
  11. < ?php get_footer(); ?> = footer.php ফাইল কল করার জনয
  12. < ?php get_sidebar(); ?> = sidebar.php ফাইল কল করার জনয
  13. < ?php get_template_part('file_name'); ?> = েযে েকান ফাইল কল করার জনয
  14. functions.php
  15. ==================================
  16. সাইডবার েরিজিস্ট্রার করার জিন্য্
  17. function rasel_widget_areas() {
  18. register_sidebar( array(
  19. 'name' => __( 'Left Menu', 'rasel' ),
  20. 'id' => 'left_sidebar',
  21. 'before_widget' => '
  22. ',
  23. 'after_widget' => '
  24. ',
  25. 'before_title' => '
  26. ',
  27. 'after_title' => '',
  28. ) );
  29. }
  30. add_action('widgets_init', 'rasel_widget_areas');
  31. Sidebar.php
  32. ===================================
  33. সিাইডবার কল করার জনয
  34. = এখােশনন left_sidebar হেল সিাইড বােশনরর আইিড।
  35. েসিাসির্স িথিম ডাউন্ডনেশনলাড: http://rrfoundation.net/example/wp_theme_development/part_one_source.zip
  36. িটউন্ডেশনটািরয়াল িলংক: http://rrfoundation.net/318
  37. WP Theme Development-2 (Blog Page Query)
  38. By Rasel Ahmed in আর আর ফাউন্ডেশনন্ডেশন ( অফিফিসিয়াল গ্রুপ )
  39. Post Query in index.php
  40. =====================================
  41. <?php if(have_posts()) : ?>
  42. <?php while (have_posts()) : the_post(); ?>
  43. <!-- Your Post Query here -->
  44. <?php endwhile; ?>
  45. <?php endif; ?>
  46. Pagination in index.php
  47. =====================================
  48. <div class="nav-previous"><?php next_posts_link( __( '<span class="meta-nav">&larr;</span> Older
  49. posts') ); ?></div><div class="nav-next"><?php previous_posts_link( __( 'Newer posts <span
  50. class="meta-nav">&rarr;</span>') ); ?></div>
  51. Post Information Query in index.php
  52. =====================================
  53. <?php the_title(); ?> = েপােশনস্টর িশেশনরানাম আনার জনয
  54. <?php the_permalink(); ?> = েপােশনস্টর িলংক আনার জনয
  55. <?php the_time('M d, Y') ?> = েপােশনস্টর সিময় আনার জনয
  56. <?php the_excerpt(); ?> = েপােশনস্টর সিারাংশ আনার জনয
  57. <?php the_content(); ?> = েপােশনস্টর পুরেশনরা অফংশ আনার জনয
  58. <?php the_category(', '); ?> = েপােশনস্টর িবভাগে আনার জনয
  59. <?php comments_popup_link('No Comment', '1 Comment', '% Comments'); ?> = েপােশনস্ট কেশনমন্ট সিংখযা ও তার
  60. িলংক আনার জনয
  61. িটউন্ডেশনটািরয়াল িলংক: http://rrfoundation.net/322
  62. েসিাসির্স িথিম ডাউন্ডনেশনলাড: http://rrfoundation.net/example/wp_theme_development/part_two_source.zip
  63. WP Theme Development-3 (Single Post & Archive Page)
  64. By Rasel Ahmed in আর আর ফাউন্ডেশনন্ডেশন ( অফিফিসিয়াল গ্রুপ )
  65. single.php
  66. <?php if(have_posts()) : ?><?php while(have_posts()) : the_post(); ?>
  67. <h2><?php the_title(); ?></h2>
  68. <?php the_content(); ?>
  69. <?php comments_template( '', true ); ?>
  70. <?php endwhile; ?>
  71. <?php else : ?>
  72. <h3><?php _e('404 Error&#58; Not Found'); ?></h3>
  73. <?php endif; ?>
  74. archive.php
  75. for Archive & Archive Post List
  76. <h1>
  77. <?php if (have_posts()) : ?>
  78. <?php $post = $posts[0]; // Hack. Set $post so that the_date() works. ?>
  79. <?php /* If this is a category archive */ if (is_category()) { ?>
  80. <?php _e('Archive for the'); ?> '<?php echo single_cat_title(); ?>' <?php _e('Category'); ?>
  81. <?php /* If this is a tag archive */ } elseif( is_tag() ) { ?>
  82. <?php _e('Archive for the'); ?> <?php single_tag_title(); ?> Tag
  83. <?php /* If this is a daily archive */ } elseif (is_day()) { ?>
  84. <?php _e('Archive for'); ?> <?php the_time('F jS, Y'); ?>
  85. <?php /* If this is a monthly archive */ } elseif (is_month()) { ?>
  86. <?php _e('Archive for'); ?> <?php the_time('F, Y'); ?>
  87. <?php /* If this is a yearly archive */ } elseif (is_year()) { ?>
  88. <?php _e('Archive for'); ?> <?php the_time('Y'); ?>
  89. <?php /* If this is a search */ } elseif (is_search()) { ?>
  90. <?php _e('Search Results'); ?>
  91. <?php /* If this is an author archive */ } elseif (is_author()) { ?>
  92. <?php _e('Author Archive'); ?>
  93. <?php /* If this is a paged archive */ } elseif (isset($_GET['paged']) && !
  94. empty($_GET['paged'])) { ?>
  95. <?php _e('Blog Archives'); ?>
  96. <?php } ?>
  97. </h1>
  98. For archive post query
  99. <?php get_template_part( 'post-excerpt' ); // Post Excerpt (post-excerpt.php) ?>
  100. If no post in archive or 404
  101. <?php else : ?>
  102. <h3><?php _e('404 Error&#58; Not Found'); ?></h3>
  103. <?php endif; ?>
  104. 404.php
  105. <h2>404 Error&#58; Not Found</h2>
  106. <p>Sorry, but the page you are trying to reach is unavailable or does not exist.</p>
  107. িটউন্ডেশনটািরয়াল িলংক: http://rrfoundation.net/337
  108. েসিাসির্স ফাইল ডাউন্ডনেশনলাড: http://sdrv.ms/T4THqZ
  109. WP Theme Development-4 (Stylize Comments & Featured
  110. Image)
  111. By Rasel Ahmed in আর আর ফাউন্ডেশনন্ডেশন ( অফিফিসিয়াল গ্রুপ )
  112. Adding Comment CSS
  113. Pastebin Link for CSS: http://pastebin.com/VaxfkmMe
  114. ------------------------------------------------------------------
  115. /* ===================== comments ===================== */
  116. .comments {margin: 10px 0;}
  117. .comments h3 {margin:50px 0 30px 0;font-size:24px;}
  118. ol.commentlist { list-style:none; margin:0 0 1em; padding:0; text-indent:0; }
  119. ol.commentlist li { }
  120. ol.commentlist li.alt { }
  121. ol.commentlist li.bypostauthor {}
  122. ol.commentlist li.byuser {}
  123. ol.commentlist li.comment-author-admin {}
  124. ol.commentlist li.comment { border-bottom: 1px solid #ddd; padding:1em; margin-bottom: 10px; }
  125. ol.commentlist li div.comment-author {}
  126. ol.commentlist li div.vcard { font-size:20px;}
  127. ol.commentlist li div.vcard cite.fn { font-style:normal; }
  128. ol.commentlist li div.vcard cite.fn a.url {}
  129. ol.commentlist li div.vcard img.avatar {float:left; margin:0 1em 1em 0; }
  130. ol.commentlist li div.vcard img.avatar-32 {}
  131. ol.commentlist li div.vcard img.photo {}
  132. ol.commentlist li div.vcard span.says {}
  133. ol.commentlist li div.commentmetadata {}
  134. ol.commentlist li div.comment-meta { font-size:9px; margin-bottom: 10px;}
  135. ol.commentlist li div.comment-meta a { color: #aaa; }
  136. ol.commentlist li p { margin: 0; }
  137. ol.commentlist li ul { list-style:square; margin:0 0 1em 2em; }
  138. ol.commentlist li div.reply { font-size:11px; }
  139. ol.commentlist li div.reply a { font-weight:bold; }
  140. ol.commentlist li ul.children { list-style:none; margin:1em 0 0; text-indent:0; }
  141. ol.commentlist li ul.children li {}
  142. ol.commentlist li ul.children li.alt {}
  143. ol.commentlist li ul.children li.bypostauthor {}
  144. ol.commentlist li ul.children li.byuser {}
  145. ol.commentlist li ul.children li.comment {}
  146. ol.commentlist li ul.children li.comment-author-admin {}
  147. ol.commentlist li ul.children li.depth-2 { margin:0 0 .25em .25em; }
  148. ol.commentlist li ul.children li.depth-3 { margin:0 0 .25em .25em; }
  149. ol.commentlist li ul.children li.depth-4 { margin:0 0 .25em .25em; }
  150. ol.commentlist li ul.children li.depth-5 {}
  151. ol.commentlist li ul.children li.odd {}
  152. ol.commentlist li.even { background:#fff; }
  153. ol.commentlist li.odd { background:#f6f6f6; }
  154. ol.commentlist li.parent { }
  155. ol.commentlist li.pingback { margin: 0 0 10px; padding: 1em; border: 1px dashed #ccc; }
  156. ol.commentlist li.thread-alt { }
  157. ol.commentlist li.thread-even { }
  158. ol.commentlist li.thread-odd {}
  159. /* ===================== comment form ===================== */
  160. #respond {position: relative;}
  161. #respond input[type="text"],#respond textarea {border:1px solid #ddd;padding:10px}
  162. #respond input[type="text"] {padding:7px;width:300px}
  163. #respond .comment-form-author,
  164. #respond .comment-form-email,
  165. #respond .comment-form-url,
  166. #respond .comment-form-comment { position: relative; }
  167. #respond .comment-form-author label,
  168. #respond .comment-form-email label,
  169. #respond .comment-form-url label,
  170. #respond .comment-form-comment label { background: #eee; color: #555; display: inline-block; left:
  171. 4px; min-width: 60px; padding: 4px 10px; position: relative; top: 40px; z-index: 1; }
  172. #respond input[type="text"]:focus,
  173. #respond textarea:focus { text-indent: 0; z-index: 1; }
  174. #respond textarea { resize: vertical; width: 95%; }
  175. #respond .comment-form-author .required,
  176. #respond .comment-form-email .required { color: #bd3500; font-size: 22px; font-weight: bold; left:
  177. 75%; position: absolute; top: 45px; z-index: 1; }
  178. #respond .comment-notes,
  179. #respond .logged-in-as { font-size: 13px; }
  180. #respond p { margin: 10px 0; }
  181. #respond .form-submit { float: right; margin: -20px 0 10px; }
  182. #respond input#submit { background: #454545; border: none; -moz-border-radius: 3px; border-radius:
  183. 3px; -webkit-box-shadow: 0px 1px 2px rgba(0,0,0,0.3); -moz-box-shadow: 0px 1px 2px
  184. rgba(0,0,0,0.3); box-shadow: 0px 1px 2px rgba(0,0,0,0.3); color: #eee; cursor: pointer; padding: 5px
  185. 42px 5px 22px; }
  186. #respond input#submit:active { background: #86222D; color: #fff; }
  187. #respond #cancel-comment-reply-link { color: #666; margin-left: 10px; text-decoration: none; }
  188. #respond .logged-in-as a:hover,
  189. #respond #cancel-comment-reply-link:hover { text-decoration: underline; }
  190. .commentlist #respond { margin: 1.625em 0 0; width: auto; }
  191. #reply-title { color: #373737; font-size: 20px; }
  192. #cancel-comment-reply-link { color: #888; display: block; position: absolute; right: 1.625em; textdecoration:
  193. none; text-transform: uppercase; top: 1.1em; }
  194. #cancel-comment-reply-link:focus,
  195. #cancel-comment-reply-link:active,
  196. #cancel-comment-reply-link:hover { color: #ff4b33; }
  197. #respond label {display: block; float: right; font-size: 16px; line-height: 2.2em; width: 280px;}
  198. #respond input[type=text] {}
  199. #respond p { font-size: 12px; }
  200. p.comment-form-comment { margin: 0; }
  201. .form-allowed-tags { display: none; }
  202. .trackback { margin: 0 0 10px; padding: 1em; border: 1px dashed #ccc; }
  203. -----------------------------------------------------------------------------------------------
  204. functions.php
  205. For enable comment
  206. function comment_scripts(){
  207. if ( is_singular() ) wp_enqueue_script( 'comment-reply' );
  208. }
  209. add_action( 'wp_enqueue_scripts', 'comment_scripts' );
  210. For enable featured image
  211. add_theme_support( 'post-thumbnails', array( 'post' ) );
  212. for enable crop feature
  213. set_post_thumbnail_size( 200, 200, true );
  214. add_image_size( 'post-image', 150, 150, true );
  215. post-loop.php
  216. Using Featured Image
  217. <?php the_post_thumbnail('post-image', array('class' => 'post-thumb')); ?>
  218. Tutorial Link: http://rrfoundation.net/342
  219. Source Theme Download Link: http://sdrv.ms/T4THqZ
  220. WP Theme Development-5 (Dynamic Menu & Custom
  221. Templates)
  222. By Rasel Ahmed in আর আর ফাউন্ডেশনন্ডেশন ( অফিফিসিয়াল গ্রুপ )
  223. For Dynamic Menu
  224. functions.php
  225. add_action('init', 'wpj_register_menu');
  226. function wpj_register_menu() {
  227. if (function_exists('register_nav_menu')) {
  228. register_nav_menu( 'main-menu', __( 'Main Menu') );
  229. }
  230. }
  231. header.php
  232. <?php wp_nav_menu( array( 'theme_location' => 'main-menu') ); ?>
  233. An amazing readmore function
  234. functions.php
  235. function excerpt($num) {
  236. $limit = $num+1;
  237. $excerpt = explode(' ', get_the_excerpt(), $limit);
  238. array_pop($excerpt);
  239. $excerpt = implode(" ",$excerpt)." <a href='" .get_permalink($post->ID) ." ' class='".readmore."'>Read
  240. More</a>";
  241. echo $excerpt;
  242. }
  243. Usage: <?php echo excerpt('15'); ?>
  244. Using Custom Templates
  245. <?php
  246. /*
  247. * Template Name: Custom Template Name
  248. */
  249. get_header(); ?>
  250. Tutorial Link: http://rrfoundation.net/351
  251. Source Theme Download: http://sdrv.ms/T4THqZ
  252. WP Theme Development-6&7 (Custom Category Post Query &
  253. Register Custom Post)
  254. By Rasel Ahmed in আর আর ফাউন্ডেশনন্ডেশন ( অফিফিসিয়াল গ্রুপ )
  255. Query Post from a specific category
  256. <?php query_posts('post_type=post&post_status=publish&posts_per_page=10&paged='.
  257. get_query_var('paged')); ?>
  258. Register Custom Post
  259. Pastebin Code Link: http://pastebin.com/Fkgnu2KL
  260. /* Register Custom Post Types********************************************/
  261. add_action( 'init', 'create_post_type' );
  262. function create_post_type() {
  263. register_post_type( 'testimonial',
  264. array(
  265. 'labels' => array(
  266. 'name' => __( 'Testimonial' ),
  267. 'singular_name' => __( 'Testimonial' ),
  268. 'add_new' => __( 'Add New' ),
  269. 'add_new_item' => __( 'Add New Testimonial' ),
  270. 'edit_item' => __( 'Edit Testimonial' ),
  271. 'new_item' => __( 'New Testimonial' ),
  272. 'view_item' => __( 'View Testimonial' ),
  273. 'not_found' => __( 'Sorry, we couldn\'t find the Testimonial you
  274. are looking for.' )
  275. ),
  276. 'public' => true,
  277. 'publicly_queryable' => false,
  278. 'exclude_from_search' => true,
  279. 'menu_position' => 14,
  280. 'has_archive' => false,
  281. 'hierarchical' => false,
  282. 'capability_type' => 'page',
  283. 'rewrite' => array( 'slug' => 'testimonial' ),
  284. 'supports' => array( 'title', 'editor', 'custom-fields' )
  285. )
  286. );
  287. }
  288. --------------------------------------------------------------------------------------------------------------
  289. Query Custom Post List
  290. <?php query_posts('post_type=testimonial&post_status=publish&posts_per_page=10&paged='.
  291. get_query_var('paged')); ?>
  292. Query Custom Post Single
  293. copy your single.php file & rename single-<custom-post>.php
  294. <custom-post> = Custom Post Type
  295. িটউন্ডেশনটািরয়াল িলংক: http://rrfoundation.net/365
  296. েসিাসির্স িথিম ডাউন্ডনেশনলাড: http://sdrv.ms/T4THqZ
  297. পবর্স দুই এর
  298. িটউন্ডেশনটািরয়াল িলংক: http://rrfoundation.net/369
  299. েসিাসির্স িথিম ডাউন্ডনেশনলাড: http://sdrv.ms/T4THqZ
  300. Wordpress Theme Development-8 (Custom Field Tips & Tricks-
  301. 1)
  302. By Rasel Ahmed in আর আর ফাউন্ডেশনন্ডেশন ( অফিফিসিয়াল গ্রুপ )
  303. Suppose we use custom field as 'url'
  304. Display Custom Field Data
  305. <?php $key="url"; echo get_post_meta($post->ID, $key, true); ?>
  306. Display custom field if exists
  307. <?php $image = get_post_meta($post->ID, 'url', true);
  308. if($image) : ?>
  309. <img src="<?php echo $image; ?>" alt="" />
  310. <?php endif; ?>
  311. Conditional Custom Field
  312. <?php
  313. $url = get_post_meta( $post->ID, 'url', true );
  314. if ( $url ) {
  315. echo $url;
  316. } else {
  317. the_permalink();
  318. }
  319. ?>
  320. িটউন্ডেশনটািরয়াল িলংক: http://rrfoundation.net/373
  321. েসিাসির্স ফাইল ডাউন্ডনেশনলাড: http://sdrv.ms/T4THqZ
  322. Wordpress Theme Development-9 (Option Tree)
  323. By Rasel Ahmed in আর আর ফাউন্ডেশনন্ডেশন ( অফিফিসিয়াল গ্রুপ )
  324. Download Option Tree: http://wordpress.org/extend/plugins/option-tree/
  325. Usage
  326. =======================
  327. functions.php
  328. Activate Option Tree
  329. add_filter( 'ot_show_pages', '__return_false' );
  330. add_filter( 'ot_show_new_layout', '__return_false' );
  331. add_filter( 'ot_theme_mode', '__return_true' );
  332. include_once( 'option-tree/ot-loader.php' );
  333. include_once( 'includes/theme-options.php' );
  334. Create Option Tree In the theme
  335. ================================
  336. Creating Simple Option Tree In the theme: http://pastebin.com/auGpnWxP
  337. <?php
  338. add_action( 'admin_init', 'custom_theme_options', 1 );
  339. function custom_theme_options() {
  340. $saved_settings = get_option( 'option_tree_settings', array() );
  341. $custom_settings = array(
  342. 'sections' => array(
  343. array(
  344. 'id' => 'general',
  345. 'title' => 'Site Settings'
  346. )
  347. ),
  348. 'settings' => array(
  349. array(
  350. 'id' => 'logo_text',
  351. 'label' => 'Logo Text',
  352. 'desc' => 'Use H1, H2, H3 tag',
  353. 'type' => 'textarea',
  354. 'section' => 'general'
  355. ),
  356. array(
  357. 'id' => 'footer_text',
  358. 'label' => 'Footer Text',
  359. 'type' => 'textarea',
  360. 'section' => 'general'
  361. )
  362. )
  363. );
  364. if ( $saved_settings !== $custom_settings ) {
  365. update_option( 'option_tree_settings', $custom_settings );
  366. }
  367. }
  368. ?>
  369. --------------------------------------------------------------------------------------------------------
  370. Get Data From Option Tree
  371. ==========================
  372. Condtional Data
  373. <?php if ( function_exists( 'get_option_tree') ) : if( get_option_tree( 'your_tree_id') ) : ?>
  374. <?php get_option_tree( 'your_tree_id', '', 'true' ); ?>
  375. <?php else : ?>
  376. Your Default Data
  377. <?php endif; endif; ?>
  378. Simple Data
  379. <?php get_option_tree( 'facebook', '', 'true' ); ?>
  380. Tutorial Link: http://rrfoundation.net/391
  381. পপপপপপপ পপপপপ Post View Count পপপপপ পপপপ পপপপপ পপপপপপপপপপ
  382. By Hasan Fardous Ruble in আর আর ফাউন্ডেশনন্ডেশন ( অফিফিসিয়াল গ্রুপ ) (Files) · Edit Doc
  383. অফেশননেশনকই সিাইেশনট প্রশ্ন করেশনছেন িকভােশনব েপাস্ট িভউন্ড কাউন্ডন্ট যেুরক্ত করেশনবন, অফেশননেশনক প্লািগেন বযাবহোর কেশনরও পারেশনছেন না। তাই আপনােশনদের জনয এই
  384. ডকিট করলাম। িনেশনচের িনেশনদের্সশনা অফনুরযোয়ী েকাডগুলেশনলা আপনার সিাইেশনট বসিান আর েপেশনয় যোন চেমৎকার েপাস্ট িভউন্ড কাউন্ডন্ট।
  385. আপনার functions.php েত এই েকাডিট যেুরক্ত করুন
  386. // function to display number of posts.
  387. getPostViews($postID){ $count_key = 'post_views_count'; $count = get_post_meta($postID,
  388. $count_key, true); if($count==''){ delete_post_meta($postID, $count_key);
  389. add_post_meta($postID, $count_key, '0'); return "0 View"; } return $count.' Times';}
  390. // function to count views.function setPostViews($postID) { $count_key = 'post_views_count';
  391. $count = get_post_meta($postID, $count_key, true); if($count==''){ $count = 0;
  392. delete_post_meta($postID, $count_key); add_post_meta($postID, $count_key, '0'); }else{
  393. $count++; update_post_meta($postID, $count_key, $count); }}
  394. আপিন েযেখােশনন েপাস্ট িভউন্ড কাউন্ডন্ট েসিট করেশনত চোন েসিখানকার লুরেশনপ এই েকােশনডর পেশনর এই েকাডিট যেুরক্ত করুন
  395. আপিন েযেখােশনন েপাস্ট িভউন্ড কাউন্ডন্ট েদেখােশনত চোন
  396. আপনােশনদের জনয েকাডিট েপস্টিবেশনন ও েশয়ার করলাম http://pastebin.com/w9XmBQKc
  397. Support featured images on wordpress
  398. By Rasel Ahmed in আর আর ফাউন্ডেশনন্ডেশন ( অফিফিসিয়াল গ্রুপ )
  399. Code for featured images:
  400. add_theme_support( 'post-thumbnails', array( 'post' ) );
  401. এখােশনন আপিন যেিদে েপেশনজও িফচোর ইেশনমজ িদেেশনত চোন তাহেেশনল page িট যেুরক্ত করেশনত হেেশনব। েযেমন
  402. add_theme_support( 'post-thumbnails', array( 'post', 'page' ) );
  403. Different size featured imges
  404. add_image_size( 'post-image', 450, 150, true );
  405. এখােশনন প্রথিমিট width ও পেশনররিট height
  406. How call images:
  407. শুধুর ইেশনমেশনজর িলংক : <?php $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ),
  408. 'post-image' ); echo $image[0]; ?>
  409. েনাট: এটা বযবহোর করেশনল শুধুর ইেশনমজ এর িলংক আসিেশনব তাই <img src="এখােশনন উন্ডপেশনরর েকাডটা িদেেশনত হেেশনব" alt=""/>
  410. ইেশনমজ src অফেশনটােশনমিটক কল: <?php the_post_thumbnail('post-image', array('class' => 'imgthumb')); ?>
  411. এথিােশনন array িদেেশনয় আলাদো ক্লাসি েনওয়া হেেশনয়েশনছে। এখােশনন post-image িদেেশনয় িনিদের্সষ্ট সিাইেশনজর ইেশনমজ েনওয়া হেেশনচ্ছে েযেটােশনক ফাংশেশনন েদেওয়া
  412. হেেশনয়িছেল।
  413. How to add custom header and custom background in
  414. wordpress theme
  415. By Raju Ahmed in আর আর ফাউন্ডেশনন্ডেশন ( অফিফিসিয়াল গ্রুপ )
  416. Hi! i hope that all are fine.Today i want to share how to add custom header and custom background in
  417. wordpress theme. it is very simple way, i seem that every coder of wordpress theme who is known this
  418. system. By the way , it is only new coder/programmer. Thanks .
  419. =======================
  420. Title: custom background.
  421. =======================
  422. head.php
  423. ..............
  424. replace the
  425. tag using bellow the code.
  426. >
  427. ===================
  428. functions.php
  429. .........................
  430. this code put within the tag
  431. $defaults = array(
  432. 'default-color' => '#000',
  433. 'default-image' => '',
  434. 'wp-head-callback' => '_custom_background_cb',
  435. 'admin-head-callback' => '',
  436. 'admin-preview-callback' => ''
  437. );
  438. add_theme_support( 'custom-background', $defaults );
  439. ====================
  440. Title: custom Header/Logo
  441. ===================
  442. head.php
  443. ..........................
  444. Put this code where you want to upload your logo.
  445. =================
  446. functions.php
  447. ..........................
  448. this code put within the tag
  449. $defaults = array(
  450. 'default-image' => '',
  451. 'random-default' => true,
  452. 'width' => 1000,
  453. 'height' => 200,
  454. 'flex-height' => true,
  455. 'flex-width' => true,
  456. 'default-text-color' => '#000',
  457. 'header-text' => true,
  458. 'uploads' => true,
  459. 'wp-head-callback' => '',
  460. 'admin-head-callback' => '',
  461. 'admin-preview-callback' => '',
  462. );
  463. add_theme_support( 'custom-header', $defaults );
  464. ===============
  465. ওয়ার্ডপর্ডপ্রেস প্রেস িচিটকেস কার্ডপ (আপডেস ডপটক চিলবেস ব)
  466. By েমা আিরফুরল ইসিলাম সিেশননট in আর আর ফাউন্ডেশনন্ডেশন ( অফিফিসিয়াল গ্রুপ )
  467. িনেশনয় িনন ওয়াডর্সেশনপ্রেশনসির জনয দেরকাির িচেটেশনকাড
  468. <?php /*Show post author link */?> <?php the_author(); ?>
  469. <!-- show post link --> <h2><a href="<?php the_permalink(); ?>" rel="bookmark" title="Permanent
  470. Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
  471. <?php /** show post content */?> <?php the_content(); ?>
  472. <?php /** Show edit post link */?>
  473. <?php edit_post_link(); ?>
  474. <!-- show the next/previous link -->
  475. <?php next_posts_link( 'Older Entries' ); ?>
  476. <?php previous_posts_link( 'Newer Entries' ); ?>
  477. <!-- Comments popup link -->
  478. <?php comments_popup_link( 'Leave a Comment', '1 Comment', '% Comments' ); ?>
  479. <!-- Code for show blog name-->
  480. <?php bloginfo('name'); ?>
  481. <!-- Discription for blog -->
  482. <?php bloginfo(’description’); ?>
  483. <!-- The title of your blog -->
  484. <?php wp_title(); ?>
  485. <!-- code for stylesheet linking -->
  486. <?php bloginfo('stylesheet_url'); ?>
  487. <!-- Code for pingback url -->
  488. <?php bloginfo('pingback_url'); ?>
  489. <!-- Code for theme location -->
  490. <?php bloginfo('template_url'); ?>
  491. <!-- Code for Wordpress version -->
  492. <?php bloginfo('version'); ?>
  493. <!-- Atom feed link -->
  494. <?php bloginfo('atom_url'); ?>
  495. <!-- RSS2 feed link -->
  496. <?php bloginfo('rss2_url'); ?>
  497. <!-- url of your website -->
  498. <?php bloginfo('url'); ?>
  499. <!-- declairing for html type code -->
  500. <?php bloginfo('html_type'); ?>
  501. <!-- Code for Charset Set -->
  502. <?php bloginfo('charset'); ?>
  503. <!-- if statemant for post find/search -->
  504. <?php if(have_posts()) : ?>
  505. <!-- while statemant -->
  506. <?php while(have_posts()) : the_post(); ?>
  507. <!-- End while statemant -->
  508. <?php endwhile; ?>
  509. <!-- End if statemant -->
  510. <?php endif; ?>
  511. <!-- To get header.php -->
  512. <?php get_header(); ?>
  513. <!-- To get sidebar.php -->
  514. <?php get_sidebar(); ?>
  515. <!-- To get footer.php -->
  516. <?php get_footer(); ?>
  517. <!-- To get time and date -->
  518. <?php the_time('m-d-y') ?>
  519. <!-- To get pop-up comment's link -->
  520. <?php comments_popup_link(); ?>
  521. <!-- permanent link for you post/page -->
  522. <?php the_permalink() ?>
  523. <!-- Show category >>code -->
  524. <?php the_category(', ') ?>
  525. <!-- ID for post/page -->
  526. <?php the_ID(); ?>
  527. <!-- For post link -->
  528. <?php edit_post_link(); ?>
  529. <!-- list for link -->
  530. <?php get_links_list(); ?>
  531. <!-- Call for comment template -->
  532. <?php comments_template(); ?>
  533. <!-- Site page list -->
  534. <?php wp_list_pages(); ?>
  535. <!-- site cstegory list -->
  536. <?php wp_list_cats(); ?>
  537. <!-- get default calender -->
  538. <?php get_calendar(); ?>
  539. <!-- Get archive -->
  540. <?php wp_get_archives() ?>
  541. <!-- Navigation link for post -->
  542. <?php posts_nav_link(); ?>
  543. েকাডগুলেশনলা কিপ কেশনর দেয়া কেশনর আপনার Notepad++ এ েসিভ কেশনর রাখুরন।
  544. Cross browser support
  545. By Imran Khan in আর আর ফাউন্ডেশনন্ডেশন ( অফিফিসিয়াল গ্রুপ )
  546. আজ েক একটা েছোট িটপসি িনেশনয় আসিলাম।
  547. অফেশননক সিময় েদেখা যোয় িসি এসি এসি ৩ এর িকছেুর িকছেুর কাজ ক্রসি ব্রাউন্ডজার এ সিােশনপাটর্স করােশনত িকছেুরটা ঝােশনমলা হেেশনয় যোয়। আজেশনক আিম েদেখাব
  548. িকভােশনব ক্রসি ব্রাউন্ডজার এর জনয আপনার স্টাইল িসিট েক খুরব সিহেেশনজই মিডফাই করেশনবন।
  549. ১. http://prefixmycss.com/ এই সিাইট এ যোেশনবন ।
  550. ২. আপনার পুরেশনরা স্টাইল িসিট েক ১ নম্বর বক্স এ েপস্ট করুন।
  551. ৩. িপ্রিফক্স বাটন এ িক্লক করুন৪. ৩ নম্বর বক্স েথিেশনক আপনার কািঙ্খিত স্টাইল িশটিট কিপ কেশনর বযবহোর করুন।
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement