MdRocky

wordpress all functions

Feb 25th, 2015
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 3.64 KB | None | 0 0
  1. // admin bar anar jonno header ses howar age likte hoi
  2. <? wp_head(); ?>
  3.  
  4. // admin bar anar jonno body ses howar age likte hoi
  5. <?php wp_footer(); ?>
  6.  
  7. // utf-8 dynamic korar system
  8. <?php bloginfo("charset"); ?>
  9.  
  10. // title dynamic korar system
  11. <?php bloginfo("name"); ?>
  12.  
  13. // Page er title show koranor jonno
  14. <?php wp_title(); ?>
  15.  
  16. // title dynamic korar system
  17. <?php bloginfo("description"); ?>
  18.  
  19. // image link dynamic
  20. <?php echo esc_url(get_template_directory_uri()); ?>
  21. ======================================================
  22. // Menu options dynamic
  23. <?php
  24. if(function_exists("wp_nav_menu")){
  25. wp_nav_menu(array(
  26. "theme_location" => "mainmenu",
  27. "fallback_cb" => "prevrat_default_menu",
  28. 'container' => '',
  29. "menu_class" => "nav navbar-nav",
  30. "menu_id" => "nav",
  31. "link_before" => "<span>",
  32. "link_after" => "</span>"
  33. ));
  34. }
  35. ?>
  36.  
  37. // body te background change option korar system
  38. <?php body_class(); ?>
  39.  
  40. //header image ta jei div e oi div e style korte hobe
  41. background-image:url(<?php header_image(); ?>);
  42.  
  43. =============================================================================================
  44. /* Post dynamic korar system */
  45.  
  46. <?php if(have_posts()) : ?>
  47.   <?php while(have_posts()) : the_post(); ?>
  48.  
  49. /* post gula sob-somoi article tag er moddhe rakben ei ta while lup er vitor hoite hobe */
  50.      <article <?php post_class(); ?> id="post-<?php the_ID(); ?>">
  51.         <?php the_title(); ?>
  52.  
  53. /* post image anar system */
  54.     <?php the_post_thumbnail(array('class' => ' rocky')); ?>
  55.  
  56.  /* content short korar jonno readmore options 1 */
  57.  
  58.         <?php echo readmore(get_the_content(), 15); ?>
  59. /* content short korar jonno readmore options 2 */
  60.         <?php readmore(15); ?>
  61.  
  62. /* wordpress default option koto gula word show korbe select korte parben 3 */
  63.     <?php the_excerpt(); ?>
  64.  
  65. /* Date Time Author Name and Category anar system */
  66.  
  67.     <p>Date: <?php the_time("D - F - Y || g : i a"); ?></p>
  68.     <p>Posted By: <?php the_author(); ?></p>
  69.     <p>Category: <?php the_category(); ?></p>
  70.     <p><?php the_tags(); ?></p>
  71.  
  72. /* comments korar system */
  73. <?php comments_popup_link("kono comment nai", "akta comment ace", "% ta comment ace", "amitumi", "comment korte demu na"); ?>
  74.  
  75. /* eita ses hobe while lup ses howar age */
  76.    </article>  
  77.  
  78.   <?php endwhile; ?>
  79. <?php endif; ?>
  80.  
  81. ------------------------------------------------
  82.  
  83. /* page post edit korar system */
  84. <?php edit_post_link(); ?>
  85.  
  86.  
  87. /* jeikhane register post type and taxonomy show korbe oi khane code ta detay hobe */
  88. <?php while($sliders->have_posts()) : $sliders->the_post(); ?>
  89.     <h1><?php the_title(); ?></h1>
  90.     <?php the_post_thumbnail(); ?>
  91.     <?php the_content(); ?>
  92.        
  93.     Category:
  94.     <?php
  95.        
  96.         $category = get_the_terms(get_the_ID(), "slider-category");
  97.        
  98.         foreach($category as $categorys){
  99.             echo $categorys->name.", ";
  100.         }
  101.     ?>
  102.     <br />
  103.     Tags:
  104.     <?php
  105.         $tag = get_the_terms(get_the_ID(), "slider-tags");
  106.            
  107.         foreach($tag as $tags){
  108.             echo $tags->name.", ";
  109.         }
  110.     ?>
  111.        
  112.        
  113. <?php endwhile; ?>
  114.  
  115.  
  116. -------------------------------
  117.  
  118. /* slider show koranor jonno code */
  119.  
  120. <?php
  121.    $sliders = new WP_Query(array(
  122.        "post_type" => "slide"
  123.    ));                 
  124. ?>
  125.        
  126.  
  127. <?php while($sliders->have_posts()) : $sliders->the_post(); ?>
  128.    {image : '<?php $imagelink = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), "full"); echo $imagelink[0]; ?>'},
  129. <?php endwhile; ?>
  130.  
  131. -----------------------------------------
  132. /* Content short way 2 */
  133.  
  134. <?php wp_trim_words(get_the_content(), 2, read-more-option); ?>
  135.  
  136. /* Content short way 3 */
  137.  
  138. <?php the_excerpt(); ?>
  139.  
  140. /* Page subtitle dynamic */
  141. <?php echo get_post_meta($post->ID, "eita-id-detay-hobe", true); ?>
Add Comment
Please, Sign In to add comment